Floaty
Floaty copied to clipboard
Bug when returning to foreground
First of all, great project!
I found a bug though with the plusLayer and it is 100% reproducible. If you click on the button (making it rotate and showing the menu options) then make the app go into the background by pressing the home button for example then enter the foreground again the plusLayer is not centered anymore and is always in the top right of the button.
Duplicate of #272
Hi @kchen97
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()
}