Creating my first iOS extension

I'm very excited about implementing my own custom widgets into the iOS notification center! This is actually pivotal to my app's functionality so I thought it would be wise to tackle this one first.

Just by following the WWDC video: "Creating extensions" from around 10:00 to 24:00 I was able to get this going:

Check out the videos here:
https://developer.apple.com/videos/wwdc/2014/


So far so good

After creating the target, we get a Storyboard to use to help create our widget - awesome!

It's just that the image I wanted to display isn't appearing :( I was hoping to have an icon come up in the left hand corner that I got from here:
http://www.flaticon.com/packs/

...Ah I figured that you just have to make sure you add the file to 'Copy bundle resources' under 'build phases' when you access the target settings.

Getting there


Make sure the gesture recogniser is set to the 'right' or it will conflict with the notification center's method of switching to the 'notifications' section.

I got to try out the spring animation too (animateWithDuration:usingSpringDamping:...)
...Mega cool.


Now I'm having trouble getting data from a plist in another target. Just doesn't return the path when I call:

NSBundle.mainBundle().pathForResource(...)

Oops - just had to add it to the 'Copy bundle resources' (Just like the images)

Here is what it looks like

Awesome - it works!

So far all of my technical tests have worked:

  • Get info from the main app.
  • Use animation in notifications.
  • Use gesture recogniser in notifications.
  • Get images from the main app.

I found the process a lot easier than I feared - It's as simple as adding a new target! However, the testing phase seems a bit temperamental. What I mean by this is that sometimes running a build doesn't have my latest changes or doesn't push logs to the console. However it always seems to get there after a few tries!

This project is really gaining ground! Full speed ahead!