-
Notifications
You must be signed in to change notification settings - Fork 72
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
Internal improvements to both iOS and macOS #351
Conversation
@zenangst, thanks for your PR! By analyzing the history of the files in this pull request, we identified @onmyway133 and @vadymmarkov to be potential reviewers. |
Should improve test coverage for macOS #279 |
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.
Looks great!
/// - parameter completion: A completion closure that runs when your updates are done. | ||
public func reloadIfNeeded(_ changes: ItemChanges, withAnimation animation: Animation = .automatic, updateDataSource: () -> Void, completion: Completion) { | ||
collectionView.process((insertions: changes.insertions, reloads: changes.reloads, deletions: changes.deletions), updateDataSource: updateDataSource) { | ||
if changes.updates.isEmpty { |
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.
@zenangst Should we use weak self
here?
|
||
if item.size.width == 0.0 { | ||
item.size.width = view.bounds.width | ||
if item.size.height == 0.0 { item.size.height = itemView.preferredViewSize.height } |
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.
@zenangst I prefer start on the new line, just because it's easier to debug.
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.
I did this to fix the linting which... was a mistake 😎
I refactored it into it's own method now, without one-liners.
Current coverage is 69.77% (diff: 78.31%)@@ master #351 diff @@
==========================================
Files 57 58 +1
Lines 4236 4348 +112
Methods 0 0
Messages 0 0
Branches 0 0
==========================================
+ Hits 2965 3034 +69
- Misses 1271 1314 +43
Partials 0 0
|
This PR improves the macOS implementation of Spots by adding the ability to reload with components.
SpotScrollView
to properly cleanup observers on subviews.beforeUpdate
andafterUpdate
onSpotable
protocol.Spotable
objects on macOS.