@ -317,6 +317,11 @@ class ImagePickerGridController: UICollectionViewController, PhotoLibraryDelegat
}
}
func updateSelectButton ( ) {
func updateSelectButton ( ) {
guard ! isShowingCollectionPickerController else {
navigationItem . rightBarButtonItem = nil
return
}
let button = isInBatchSelectMode ? doneButton : selectButton
let button = isInBatchSelectMode ? doneButton : selectButton
button . tintColor = . ows_gray05
button . tintColor = . ows_gray05
navigationItem . rightBarButtonItem = button
navigationItem . rightBarButtonItem = button
@ -389,6 +394,8 @@ class ImagePickerGridController: UICollectionViewController, PhotoLibraryDelegat
UIView . animate ( . promise , duration : 0.3 , delay : 0 , options : . curveEaseInOut ) {
UIView . animate ( . promise , duration : 0.3 , delay : 0 , options : . curveEaseInOut ) {
collectionPickerView . superview ? . layoutIfNeeded ( )
collectionPickerView . superview ? . layoutIfNeeded ( )
self . updateSelectButton ( )
// * s l i g h t l y * m o r e t h a n ` p i ` t o e n s u r e t h e c h e v r o n a n i m a t e s a n t i - c l o c k w i s e
// * s l i g h t l y * m o r e t h a n ` p i ` t o e n s u r e t h e c h e v r o n a n i m a t e s a n t i - c l o c k w i s e
let chevronRotationAngle = CGFloat . pi . nextUp
let chevronRotationAngle = CGFloat . pi . nextUp
self . titleIconView . transform = CGAffineTransform ( rotationAngle : chevronRotationAngle )
self . titleIconView . transform = CGAffineTransform ( rotationAngle : chevronRotationAngle )
@ -405,6 +412,9 @@ class ImagePickerGridController: UICollectionViewController, PhotoLibraryDelegat
UIView . animate ( . promise , duration : 0.3 , delay : 0 , options : . curveEaseInOut ) {
UIView . animate ( . promise , duration : 0.3 , delay : 0 , options : . curveEaseInOut ) {
collectionPickerController . view . frame = self . view . frame . offsetBy ( dx : 0 , dy : self . view . frame . height )
collectionPickerController . view . frame = self . view . frame . offsetBy ( dx : 0 , dy : self . view . frame . height )
self . updateSelectButton ( )
self . titleIconView . transform = . identity
self . titleIconView . transform = . identity
} . done { _ in
} . done { _ in
collectionPickerController . view . removeFromSuperview ( )
collectionPickerController . view . removeFromSuperview ( )