Tic-Tac-Toe with minimax algorithm in Swift. I ported this from Objective-C version of this project to learn nuances or changes that are needed in Swift programming for a person coming from extensive Objective-C background.
Below are summary of the changes I experienced while implementing this project
- You don’t have to subclass all your classes from NSObject
- Immutability is let, Mutability is var. Always start with ‘let'
- Yet another block syntax
- Use === to compare two object pointers
- You no longer need NSDictionary to send more than one value. Swift introduces Tuples to return multiple values
- Initialize all your variables in the class before calling super init.
For more details, Please check my blog post here http://bharath2020.in/2015/09/19/porting-to-swift-from-objective-c/