Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 

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.

About

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

Topics

Resources

License

Releases

No releases published

Packages

No packages published

Languages

You can’t perform that action at this time.