mirror of
https://github.com/neon443/StickerSlack.git
synced 2026-11-30 20:54:51 +00:00
add animation for switching packs
This commit is contained in:
1 file changed
+13
-2
@@ -24,8 +24,19 @@ class MessagesRootViewController: UIViewController {
|
||||
self.trailingVC = trailing
|
||||
super.init(nibName: nil, bundle: nil)
|
||||
leadingVC.onSelect = { pack in
|
||||
self.trailingVC.pack = pack
|
||||
self.trailingVC.reload()
|
||||
self.trailingVC.view.layoutIfNeeded()
|
||||
self.trailingVC.view.transform = .identity
|
||||
UIView.animate(withDuration: 0.25) {
|
||||
self.trailingVC.view.transform = CGAffineTransform.init(scaleX: 0.9, y: 0.9)
|
||||
self.trailingVC.view.alpha = 0
|
||||
} completion: { _ in
|
||||
self.trailingVC.pack = pack
|
||||
self.trailingVC.reload()
|
||||
UIView.animate(withDuration: 0.25, delay: 0, usingSpringWithDamping: 0.5, initialSpringVelocity: 0.1) {
|
||||
self.trailingVC.view.transform = .identity
|
||||
self.trailingVC.view.alpha = 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||