1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- import UIKit
- import FloatingPanel
- import SwiftyJSON
- import NextcloudKit
- extension NCNotification {
- func toggleMenu(notification: NKNotifications) {
- var actions = [NCMenuAction]()
- if let notificationActions = notification.actions, let jsonNotificationActionsActions = JSON(notificationActions).array {
- for action in jsonNotificationActionsActions {
- let label = action["label"].stringValue
- actions.append(
- NCMenuAction(
- title: action["label"].stringValue,
- icon: UIImage(),
- action: { _ in
- self.tapAction(with: notification, label: label)
- }
- )
- )
- }
- }
- presentMenu(with: actions)
- }
- }
|