Posts

Showing posts from December, 2014

Where is my string.replaceAll in Swift?

So prior to getting into Swift , I spent most of my time coding in either Java or Javascript, and there is one Java method that I need to use from time to time at work and that is String.replaceAll . So naturally when I started coding in Swift, one of the things that I was thought about was, does Swift have a String.replaceAll method? Well Swift does have a replaceAll method, its just called something else i.e. String.stringByReplacingOccurencesOfString . So the name is fairly logical and does make sense, its just that my brain was wired to replaceAll, prior to coming across this method.

Knowing which notification caused the iOS app to resume

This was another one of those rather simple problems that took me a while to work out, mainly because of my approach to iOS development. So how am I approaching it? well since I am new to it, I tend to not know a lot of stuff so I generally have lots of problems that I need to solve. So if I get stuck on a problem, I will simply move onto one of the other problems that need to be solved and that I can solve and later, revisit the problem I was originally stuck on. This will allow my iOS knowledge to grow and something that is  not immediately obvious initially, will be so later on. Problem I have an iOS app that uses local notifications to create a more engaging user experience. The local notifications fall into one of two distinct categories and when the app resumes via a notification, it performs a set of "app resume/awake" behaviours that are relative to the notification category. Wow, even I would have trouble following what I just wrote, so let me just make this beyon...