Norway


Topics

Topics

iOS 10 adds a whole new category of apps with iMessage Apps. These run inside the Messages and can be as simple as a of stickers or as complex as person-to-person payment system. Today we’ll dip our toes into the water by creating the simplest of all iMessage Apps: a App. Let’s get started.

To begin, we’ll need to actually create the artwork for whatever we want our stickers to be.

Stickers can be animated or static, and can be any of these formats: PNG, APNG, JPEG, GIF APNG, GIF. All stickers are limited to a file size of 500 KB each.

We’ll keep things simple and just make the Swift logo into a sticker.

- swift logo sticker - #237: Creating a Sticker Pack iMessage App πŸŽ‰ – Little Bites of Cocoa – Tips and techniques for iOS and Mac development

- 237 screenshot 1 - #237: Creating a Sticker Pack iMessage App πŸŽ‰ – Little Bites of Cocoa – Tips and techniques for iOS and Mac development

Now, let’s actually create our app. We’ll open Xcode, create a new project and choose Sticker Pack Application.

We’ll give our app a name, then we’ll see our new project.

- 237 screenshot 2 - #237: Creating a Sticker Pack iMessage App πŸŽ‰ – Little Bites of Cocoa – Tips and techniques for iOS and Mac development

At this point, all we have to do is select the Stickers.xcstickers file in Xcode’s navigation and drag and drop our image file(s) into Xcode.

- 237 screenshot 3 - #237: Creating a Sticker Pack iMessage App πŸŽ‰ – Little Bites of Cocoa – Tips and techniques for iOS and Mac development

Last but not least, we can set a name and choose our desired sticker size in the Attributes Inspector on the right. There’s Small, Medium and Large. Each one will different depending on which device a user is running. (On @3x devices like iPhone 6S and 6S Plus, Small is 100Γ—100, Medium is 136Γ—136, and Large is 204Γ—204).

- 237 screenshot 4 - #237: Creating a Sticker Pack iMessage App πŸŽ‰ – Little Bites of Cocoa – Tips and techniques for iOS and Mac development

We can now build and run on our device, choose Messages as the app to run in, fire up a conversation, pick our new app and start sending Swift-y stickers to all our friends!



Source link

LEAVE A REPLY

Please enter your comment!
Please enter your name here