PESDK
@available(iOS 9.0, *)
@objcMembers
public class PESDK : NSObject
PESDK
provides methods to unlock and customize the SDK.
-
Possible errors that could be thrown by this class.
See moreDeclaration
Swift
public enum Error : Swift.Error
-
Unlocks the SDK with the given license. Calling this method prior to using any parts of the SDK is required.
Declaration
Swift
public class func unlockWithLicense(at url: URL)
Parameters
url
The file url where the license file is located.
-
PhotoEditor SDK analytics instance. All screen views and events are logged with this instance.
Declaration
Swift
public static let analytics: Analytics
-
The progress view that is being used to display progress. You can provide your own progress view as long as it adopts the
ProgressView
protocol.Declaration
Swift
public static var progressView: ProgressView
-
Allows to set a custom dictionary that contains dictionaries with language locales. Will override localization found in the bundle, if a value is found. Falls back to
en
if localization key is not found in dictionary.Declaration
Swift
public static var localizationDictionary: [String : [String : String]]?
-
Register a custom block that handles translation. If this block is
nil
, the PhotoEditorSDK.bundle + localizationDict will be used.Declaration
Swift
public static var localizationBlock: ((String) -> String?)?
-
Register a custom block that returns custom images for the given image name. If this block is
nil
, the image from the PhotoEditorSDK.bundle will be used.Declaration
Swift
public static var bundleImageBlock: ((String) -> UIImage?)?
-
Register a custom block to modify each stage of the render pipeline. This block will be called for each render mode of each render pass and is passed a
CIImage
object and thePESDKRenderMode
that was added to the image prior to calling this ornil
if no render mode has been added for this call (i.e. for the base image). Use this block to modify the render pipeline.Attention
Doing too much work in this block can have a severe impact on performance.Declaration
Swift
public static var renderPipelineBlock: ((CIImage, PESDKRenderMode?) -> CIImage)?
-
Register a custom block that returns a
ToolbarItem
for a view controller. Both the view controller as well as the defaultToolbarItem
are passed as arguments. If you returnnil
, noToolbarItem
is pushed onto the toolbar and thus the previous toolbar item remains visible. If this block isnil
, the default toolbar item for each view controller will be used.Declaration
Swift
public static var toolbarItemBlock: ((UIViewController, ToolbarItem?) -> ToolbarItem?)?
-
Allows you to use a specific subclass instead of the default PhotoEditor SDK classes. This works across the whole framework with any public class.
Throws
Throws an error if the replacing class is not a subclass of the builting class.Note
Only set from the main thread, before you first use the object. Set up your class overrides before calling any other methods.Declaration
Swift
public static func replaceClass(_ builtinClass: NSObject.Type, with replacingClass: NSObject.Type) throws
Parameters
builtinClass
The class that should be replaced, e.g.
PhotoEditViewController.self
.replacingClass
The class that should be used instead (must be a subclass of
builtinClass
).