ActionMenuItem
@available(iOS 9.0, *)
@objcMembers
@objc(PESDKActionMenuItem)
open class ActionMenuItem : NSObject, MenuItem
The menu item that is used in PhotoEditViewController
that when selected executes a given
closure.
-
The title of the menu item.
Declaration
Swift
public let title: String
-
The icon of the menu item.
Declaration
Swift
public let icon: UIImage
-
The closure to execute when selecting this menu item.
Declaration
Swift
public let actionClosure: (inout PhotoEditModel) -> Void
-
A closure that is used to determine whether this menu item is currently active.
Declaration
Swift
public let selectedClosure: ((PhotoEditModel) -> Bool)?
-
Whether this action supports editing photos.
Declaration
Swift
public let supportsPhoto: Bool
-
Whether this action supports editing videos.
Declaration
Swift
public let supportsVideo: Bool
-
Creates a new
ActionMenuItem
with the given title, icon, action and selected closure.Declaration
Swift
public convenience init(title: String, icon: UIImage, actionClosure: @escaping (inout PhotoEditModel) -> Void, selectedClosure: ((PhotoEditModel) -> Bool)?)
Parameters
title
The title of the menu item.
icon
The icon of the menu item.
actionClosure
A closure to execute when selecting this menu item.
selectedClosure
A closure that is used to determine whether this menu item is currently active.
-
Creates a new
ActionMenuItem
with the given title, icon, action and selected closure.Declaration
Swift
public convenience init(title: String, icon: UIImage, supportsPhoto: Bool, supportsVideo: Bool, actionClosure: @escaping (inout PhotoEditModel) -> Void, selectedClosure: ((PhotoEditModel) -> Bool)?)
Parameters
title
The title of the menu item.
icon
The icon of the menu item.
supportsPhoto
Whether this action supports editing photos.
supportsVideo
Whether this action supports editing videos.
actionClosure
A closure to execute when selecting this menu item.
selectedClosure
A closure that is used to determine whether this menu item is currently active.
-
Creates a menu item for the auto enhancement tool.
Declaration
Swift
static func createMagicItem() -> ActionMenuItem
Return Value
An action menu item.
-
Creates a new
ActionMenuItem
with the given title, icon, action and selected closure. This initializer should only be used from Objective-C.Declaration
Swift
convenience init(title: String, icon: UIImage, objcActionClosure: @escaping (_ObjCPhotoEditModel) -> Void, objcSelectedClosure: ((_ObjCPhotoEditModel) -> Bool)?)
Parameters
title
The title of the menu item.
icon
The icon of the menu item.
objcActionClosure
A closure to execute when selecting this menu item.
objcSelectedClosure
A closure that is used to determine whether this menu item is currently active.