Convert square blocks to Zawgyi with iOS8 Action Extension
Apple introduced tons of great additions to iOS experience and Extensions framework was one of the new features that I’m most excited about. Before iOS8, we could not integrate our apps with others. With iOS8, we can now integrate our apps with others to a certain extent. Here are 5 different types of extensions that app developers can now make -
- Today extensions (Widgets)
- Share extensions (For integration with Share sheet)
- Photo Editing extensions (Yay! Going to see a lot more integrated VSCO(http://instagram.com/vsco).
- Storage Provider extensions (Good news for Box, Dropbox, Drive and etc)
- Action extensions (This is the most interesting)
Let’s look at Action extensions. Basically, they allow apps to manipulate content from another app within the app itself. For instance, as part of WWDC demo, you can now translate a webpage without ever leaving safari.
There are two types of Action extensions -
- View Controller (E.g. Quickly launch a view controller to add a filter to any photo within another app)
- Extension Request Handling (E.g. Translating text within another app without showing any UI to the user)
For this Zawgyi extension, we’re using the second method. You can check out the demo video below -
var doc = document.createElement('link');
doc.href = "http://mmwebfonts.comquas.com/fonts/?font=zawgyi";
doc.rel = "stylesheet";
document.getElementsByTagName("body").style.fontFamily = "zawgyi-one";
(Note: try to use VanillaJS more)
You can check out the full source code at GitHub (https://github.com/yemyat/Zawgyi-Action-Extension).