-
Notifications
You must be signed in to change notification settings - Fork 7
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
pull to refresh on goal vc #130
pull to refresh on goal vc #130
Conversation
missed a few (the 'plain' ones) previously tackled the others in commit 94b5280
... avoiding a force unwrap
self.syncHealthDataButtonPressed(numDays: 7) | ||
} | ||
|
||
private var previouslySeenSyncDayAmount: [Int] { |
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.
rename: plural
@@ -419,7 +421,7 @@ class GalleryViewController: UIViewController, UICollectionViewDelegateFlowLayou | |||
self.present(alert, animated: true, completion: nil) | |||
} | |||
} | |||
self.refreshControl.endRefreshing() | |||
self.collectionView?.refreshControl?.endRefreshing() | |||
MBProgressHUD.hideAllHUDs(for: self.view, animated: true) | |||
self.collectionView!.reloadData() |
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.
collectionView? two lines earlier and collectionView! here?
be consistent
@@ -373,7 +375,7 @@ class GalleryViewController: UIViewController, UICollectionViewDelegateFlowLayou | |||
@objc func didFetchGoals() { | |||
self.sortGoals() | |||
self.setupHealthKit() | |||
self.refreshControl.endRefreshing() | |||
self.collectionView?.refreshControl?.endRefreshing() | |||
MBProgressHUD.hideAllHUDs(for: self.view, animated: true) | |||
self.collectionView!.reloadData() |
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.
!
fixed #84
provides the scrollView with a refreshControl and configures the refreshControl to refresh (poll for the changes to the graph, then refresh the goal; same as before via the navBarItem) on valueChanged
removes the now redundant refresh navBarItem
little bit of 'clean code' around the code touched