-
-
Notifications
You must be signed in to change notification settings - Fork 6k
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
RunLoopMood changes for Swift 3.0 & Xcode 8.0 Beta 3 #1266
Conversation
- RunLoop.main is now a class var instead of a method - Thread.isMainThread is now a class var instead of a method - display link method now take the RunLoopMode struct instead of a string - set the “use legacy swift” setting to NO
Hi @liuxuan30, It contains the |
@atetlaw what's the purpose of changing to |
A couple of reasons,
On the stringliness point: the old version took a string, which meant that to call it you'd need to pass It seemed redundant to do that, when passing |
@atetlaw ok, I have to let @danielgindi take a look at this, not sure why he uses string at first place. |
👍 no problem |
@liuxuan30 Could you please take all of those issues & PRs regarding Swift 3 and leave only one? It will be finalized after the Swift 3 release, as Swift changes all the time... And will probably sneak in Charts v3 release... |
@danielgindi sure, but I need you to take a look at this PR regarding Current swift 2.3 and swift 3.0 branchs are suited for test purpose only, once Swift 3.0 is released, it is much easier for us to convert directly at that time than merging these branches. However I observed people using the same Xcode beta can generate slightly different PRs.. So I am careful with these differences |
I'm not sure if this is a mistake while merging Swift 3.0 code.. It seems intended to use |
I looked into this, it's valid. Since it has conflicts, I have manually merged it in #1296 |
It should be this way:
_displayLink.remove(from: RunLoop.main, forMode: RunLoopMode.commonModes)
This way is just redundant:
_displayLink.remove(from: RunLoop.main, forMode: RunLoopMode(rawValue: RunLoopMode.commonModes.rawValue))