-
-
Notifications
You must be signed in to change notification settings - Fork 315
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
Reload number of actions #44
Comments
Hi @RealBug, This is not actually natively supported by the library. But there is something that you can do, take a look to the code below: @IBAction func tapGestureDidRecognize(_ sender: UITapGestureRecognizer) {
let actionController = YoutubeActionController()
actionController.addAction(Action(ActionData(title: "Add to Watch Later", image: UIImage(named: "yt-add-to-watch-later-icon")!), style: .default, handler: { action in
}))
actionController.addAction(Action(ActionData(title: "Add to Playlist...", image: UIImage(named: "yt-add-to-playlist-icon")!), style: .default, handler: { action in
}))
present(actionController, animated: true, completion: nil)
DispatchQueue.main.asyncAfter(deadline: .now() + 5, execute: {
actionController.addAction(Action(ActionData(title: "Share...", image: UIImage(named: "yt-share-icon")!), style: .default, handler: { action in
}))
actionController.addAction(Action(ActionData(title: "Cancel", image: UIImage(named: "yt-cancel-icon")!), style: .cancel, handler: nil))
actionController.collectionView.reloadData()
actionController.collectionView.contentInset = UIEdgeInsets(top: 556, left: 0, bottom: 0,
})
}
|
Hi @m-revetria |
Oh too bad. You're right, at this moment there is no way to remove an action from an action controller. Depending on your use case, maybe you can implement it in the opposite way by adding the actions that you are trying to remove now after you are sure they are valid options. We are going to take this into account for the next release. Thanks! |
Hi,
Is it a possibility to reload the number of actions when the action sheet is show ? For example, I wait for a web service call to hide a row.
Thx
The text was updated successfully, but these errors were encountered: