Swift
A Dropbox of links etc
TODO
Grab the links for this site.
Tools for using
Marathon
From here, install via brew install marathon-swift
.
ShapeShift
For moving playgrounds to iCloud / iOS.
From here
marathon install johnsundell/shapeshift
Swift UI
Mirgation to Swift 3.0
- Appleās Migration Guide
Podcasts
Newsletters
Misc
Lint
Via Swift Lint
Code currently Swift 3, undoubtedly this will change
TODO: Populate
- [[UIWebView in Swift]]
File I/O
In info.plist
add
<key>UIFileSharingEnabled</key>
<true/>
Code
// Save data to file
let fileName = "Test"
let DocumentDirURL = try! FileManager.default.url(for: .documentDirectory, in: .userDomainMask, appropriateFor: nil, create: true)
let fileURL = DocumentDirURL.appendingPathComponent(fileName).appendingPathExtension("txt")
print("FilePath: \(fileURL.path)")
let writeString = "Write this text to the fileURL as text in iOS using Swift"
do {
// Write to the file
try writeString.write(to: fileURL, atomically: true, encoding: String.Encoding.utf8)
} catch let error as NSError {
print("Failed writing to URL: \(fileURL), Error: " + error.localizedDescription)
}
var readString = "" // Used to store the file contents
do {
// Read the file contents
readString = try String(contentsOf: fileURL)
} catch let error as NSError {
print("Failed reading from URL: \(fileURL), Error: " + error.localizedDescription)
}
print("File Text: \(readString)")
Swift Snipits
Of course Swift supports
#! scripts, you can immediately execute a swift script with "xcrun swift -i".
- Inside Swift
- Generics, over at Swift Yeti.
- Immutable Swift & a discssion on Model-View-ViewModel
- http://swift-cheatsheet.co.uk/
- http://ios-blog.co.uk/tutorials/developing-ios8-apps-using-swift-create-a-to-do-application
- http://en.wikipedia.org/wiki/Swift_(Apple_programming_language)
- http://swiftlang.eu/
- http://kpbp.github.io/swiftcheatsheet
- https://github.com/jas/swift-playground-builder
-
https://developer.apple.com/library/prerelease/ios/documentation/General/Reference/SwiftStandardLibraryReference/Array.html#//apple_ref/swift/struct/Array
- Swiftly Typing
- Swift Result Type
- Swift Error Handing
Some code to write:
- https://github.com/incbee/NSImage-QuickLook
- http://stackoverflow.com/questions/5367965/show-quick-look-preview-in-a-view
- https://github.com/Fingertips/ColorPicker
- https://itunes.apple.com/gb/app/full-screen-music-for-spotify/id476589056
Swift Snipits
Of course Swift supports
#! scripts, you can immediately execute a swift script with "xcrun swift -i".
- Inside Swift
- Generics, over at Swift Yeti.
- Immutable Swift & a discssion on Model-View-ViewModel
- http://swift-cheatsheet.co.uk/
- http://ios-blog.co.uk/tutorials/developing-ios8-apps-using-swift-create-a-to-do-application
- http://en.wikipedia.org/wiki/Swift_(Apple_programming_language)
- http://swiftlang.eu/
- http://kpbp.github.io/swiftcheatsheet
- https://github.com/jas/swift-playground-builder
-
https://developer.apple.com/library/prerelease/ios/documentation/General/Reference/SwiftStandardLibraryReference/Array.html#//apple_ref/swift/struct/Array
- Swiftly Typing
- Swift Result Type
- Swift Error Handing
Some code to write:
- https://github.com/incbee/NSImage-QuickLook
- http://stackoverflow.com/questions/5367965/show-quick-look-preview-in-a-view
- https://github.com/Fingertips/ColorPicker
- https://itunes.apple.com/gb/app/full-screen-music-for-spotify/id476589056