Any guide on converting existing iOS Xcode project to iMessage project?

I have a simple iOS application that I want to convert to an iMessage application. But I don't see any guide besides starting a new app from scratch or creating a sticker extension.


I wonder if there is any documentation on how to make the conversion without starting from scratch.


Thanks in advance.

Replies

I found it pretty straightforward just following the "App Extension Programming Guide". Open your existing project and choose File>New>Target>iMessage Extension. If I recall correctly, this should create a functioning App Extension that you can test by running. Then, you need to move your app initialization into MSMessagesAppViewController:viewDidLoad, and deal with the life cycle transitions. Probably you will need to refactor your original code e.g., to split the AppDelegate into components unique to main app and those that can be shared by both app and extension.

@Tim9909 Thanks for the tip. But when I try to put old app's view into MessagerViewController, 'sharedApplication' is unavailable: not available on iOS (App Extension) - Use view controller based solutions where appropriate instead.


It seems like something off with Extension App vs. traditional App.