telenordigital / connect-ios-sdk

Docs 📒👉
https://telenordigital.github.io/id-docs.telenordigital.com/integrate-ios-sdk.html
Apache License 2.0
9 stars 8 forks source link

Don’t assume the web view can be presented on rootViewController #31

Closed ragnar closed 7 years ago

ragnar commented 7 years ago

Presenting the webView on rootViewController is not always possible. The application might be in a modal view controller flow.

This patch fixes crashes when rootViewController can not present modal view controllers

jorunfa commented 7 years ago

Hi! Thank you very much for contributing!

I'll look at the pull request in detail as soon as I can.

I have been thinking about changing this for a little while, since a change in the forked library was made a while ago: https://github.com/aerogear/aerogear-ios-oauth2/commit/0ca2d36cdbed1ac7c11d30ba469c94b1b611e351#diff-89399e2ce2b97eaa140bc78f92552bcfR129

I'm not sure what the simplest/cleanest solution would be. What do you think? Is your solution cleaner, maybe?

ragnar commented 7 years ago

They might solve the same problem, but the upstream change still need my code. But then it is possible to put it inside the webview handler instead.

The upstream doesn't do anything with dismisal, that is still refering to rootViewController.

jorunfa commented 7 years ago

The change is now available in 1.0.2 and CocoaPods

thihaaung6245 commented 7 years ago

Can you add the following changes to Swift 2.3 branches. Cause currently I can only use this library in Swift 2 And Xcode 7 for now. Thanks

jorunfa commented 7 years ago

I'll try to get that done as soon as I can get to it.