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

Apply latest suggested project settings #262

Merged
merged 3 commits into from
May 15, 2020
Merged

Apply latest suggested project settings #262

merged 3 commits into from
May 15, 2020

Conversation

webframp
Copy link
Member

As suggested by Xcode 11.4.1, using defaults

As suggested by Xcode 11.4.1, using defaults
@webframp
Copy link
Member Author

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

Cast from 'UIViewController?.Type' to unrelated type 'UINavigationController.Type' always fails

Will try to find time this week to resolve.

@webframp webframp added the development process Categorizes issue or PR as related to fixing or improving the development process label Apr 28, 2020
Copy link
Member

@dive dive left a 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
}

MobileOrg.xcodeproj/project.pbxproj Outdated Show resolved Hide resolved
MobileOrg.xcodeproj/project.pbxproj Outdated Show resolved Hide resolved
MobileOrg.xcodeproj/project.pbxproj Outdated Show resolved Hide resolved
webframp added 2 commits May 10, 2020 23:39
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)
@webframp
Copy link
Member Author

@dive updated based on feedback, thanks. I think this is good to go if you can take one last look.

@webframp
Copy link
Member Author

Tested this a bit more, seems fine and warnings are gone after last 2 commits here. Going to merge.

@webframp webframp merged commit 6630b76 into develop May 15, 2020
@webframp webframp deleted the project-settings branch May 15, 2020 03:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
development process Categorizes issue or PR as related to fixing or improving the development process
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants