An Xcode 9 project, written in Swift 4, demonstrating my best practices for designing and coding classes (reference types).
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
Swift Class Best Practices.playground
.gitignore
LICENSE.md
README.md

README.md

Swift Class Best Practices

An Xcode 9 project, written in Swift 4, demonstrating my best practices for designing and coding classes (reference types).

In the accompanying tutorial, I'm going to show you some best practices that will help you design and implement classes (reference types) and then safely leverage reference semantics in Swift. Protocol-oriented programming (POP) and value semantics are all the rage now, but a promising new technology doesn't mean you should throw all your classes away. Why not add some simple constructs to your classes like copy initializers, default initializers, designated initializers, failable initializers, deinitializers, and conformance to the Equatable protocol? To get real about my sample code, I'll adopt these constructs in some classes and show you my best practices working in real life for drawing in your iOS app interfaces.

Here's an example of the drawing capabilities of one of the classes I build in the tutorial:

alt text


Copyright (c) 2018 Andrew L. Jaffee, microIT Infrastructure, LLC, and iosbrain.com.