Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closure on completion of presentation #9

Open
markst opened this issue Dec 7, 2017 · 3 comments
Open

Closure on completion of presentation #9

markst opened this issue Dec 7, 2017 · 3 comments

Comments

@markst
Copy link

markst commented Dec 7, 2017

I'd like to be able to perform a closure after a Spotlight has completed presentation.

@markst
Copy link
Author

markst commented Dec 7, 2017

If I make AwesomeSpotlight open, I'm able to subclass AwesomeSpotlight

private class TooltipSpotlight : AwesomeSpotlight {
    var completion: (() -> Swift.Void)? = nil
}

@aleksandrshoshiashvili
Copy link
Owner

@markst, for this purpose you can implement the delegate protocol methods (don't forget assign delegate to AwesomeSpotlightView spotlightView.delegate = self):

func spotlightViewWillCleanup(_ spotlightView: AwesomeSpotlightView, atIndex index: Int) func spotlightViewDidCleanup(_ spotlightView: AwesomeSpotlightView)

Will this solve your problem?

markst added a commit to markst/AwesomeSpotlightView that referenced this issue Dec 12, 2017
@markst
Copy link
Author

markst commented Dec 12, 2017

@aleksandrshoshiashvili well combined with the example above:

func spotlightView(_ spotlightView: AwesomeSpotlightView, didNavigateToIndex index: Int) {
    if let tooltipSpotlight = spotlightView.spotlightsArray[index] as? TooltipSpotlight {
        tooltipSpotlight.completion?()
    }
}

but for this to be possible AwesomeSpotlight must be subclass-able: markst@5c9c514

markst added a commit to markst/AwesomeSpotlightView that referenced this issue Dec 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants