A co-worker at a previous workplace came to me with a problem they were working on. They needed a skewed pseudorandom number generator that, for a given range, would return numbers at the end of the range more often than numbers at the start.Read More
Working on an app for a client recently threw up an interesting issue with CPU performance. Basically we were maxing out the CPU, even on the most plain of view controllers displayed. Finding out why lead us to discover some interesting side effects to using animations.Read More
Reading someone else's code is, at best, a bit of a chore. Now imagine if that person populated their code with unnecessary speedbumps that slowed you to a crawl, thanks to helpful "developer aids."
That's what I think of Swift playground's colour literals.Read More
I just found a strange situation in Swift and, typically for that moment when you're learning something, I'm not sure if I've found a bug, a feature or something really clever I just don't understand.Read More
After trying to shoehorn coordinators into storyboards I freely admit there were a number of unanswered questions.
My plan wasn't to make a completely perfect coordinator pattern, it was to try to see if the architectural simplicity of coordinators could use the highly coupled storyboard paradigm. I think I succeeded in what I wanted to do, but the constraints of the challenge meant there are some obvious holes.Read More
I recently discovered Soroush Khanlou's NSSpain presentation on Coordinators, and once more I'm architecturally smitten. In short (and I'm being free and easy with the reality and details here, I admit), a view controller should not know about it's place in the hierarchy, therefore a coordinating object is used to push and pop view controllers as the need arises.Read More
An interesting post on Natasha the Robot's blog about data injection with storyboards and segues in swift got me to thinking. I'm using the same pattern as described in the post to set my data sources and other gubbins in prepareForSegue(_:sender:), and it seems
- Pretty unavoidable if you want to use segues as they're designed
- Uncomfortably permissive
A lot was made of the goto fail; issue on multiple Apple platforms, some of it disappointingly ill informed, especially in the comment sections.
goto is evil, you see. Possibly even eve-yil. Except it isn't, at least not always. There is a perfectly acceptable C idiom when goto is a good choice.Read More