From the course: Building an iOS Messages Application
Unlock this course with a free trial
Join today to access over 22,400 courses taught by industry experts.
Open host app from an extension
From the course: Building an iOS Messages Application
Open host app from an extension
- [Instructor] So let's say that you have a full application and you've created your messages extension as an appendage to that full app. What we're going to look at now is how to open that full app from your extension, and send any data that you want to send along the way. You'll need to start out by going to your full application's .plist file and adding a URL types property. In there, under item zero, add a URL identifier. I called mine openApp. This is going to correspond to the host parameter in our URL components object. Then, in URL schemes for item zero, I set the scheme to plainolnotes, all lowercase. This is going to correspond to the scheme parameter of our URL components object. From there I added a button to my storyboard in my extension. The button says Save on it, and I've connected that button to my expanded view controller class. So it has a method called saveMessage, which caused a message called .saveMessage on the delegate. Passing in the title and the note, just…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.