insert(_:completionHandler:)
Inserts a sticker into the current context.
Declaration
func insert(_ sticker: MSSticker, completionHandler: (@Sendable ((any Error)?) -> Void)? = nil)func insert(_ sticker: MSSticker) async throwsParameters
- sticker:
The sticker to be inserted.
- completionHandler:
A block that is called as soon as the insertion is complete. This block is passed the following parameter:
- error
An error object. If an error occurred, this object contains information about the error; otherwise, it is set to
nil.
Mentioned in
Discussion
Use this method to insert a sticker into the current context.
For the MSMessagesAppPresentationContext.messages context, the method places the sticker in the Message app’s input field. Users can then send the sticker by tapping Send.
For the MSMessagesAppPresentationContext.media context, the method places the image in the Messages camera or FaceTime.
This method operates asynchronously. Although the method returns immediately, the actual work is deferred and performed in the background. As soon as the attachment is inserted, the system calls the completion block on a background queue.