One Paragraph of project description goes here
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
| // #!Swift-1.1 | |
| import Foundation | |
| // MARK: - (1) classes | |
| // Solution 1: | |
| // - Use classes instead of struct | |
| // Issue: Violate the concept of moving model to the value layer | |
| // http://realm.io/news/andy-matuschak-controlling-complexity/ |
| // | |
| // MARK: CGPoint op point/size/float | |
| // | |
| func -(l: CGPoint, r: CGPoint) -> CGPoint { return CGPoint(x: l.x - r.x, y: l.y - r.y) } | |
| func +(l: CGPoint, r: CGPoint) -> CGPoint { return CGPoint(x: l.x + r.x, y: l.y + r.y) } | |
| func *(l: CGPoint, r: CGPoint) -> CGPoint { return CGPoint(x: l.x * r.x, y: l.y * r.y) } | |
| func /(l: CGPoint, r: CGPoint) -> CGPoint { return CGPoint(x: l.x / r.x, y: l.y / r.y) } | |
| func -(l: CGPoint, r: CGSize) -> CGPoint { return CGPoint(x: l.x - r.width, y: l.y - r.height) } |
| // | |
| // .* | |
| // .* | |
| // | |
| // Created by .* | |
| // Copyright .* | |
| // |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| #!/usr/bin/env ruby | |
| # gist: https://gist.github.com/3217498 | |
| # This script can be called from an Xcode 'Run Script' build phase at the | |
| # beginning of the build process, like this: | |
| # | |
| # ${PROJECT_DIR}/LocalizeStringsFromAndroid.rb ${PROJECT_NAME} | |
| # | |
| # This script should be placed in the same directory as your .xcodeproj |