Skip to content

Adding option to present modal over context #403

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

Merged
merged 2 commits into from
Jul 26, 2020
Merged

Adding option to present modal over context #403

merged 2 commits into from
Jul 26, 2020

Conversation

tbaranes
Copy link
Contributor

I have a use case where I need to present a modal over a dedicated controller on iPad (kinda like a split view controller homemade). So, I searched If there was an option to do this but didn't find any, so here it is.

I think it's the right way to do this, but I don't know if it's there right way in SwiftMessages, let me know if any changes is needed.

@wtmoose
Copy link
Member

wtmoose commented Jul 26, 2020

I think I'd do something a little bit more generic:

/**
 Normally, the destination view controller's `modalPresentationStyle` is changed 
 to `.custom` in the `perform()` function. Set this property to `false` to prevent it from
 being overridden.
*/
public var overrideModalPresentationStyle: Bool = true

...

if overrideModalPresentationStyle {
    destination.modalPresentationStyle = .custom
}

@tbaranes
Copy link
Contributor Author

Sounds good to me, I changed it.

@wtmoose wtmoose merged commit b9d445a into SwiftKickMobile:master Jul 26, 2020
@wtmoose
Copy link
Member

wtmoose commented Jul 26, 2020

Looks good, thanks!

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

Successfully merging this pull request may close these issues.

2 participants