-
-
Notifications
You must be signed in to change notification settings - Fork 69
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
Apply latest suggested project settings #262
Conversation
As suggested by Xcode 11.4.1, using defaults
Just posting this before I go to sleep, so I remember to come back to it. FYI @dive only two warnings currently, both in https://github.com/MobileOrg/mobileorg/blob/develop/Classes/Utilities/UIAlertController%2BMobileOrg.swift#L47
Will try to find time this week to resolve. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Yeah, it seems that we have to rewrite the mo_presentingViewController
to avoid these "Cast always fails" warnings from the compiler. I suggest something like this:
private static var mo_presentingViewController: UIViewController? {
let rootViewController = UIApplication.shared.delegate?.window??.rootViewController
if let controller = (rootViewController as? UINavigationController)?.topViewController {
return controller
} else if let controller = (rootViewController as? UITabBarController)?.selectedViewController {
return controller
}
return rootViewController
}
Since we already have these defined in `Global.shared.xcconfig` as discussed in #262 revert the automated changes applied by Xcode and bump the upgrade check value to bypass.
This is specifically to avoid recent "Cast always fails" compiler warnings. Tested a few minor different approaches to this refactor but just decided to go with what was suggested by @dive on #262 since it seems to work well for me in testing. #262 (review)
@dive updated based on feedback, thanks. I think this is good to go if you can take one last look. |
Tested this a bit more, seems fine and warnings are gone after last 2 commits here. Going to merge. |
As suggested by Xcode 11.4.1, using defaults