private
can be seen in extensions in the same file.
func shakeEm(controls: [UIControl & Shakeable])
-> array of objects that are UIControl and conform to Shakeable.
Language hasn't change all that much. Additive features.
- Swift 3.2
- Same compiler. Emulates Swift 3, but it's the same compiler.
- Allows Swift 3 syntax that has changed in Swift 4.
- 3.2 and 4.0 can coexist. Set per-target basis.
- Swift PM understands this too.
- Preview build system.
- Fast, lower overhead, especially in large projects.
- Precompiled bridging header, faster compile times.
- Shared build for coverage testing
- If you want only some functions accessible in ObjC, put them in an @objc extension.
- Strip Swift symbols enabled by default.
xcrun dyldinfo -export
to check symbols.- Should not be a problem.
- Swift standard libraries are stripped as part of app thinning.
- Recommend we leave it enabled.
- Unicode Correctness by default.
- A character is a grapheme
- Equal but differently composed grapheme, cmopare as equal
- Strings are collections in Swift 4
- Syntax to get to the end of a collection (
i...
) Substring
type.- Substrings keep a reference to the original buffer.
- Substrings can share buffer with original string.
- When the string goes out of scope, substring doesn't dissappear.
- Tradeoff -> You need to convert back a Substring to a String, like when assigning to a UILabel.text property.
- Multi-line string literals. """ (triple quote to start and end multi-line string literals).
- Indentation of the closing triple quote determines the indentantion each line.
where
closes on associated types, to keep them in sync.
- Compiler checks for access to collections.