Skip to content
This repository has been archived by the owner on Jul 20, 2023. It is now read-only.

easyTipViewDidDismiss not called when calling dismiss() #33

Closed
theolof opened this issue Jun 21, 2016 · 8 comments
Closed

easyTipViewDidDismiss not called when calling dismiss() #33

theolof opened this issue Jun 21, 2016 · 8 comments

Comments

@theolof
Copy link

theolof commented Jun 21, 2016

I expected easyTipViewDidDismiss to be called when doing
self.tipView.dismiss()
but it isn't.

I do that when the user taps an overlay.
easyTipViewDidDismiss is called when the user taps the tipView (so the delegate should be correct).

Is it an issue or am I holding it wrong?

@teodorpatras
Copy link
Owner

teodorpatras commented Jun 21, 2016

Delegation call hasn't been implemented in this case because you have the completion block that gets called after the view has been dismissed:

tipView.dismiss(withCompletion:{ _ in
     // code executed after the view has been dismissed
})

@theolof
Copy link
Author

theolof commented Jun 21, 2016

OK, so I have to call the same code as I do in easyTipViewDidDismiss.
I think it would have been cleaner to always do easyTipViewDidDismiss whenever the view has been dismissed, regardless of how it was dismissed.

It works though.

@teodorpatras
Copy link
Owner

Thanks for your insight, I'll make this feature available in next release.

@teodorpatras
Copy link
Owner

teodorpatras commented Jun 21, 2016

fyi fix applied in version 0.2.1

@theolof
Copy link
Author

theolof commented Jun 21, 2016

sweet!

@choujar
Copy link

choujar commented Oct 31, 2016

I'm sorry, but I still can't work out how to perform actions when the user dismisses the tooltip by tapping on it (that seems like the default option, right?).

As in there doesn't seem to be a way to assign the delegate...

@choujar
Copy link

choujar commented Nov 22, 2016

Hi folks, any update on this?

@theolof
Copy link
Author

theolof commented Nov 24, 2016

class TheViewController: UIViewController, EasyTipViewDelegate {
...
tipView = EasyTipView(text: "The text", preferences: preferences, delegate: self)
...
func easyTipViewDidDismiss(_ tipView: EasyTipView) {
...

That's my setup. When I click the tooltip, the function easyTipViewDidDismiss is called.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants