Tag: Apple swift
-
Happy Pi Day! — Add a Pie to the Ring Graph
For those of us in the U.S. with a geekiness toward math March 15, 2015 at 9:26:53 is going to be the best pi day ever. As the date in the American calendar format is 3/14/15, the closest approximation to pi the mm dd yy hh:mm:ss format can have. To celebrate this, I’m going to…
-
Swift Swift: Using Attributed Strings in Swift
[Updated to Swift 2.0/iOS9 9/30/15 SJL] Sometimes you want to be fancy with your strings. For most uses, a basic string works well. Normal strings have no character or paragraph formatting. They rely on the properties of the control to format them. The system only formats the full string, not parts of it. For formatting…
-
The Swift Swift Tutorial: How to Use UITableView in Swift
[Converted to to Swift 2.0/iOS9 9/28/15 SJL] The workhorse control in iOS is the table view. With both a delegate and data source it is powerful, flexible and can get a bit complicated. In this lesson, we will add a table view controller between the Pizza Demo and the Edit Price scenes in our earlier…
-
The Swift Swift Tutorial: Using Delegates and Segues in Swift Part 2 — The Pizza Demo App
In our last post, we went through a very basic framework for segues and delegates in Swift. This time, we will add the segues and delegates to the pizza demo application so we can change the prices in the dictionary for the pizzas. Swift and Xcode is still in beta, and there are quirks I’ll…
-
The Swift Swift Tutorial: Adding an MVC Model Class in Swift
[Note: Updated for Swift 2.0/iOS9 9/1/15 SJL] Last time we built a small application to compute the area of a pizza. Since it was missing a model, we are going to make an improved version of the application and add a model class, plus make a few UI changes. Since there are so many changes,…
-
The Swift Swift Tutorial:A Swift Pizza App with UI
[Updated to Swift 2.0 8/30/15] I thought I’d do some writing for the advanced beginner to intermediate level programmer. That’s a loose definition, but I’ll define it as someone who can find their way around Xcode well enough that I can say “open a single view template and add two buttons and a label” and…
-
From Brackets to Braces in Swift: Constants and Comments
In this series of posts, I’m going to explain much of Apple’s new Swift programming language. It assumes you have no earlier programming knowledge or need to brush up on a few concepts to get things working. Since the Publication of the Book The C Programming Language by Kernigan and Ritchie many decades ago, everyone…
-
From Brackets to Braces: A Swift Tutorial for Newbies
The Media was waiting for Apple to have some jaw dropping bomb of an announcement at WWDC2014, expecting some miraculous hardware like a watch or teleportation device for the iPhone. What they got in classic Apple form was totally unexpected — a new programming language, Swift. At the keynote, application developers cheered many of the…