background preloader

Learn Swift - Tutorials, Code Samples, References and more!

Learn Swift - Tutorials, Code Samples, References and more!
Related:  Swift

Ray Wenderlich | Tutorials for iPhone / iOS Developers and Gamers Swift Cheat Sheet and Quick Reference If you're new here, you may want to subscribe to my RSS feed or follow me on Twitter. Thanks for visiting! Swift Cheat Sheet and Quick Reference Now Available! Update 6/3: Updated thanks to some helpful comments/suggestions from Chris Wagner, @Craimasjien, @Alarcon, @doTheTricks, and @rbnVnznz. I am up late tonight reading Apple’s Swift book and playing around with it a bit – there’s too much exciting stuff to sleep! There’s a lot of new syntax in Swift, so I thought it might be useful if if I put together a cheat sheet / quick reference on the language. Without further ado, here is the download link: Swift Cheat Sheet and Quick Reference It summarizes the most important Swift syntax on one page to get you up to speed quickly, including: Class ImplementationMethodsCreating/Using an ObjectDeclaring VariablesControl FlowString Quick ExamplesArray Quick ExamplesDictionary Quick Examples I’ve made sure to use only materials available to the public in the creation of this. I hope this is helpful!

Hacking with Swift – learn to code iPhone and iPad apps with free Swift tutorials Erica Sadun » Swift: How to PROPERLY combine Objective C and Swift in a single project! (Part 2 of a series) erica | 4:32 pm | June 3, 2014 | Development,Swift After some handholding help by Kevin Ballard, I managed to get everything working for some complex cross-platform code. Here are the lessons along the way. There’s one entirely essential lesson, which is this: It’s not enough to just create a bridging header. And now for the more amusing bits: Feel free to drop compatibility aliases and replace them with #defines. If you’re doing cross-platform development, make sure you import Foundation in your Objective C code before you do absolutely anything else. Lessee, what else? My original write-up on this topic can be found here. (Thanks Kevin and Remy!)

shu223/iOS-9-Sampler Using Swift with Cocoa and Objective-C: Basic Setup Swift is designed to provide seamless compatibility with Cocoa and Objective-C. You can use Objective-C APIs (ranging from system frameworks to your own custom code) in Swift, and you can use Swift APIs in Objective-C. This compatibility makes Swift an easy, convenient, and powerful tool to integrate into your Cocoa app development workflow. This guide covers three important aspects of this compatibility that you can use to your advantage when developing Cocoa apps: Interoperability lets you interface between Swift and Objective-C code, allowing you to use Swift classes in Objective-C and to take advantage of familiar Cocoa classes, patterns, and practices when writing Swift code. Before you get started learning about these features, you need a basic understanding of how to set up a Swift environment in which you can access Cocoa system frameworks. Setting Up Your Swift Environment To create a Swift project in Xcode Understanding the Swift Import Process

A Swift Introduction to Realm, with Tim Oliver Sign up to be notified of new videos— we won’t email you for any other reason, ever. About the Speaker: Tim Oliver Tim Oliver hails from Perth, Australia! Hi! I am a rather unique person at Realm because I joined the company having already shipped an app using Realm: iComics, a DRM-free comic book reader. Core Data takes a very long time to learn, and you need to be aware of boilerplate code. This time last year I moved up from Core Data to SQLite, which means: Going from Objective-C and Swift down to C (not great unless you use a third-party library): structured query language.Setting up a database on my own with specific primary/foreign keys, knowing what is getting indexed and how data is being saved.Writing boilerplate code, making a query and mapping it to your abstraction model layout (Core Data does it automatically, but you have to do it manually in SQLite). If set up properly (e.g. indexes set right), you get a really good speed performance.

Swift Introducing Swift 5.1 Swift 5.1 now makes it easier to create and share binary frameworks with others. It also includes features that make it easier to design better APIs and reduce the amount of common boilerplate code. Key Features Module stability defines a new text-based module interface file that describes the API of a binary framework. Modern Swift is the result of the latest research on programming languages, combined with decades of experience building Apple platforms. Declare new types with modern, straightforward syntax. Add functionality to existing types using extensions, and cut down on boilerplate with custom string interpolations. extension Player: Codable, Equatable {} import Foundation let encoder = JSONEncoder() try encoder.encode(player) print(player) Quickly extend your custom types to take advantage of powerful language features, such as automatic JSON encoding and decoding. Perform powerful custom transformations using streamlined closures. Designed for Safety Open Source

FlexMonkey The Swift Programming Language: About Swift Swift is a new programming language for iOS and OS X apps that builds on the best of C and Objective-C, without the constraints of C compatibility. Swift adopts safe programming patterns and adds modern features to make programming easier, more flexible, and more fun. Swift’s clean slate, backed by the mature and much-loved Cocoa and Cocoa Touch frameworks, is an opportunity to reimagine how software development works. Swift has been years in the making. Apple laid the foundation for Swift by advancing our existing compiler, debugger, and framework infrastructure. We simplified memory management with Automatic Reference Counting (ARC). Swift feels familiar to Objective-C developers. Swift is friendly to new programmers. Swift combines the best in modern language thinking with wisdom from the wider Apple engineering culture. Swift is a fantastic way to write iOS and OS X apps, and will continue to evolve with new features and capabilities.

Swift for Complete Beginners – a free Hacking with Swift tutorial Swift is a fast, free, powerful and flexible programming language from Apple, and you can use it to make any kind of iPhone and iPad apps you can imagine. But if you're just starting out, you might be a bit overwhelmed: where do you start? What tutorials are best? What should you make? I have produced a huge tutorial series that teaches Swift from scratch, while helping you build over 20 real apps and games. But: not everyone likes to learn this way. I don't mind which option you choose, so I'm giving you both. If you click "Learn Swift by example" below, you'll skip the rest of this introduction and go straight to Project 1 where you start learning Swift with a real app. If you prefer to learn Swift in one lump, just click "Learn the Swift language" below to start reading this language introduction, or choose a chapter from the listing. Don't worry, you're not missing out: there is nothing in this introduction that is not covered in the subsequent projects. Learn Swift by example

Hacking with Swift – learn to code iPhone and iPad apps with free Swift 3 tutorials If this is your first time learning Swift, you should start at the introduction and continue from there. If you're already experienced with Swift, dive in wherever takes your interest! Introduction to Swift Learn the basics of Swift syntax using Xcode playgrounds – start here if this is your first time using Swift. Project 1: Storm Viewer Constants and variables, UITableView, UIImageView, FileManager, storyboards Get started coding in Swift by making an image viewer app and learning key concepts. Project 2: Guess the Flag Asset catalogs, UIButton, CALayer, UIColor, UIAlertController Make a game using UIKit, and learn about integers, buttons, colors and actions. Project 3: Social Media UIBarButtonItem, UIActivityViewController, URL Let users share to Facebook and Twitter by modifying project 1. Project 4: Easy Browser loadView(), WKWebView, URLRequest, UIToolbar, UIProgressView, key-value observing Embed Web Kit and learn about delegation, KVO, classes and UIToolbar. Project 5: Word Scramble