Floaty Action Button - Plus Symbol Moving out of Button
Contreux opened this issue · comments
When one taps on the action button it will bring up the actions but if you move the app into background mode without closing the action button when reentering the app the Plus symbol moves up and across into a different position.
Close the action button when navigating away
Similar to #266
Hi @willMorph
Quick fix is to call floaty.close()
on following events:
- View will disappear
- When app moves to background
override func viewDidLoad() {
super.viewDidLoad()
let notificationCenter = NotificationCenter.default
notificationCenter.addObserver(self, selector: #selector(appMovedToBackground), name: UIApplication.willResignActiveNotification, object: nil)
}
override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
appMovedToBackground()
}
@objc func appMovedToBackground() {
floaty.close()
}