Tag: iPhone Programming
-
Change UIColors to RGB and HSB colors
One dilemma you’ll find when working with colors is switching between color systems. There’s two you’ll most often be using: the Red-Green-Blue or RGB and Hue-Saturation-Brightness or HSB. Download the Exercise file and run. It will give you the HSB value, but what if you want a RGB Value for that color? What if you…
-
Programmatically Add Split View Controllers
An often ignored but rather powerful View Controller is the UISplitViewController. You can make one from a template and the storyboard, but I often skip both and do it programmatically, which is especially good when I’m prototyping in a playground. Let’s give it a try using the exercise files I’ve been using for the past…
-
Thrown Errors
There’s many ways to handle errors in Swift. For some errors, using throws is a great way to handle errors without crashing the system. Download the exercise file. You’ll find a project with an embedded playground. While there’s a lot better ways to do this, I’ll use an example of a function coffee(name:) that finds…
-
This Old App: Update to Xcode 9
A few months ago, Apple threw out my app Interval Runcalc for being too old. While it wasn’t the most innovative, complex or profitable, it was an app I used frequently myself. It was a calculator for time, pace and distance for running not only for straight runs but for the run/walk/run community who use multiple-speed…
-
Swift Swift: Using NSTimer to Make a Timer or Alarm
With the launch of the Apple Watch it’s time for timers in iOS and WatchKit. Learning to use timers is a very important skill for most developers. There are many places we need to schedule regular intervals of time to do things. In my WatchKit series I’m writing a workout interval timer which tells the…