Tag: Apple Swift
-
Emoji Tac Toe Opened Sourced
Happy Father’s Day! To celebrate my 28th Father’s Day I’ve opened sourced Emoji Tac Toe. It’s actually not a big deal to anyone but me. It’s kinda of scary open sourcing code that you wrote alone and without first cleaning it up. But what the heck. If someone can learn something from this code,…
-
JavaScript, Swift, and Kotlin Oh My!
This blog post now lives on http://blog.viacom.tech/2017/05/31/the-co-evolution-of-javascript-swift-and-kotlin/ (and it’s much shorter and better!)
-
Swift Programming: Filtering vs For Loops
The current version 3.1 has come a long way from the Yet-Another-C-Based-Syntax of the 1.0 version of Swift. One of the best features of Swift is how functional programming idioms are integrated into the core of the language. Like JavaScript, you can code in Swift in several methodologies, including procedural, declarative, object-oriented, and functional. I…
-
Notes on NSUserPreferences
You can set and get NSUserPreferences from any view controller and the app delegate to they are a great way to pass data around the various parts of your iOS App. Note: NSUserPreferences don’t cross the iOS/watchOS boundry. iOS and watchOS apps each have their own set of NSUserPreferences. In the example below you have…
-
Code Markup in Xcode
I’m working on a fairly large Swift project. Actually no, that’s not quite true. I’m working on a Swift project with a ViewController file that is getting disorganized and out of control. If this keeps up I might have a large project on my hands but right now it’s just a single file that is…
-
Fun with Core Graphics and Swift Part 2
Hey, you have 10 minuets, don’t you? Then you can add pinch and rotate gestures to our fake-genigraphics app. I didn’t realize it would be this easy. But sometimes Apple’s developer tools engineering team does something amazing–and gesture recognizers are super amazing. A good way to start is to read the UIGestureRecognizer Tutorial on Ray…
-
Fun with Core Graphics and Swift
A long time ago in a galaxy far, far away… I was a computer graphics artist. Specifically I was a Genigraphics console operator. I worked the night shift creating illustrations and slides with vector graphics for big corporations. This was the early 1980s and fast, cheap personal computers with color graphics had not quite been…
-
The Secret to Swift is Enums
I’ve found the CS193P (Developing iOS 8 Apps with Swift) iTuneU class really helpful in wrapping my old Objective-C head around Apple’s new Swift programming language. Yes, I know we’re at iOS9 but the fundamentals of the class are still relevant and coaxing the code to compile in iOS 9/Swift 2.0 is a fun little…
-
Nothing Changes More Swiftly than Apple’s Swift Syntax
I’m enjoying the Stanford University class CS193P: Developing iOS 8 Applications with Swift. It’s free on iTunes U and the instructor Paul Hegarty knows his stuff. He’s a great explainer. I like how first he writes some code in a naive way and then fools around with it, getting it to work and then reworking…