Performed small cleanups and refactors to silence warnings#214
Merged
Conversation
The small cleanups performed in this patch was: - Update the project's build settings to XCode's recommended settings - Change objc inference to Default, which is recommended in Swift 4 - Removed check for C.IndexDistance == Int, which is deprecated in Swift 4 as IndexDistance are all now Ints - Change addConstraint calls to changing isActive instead, recommended by Apple
cmyr
approved these changes
Jul 3, 2018
Member
cmyr
left a comment
There was a problem hiding this comment.
Cool, this all looks good. Thanks!
| // Determines the gesture type based on flags and click count. | ||
| private func clickGestureType(event: NSEvent) -> String { | ||
| let flags = event.modifierFlags.rawValue >> 16 | ||
| _ = event.modifierFlags.rawValue >> 16 |
Member
There was a problem hiding this comment.
I think this is a relic of how we used to send modifiers; we can just remove it now.
raphlinus
approved these changes
Jul 6, 2018
Member
raphlinus
left a comment
There was a problem hiding this comment.
Always nice to have silent warnings, thanks.
Member
Author
|
@raphlinus You meant not having them? :P |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The small cleanups performed in this patch were:
Mostly to silence build warnings.
More info on this can be seen at the proposal for this change. For xi-mac, this would remove extraneous objc entry points, which has been seen to increase binary size and adversely impact load time. Since we already explicitly define objc entry points when interacting with UI elements, this change would not affect us too much.
4 as IndexDistance are all now Ints
Since we are now on Swift 4, checking for IndexDistance type for Int is no longer required.
by Apple
From the addConstraint docs:
Barring the iOS part, using isActive instead of addConstraint would avoid cases where the constraints are added to wrong views, which can happen often when working with subviews.