-
Notifications
You must be signed in to change notification settings - Fork 186
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unwanted Results via PopMenuManager #19
Comments
I'm seeing this issue and I thought it was an issue with how I programmed. But after reviewing the documentation countless times and viewing your examples, this bug is getting pretty annoying. Any updates? |
@HackShitUp sorry for the inconvenience it had caused you, yeah I am aware of this bug and there will be a patch for all of the issues by the end of month December, thank you for the support! |
@HackShitUp for now the easiest way as a workaround would be using the |
@CaliCastle Happy New Year (if you'are around the U.S. haha)! So I do use that in our application, but the issue still persists. Do you know why the carryovers occur? I can try and fix it myself if I can understand the problem |
@HackShitUp hi, happy New Years to you too!! Actually this fix is already completed in my local environment I just need to make some adjustments before releasing an update, it'll be sometime later this week, thanks for the support and using PopMenu, I appreciate it! |
Awesome! Thank you so much!
|
@HackShitUp fixed in v2.1.2 |
@CaliCastle I still get this issue whenever I'm presenting it from a UICollectionViewCell. // Unwrap the 'Capsule' PFObject
guard capsule != nil else { return }
// MARK: - UINotificationFeedbackGenerator
let feedbackGenerator = UINotificationFeedbackGenerator()
feedbackGenerator.notificationOccurred(.success)
// MARK: - PopMenu
let manager = PopMenuManager.default
manager.popMenuAppearance.popMenuColor.backgroundColor = .solid(fill: .white)
manager.popMenuAppearance.popMenuFont = UIFont.demibold(size: 14)
manager.popMenuAppearance.popMenuCornerRadius = 16
manager.popMenuAppearance.popMenuItemSeparator = .fill(.groupTableViewBackground, height: 1)
manager.popMenuShouldDismissOnSelection = true
// Unlock Capsule
let unlockAction = PopMenuDefaultAction(title: "Unlock", image: UIImage(named: "Unlocked")!, color: UIColor.black) {
(action: PopMenuAction) in
// MARK: - PFObject(className: "Capsule")
self.capsule["isPrivate"] = false
self.capsule.saveInBackground(block: { (success: Bool, error: Error?) in
if success {
// MARK: - CSAlertManager
CSAlertManager.shared.showAlertBanner(title: "β
Unlocked Album", color: UIColor.black.withAlphaComponent(0.80))
DispatchQueue.main.async {
// Reset the lockButton
self.lockButton.setImage(nil, for: .normal)
}
// MARK: - NotificationCenter
NotificationCenter.default.post(name: GalleryViewController.reloadCapsules, object: nil)
} else {
print(error?.localizedDescription as Any)
// MARK: - CSAlertManager
CSAlertManager.shared.showAlertBanner(title: "π© Couldn't Unlock Album", color: UIColor.black.withAlphaComponent(0.80))
}
})
}
// Lock Capsule
let lockAction = PopMenuDefaultAction(title: "Lock", image: UIImage(named: "Locked")!, color: UIColor.black) {
(action: PopMenuAction) in
// MARK: - PFObject(className: "Capsule")
self.capsule["isPrivate"] = true
self.capsule.saveInBackground(block: { (success: Bool, error: Error?) in
if success {
// MARK: - CSAlertManager
CSAlertManager.shared.showAlertBanner(title: "β
Locked Album", color: UIColor.black.withAlphaComponent(0.80))
DispatchQueue.main.async {
// Reset the lockButton
self.lockButton.setImage(UIImage(named: "Locked"), for: .normal)
self.lockButton.addTarget(self, action: #selector(self.unlockCapsule(_:)), for: .touchUpInside)
}
// MARK: - NotificationCenter
NotificationCenter.default.post(name: GalleryViewController.reloadCapsules, object: nil)
} else {
print(error?.localizedDescription as Any)
// MARK: - CSAlertManager
CSAlertManager.shared.showAlertBanner(title: "π© Couldn't Lock Album", color: UIColor.black.withAlphaComponent(0.80))
}
})
}
// Edit Capsule
let editAction = PopMenuDefaultAction(title: "Edit Name", image: UIImage(named: "Pen")!, color: UIColor.black) {
(action: PopMenuAction) in
manager.popMenuDidDismiss = { didSelect in
// MARK: - CSAlertManager
CSAlertManager.shared.renameCapsule(self.capsule, completionHandler: { (object: PFObject, success: Bool) in
if success {
// MARK: - NotificationCenter
NotificationCenter.default.post(name: GalleryViewController.reloadCapsules, object: nil)
}
})
}
}
// Send Capsule
let sendAction = PopMenuDefaultAction(title: "Send", image: UIImage(named: "TabChat")!, color: UIColor.black) {
(action: PopMenuAction) in
manager.popMenuDidDismiss = { didSelect in
if didSelect == true {
// MARK: - TagUsersViewController
let tagUsersVC = TagUsersViewController.init(delegate: self, type: .send, existingUsers: nil, object: self.capsule)
// MARK: - CSNavigationController
let csNavigationController = CSNavigationController.init(rootViewController: tagUsersVC, type: .pushPop)
csNavigationController.presentNavigationFrom(viewController: self.parentViewController!)
}
}
}
// Delete Capsule
let leaveAction = PopMenuDefaultAction(title: "Leave Album", image: UIImage(named: "LeaveButton")!, color: UIColor.black) {
(action: PopMenuAction) in
manager.popMenuDidDismiss = { didSelect in
if didSelect == true {
// MARK: - UIAlertController
let alertController = UIAlertController.init(title: "Leave Album?", message: "Are you sure you would like to leave this album? Your friends would have to add you again to add moments to them.", preferredStyle: .actionSheet)
// Leave Action
let leaveAction = UIAlertAction.init(title: "Leave Album", style: .destructive, handler: { (action: UIAlertAction) in
self.capsule.remove(PFUser.current()!.objectId!, forKey: "collaborators")
self.capsule.saveInBackground(block: { (success: Bool, error: Error?) in
if success {
// Remove the 'Capsule' object id
PFUser.current()!.remove(self.capsule.objectId!, forKey: "autoSaveKeys")
PFUser.current()!.saveInBackground()
// MARK: - CSAlertManager
CSAlertManager.shared.showAlertBanner(title: "π’ Sad to see you go...", color: UIColor.black.withAlphaComponent(0.80))
// MARK: - NotificationCenter
NotificationCenter.default.post(name: GalleryViewController.reloadCapsules, object: nil)
} else {
print(error?.localizedDescription as Any)
// MARK: - CSAlertManager
CSAlertManager.shared.showAlertBanner(title: "π© Couldn't Unlock Album", color: UIColor.black.withAlphaComponent(0.80))
}
})
})
// Cancel Action
let cancelAction = UIAlertAction.init(title: "Cancel", style: .cancel, handler: { (action: UIAlertAction) in
alertController.dismiss(animated: true, completion: nil)
})
alertController.addAction(leaveAction)
alertController.addAction(cancelAction)
self.parentViewController?.present(alertController, animated: true, completion: nil)
}
}
}
if capsule!.value(forKey: "isPrivate") as! Bool == false {
//
// Lock
//
manager.addAction(lockAction)
} else {
//
// Unlock
//
manager.addAction(unlockAction)
}
manager.addAction(editAction)
manager.addAction(sendAction)
manager.addAction(leaveAction)
manager.present(sourceView: self) |
βπ» Issue Description
There will be some unwanted carryovers in a result of using the
PopMenuManager
to construct the menuThe text was updated successfully, but these errors were encountered: