-
Notifications
You must be signed in to change notification settings - Fork 283
Update to Swift 3~5 (Xcode 8~11.2.1) + Resolve memory leaks + SPM support #66
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
Open
ApolloZhu
wants to merge
20
commits into
nghialv:master
Choose a base branch
from
ApolloZhu:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
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
Finally able to solve? this: LiulietLee/Pick-Color#2 MKLayer’s superLayer observers MKRefreshControl’s parentScrollView observers MKSwitch’s parent MKSwitch It’s sad that when containing MKLayer and MKRefreshControl, current implementation requires calling `recycle` in `deinit`…
- Remove self, type delcaration, use lazy init, parameter same as default - Merge if-let, use optional changing for short ones, use implicit unwrapped for guaranteed, - Replace file private with private, provide public init for an open class - Update README
Update MKButton.gif link
Why is NS_EXTENSION_UNAVAILABLE or APPLICATION_EXTENSION_API_ONLY not a thing in Swift?
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.
Since the repo is no longer maintained, use this in your Podfile instead:
or in your Package.swift:
This version is compatible, theoretically, with any version from Swift 3 to 5 (solve #63 and #72)
This implementation also removed the strong reference cycles (which are causing memory leaks).
I'm aware of this issue a long time ago, but had no idea why just declaring superLayer as
weakcauses unexpected crashes. Thanks to @theMeatloaf for his solutions in Swift 2, we only need to manually remove the observers by callingrecyclemethod of MKLayer and MKRefreshControl if a class owns such properties directly. I can't figure out a way for us to automatically remove the observers, especially when the timedeinitof MKLayer gets called, superLayer is already nil. Therefore, if you have a better solution, please definitely help.And yes, in addition to MKLayer and all other classes that has a property of type MKLayer, MKRefreshControl has strong reference loop and observer not removed, and MKSwitch has a strong reference loop, too.