Changes

Jump to: navigation, search

Creating an iOS 9 Action Extension

20 bytes removed, 20:34, 1 February 2016
m
Text replacement - "<google>BUY_IOS9</google>" to "<htmlet>ios9</htmlet>"
<googlehtmlet>BUY_IOS9ios9</googlehtmlet>
The user interface for the Action extension is contained in the MyActionExt -> MainInterface.storyboard file. Locate this file in the project navigator panel and load it into Interface Builder.
<googlehtmlet>BUY_IOS9ios9</googlehtmlet>
By default, Xcode has created a template user interface consisting of a toolbar, a “Done” button and an image view. The only change necessary for the purposes of this example is to replace the image view with a text view. Select the image view in the storyboard canvas and remove it using the keyboard delete key. From the Object Library panel drag and drop a Text View object onto the storyboard and position and resize it so that it fills the space previously occupied by the image view.
}
</pre>
<googlehtmlet>BUY_IOS9ios9</googlehtmlet>
When the above code is executed, the data associated with the attachment will be loaded from the host app and the specified completion handler (in this case a method named handleCompletion) will be called. Clearly the next step is to implement this completion handler. Remaining within the ActionViewController.swift file, declare an optional variable named convertString and implement this handler so that it reads as follows:
Figure 87-8
<googlehtmlet>BUY_IOS9ios9</googlehtmlet>
Once the extension is accessible, select it to launch the action, at which point the extension user interface should appear displaying the text from the note in uppercase using a larger font:
<googlehtmlet>BUY_IOS9ios9</googlehtmlet>

Navigation menu