Floaty icon indicating copy to clipboard operation
Floaty copied to clipboard

Bug when returning to foreground

Open kchen97 opened this issue 4 years ago • 3 comments

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.

kchen97 avatar Jun 12 '20 21:06 kchen97

This bug exists since long back. Check here

I am still facing this issue.

saurabh-selldo avatar Jul 12 '20 18:07 saurabh-selldo

Duplicate of #272

saurabh-selldo avatar Jul 12 '20 19:07 saurabh-selldo

Hi @kchen97 Quick fix is to call floaty.close() on following events:

  1. View will disappear
  2. 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()
}

saurabh-selldo avatar Jul 12 '20 20:07 saurabh-selldo