Last active
October 26, 2017 08:11
-
-
Save imgly-gists/e7e2fc0f6be89617f3d3468e7d4216ca to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| func stickerSelectionController(_ stickerSelectionController: StickerSelectionController, didSelect sticker: Sticker, with image: UIImage) { | |
| guard let referenceSize = delegate?.stickerViewControllerReferenceSize(self) else { return } | |
| var model = StickerSpriteModel(sticker: sticker) | |
| let aspectRatio = referenceSize.width / referenceSize.height | |
| model.normalizedCenter = CGPoint(x: 0.5, y: 0.5) | |
| model.normalizedSize = CGSize(width: 0.3, height: 0.3 * aspectRatio) | |
| delegate?.stickerViewControllerDidFinish(self, stickerModel: model) | |
| dismiss(animated: true, completion: nil) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment