HACKING WITH SWIFT ONLINE

LEARN SWIFT FOR FREE

Hacking with Swift is a complete Swift tutorial written for Swift 3 and iOS 10, taking from you beginner to advanced using hands-on projects.


What you get

Here you can find the 39 Hacking with Swift projects plus the introduction to Swift – all available for free. Every project is updated for Swift 3 and iOS 10.

What you don't get

The online Hacking with Swift doesn't include the Xcode tips and tricks video, the guide book with revision notes and exercises, or the quick tips wall chart.

Supported with ads

This site is supported by readers who buy the Hacking with Swift e-book and by showing unobtrusive Google adverts on project chapters.

Where to start

Most people should start with the introduction to Swift, but if you're already experienced with Swift you can jump into any project that interests you!

If you can support my work by buying a book, it's hugely appreciated.
But I recognize that not everyone can afford to buy the e-book version of Hacking with Swift, so it's also available free online.

Subscribe to my newsletter

Get an immediate $5 off the Hacking with Swift e-book sent to your inbox, plus more discounts in the future!


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

Closures, method return values, booleans, NSRange

Create an anagram game while learning about closures and booleans.

Project 6: Auto Layout

NSLayoutConstraint, Visual Format Language, layout anchors

Get to grips with Auto Layout using practical examples and code.

Project 7: Whitehouse Petitions

JSON, Data, UITabBarController

Make an app to parse Whitehouse petitions using JSON and a tab bar.

Project 8: 7 Swifty Words

addTarget(), enumerated(), count(), index(of:), joined(), property observers, range operators

Build a word-guessing game and master strings once and for all.

Project 9: Grand Central Dispatch

DispatchQueue, perform(inBackground:)

Learn how to run complex tasks in the background with GCD.

Project 10: Names to Faces

UICollectionView, UIImagePickerController, UUID, classes

Get started with UICollectionView and the photo library.

Project 11: Pachinko

SpriteKit, physics, blend modes, radians, CGFloat, NSKeyedUnarchiver

Dive into SpriteKit to try your hand at fast 2D games.

Project 12: UserDefaults

UserDefaults, NSCoding, NSKeyedArchiver

Learn how to save user settings and data for later use.

Project 13: Instafilter

Core Image, UISlider, writing to the photo library

Make a photo manipulation program using Core Image filters and a UISlider.

Project 14: Whack-a-Penguin

SKCropNode, SKTexture, asyncAfter()

Build a game using SKCropNode and a sprinkling of Grand Central Dispatch.

Project 15: Animation

Core Animation, CGAffineTransform

Bring your interfaces to life with animation, and meet switch/case at the same time.

Project 16: JavaScript Injection

Safari extensions, UITextView, NotificationCenter

Extend Safari with a cool feature for JavaScript developers.

Project 17: Swifty Ninja

SKShapeNode, AVAudioPlayer, UIBezierPath, custom enums

Learn to draw shapes in SpriteKit while making a fun and tense slicing game.

Project 18: Debugging

print(), assert(), breakpoints, and view debugging

Everyone hits problems sooner or later, so learning to find and fix them is an important skill.

Project 19: Capital Cities

MKMapView, MKAnnotation, MKPinAnnotationView, CLLocationCoordinate2D

Teach users about geography while you learn about MKMapView and annotations.

Project 20: Fireworks Night

Timer, follow(path:), sprite color blending, shake gestures

Learn about timers and color blends while making things go bang!

Project 21: Local Notifications

UNUserNotificationCenter, UNNotificationRequest, UNMutableNotificationContent, UNCalendarNotificationTrigger, and UNTimeIntervalNotificationTrigger

Send reminders, prompts and alerts even when your app isn't running.

Project 22: Detect-a-Beacon

CLLocationManager, CLBeaconRegion, CLProximity

Learn to find and range iBeacons using our first project for a physical device.

Project 23: Space Race

Per-pixel collision detection, advancing particle systems, linear and angular damping

Dodge space debris while you learn about per-pixel collision detection.

Project 24: Swift Extensions

Language extensions, Swift playgrounds

Try your hand at improving the built-in data types of Swift.

Project 25: Selfie Share

Multipeer Connectivity Framework

Make a multipeer photo sharing app in just 150 lines of code.

Project 26: Marble Maze

Core Motion, collision bitmasks, array reversing, compiler directives

Respond to device tilting by steering a ball around a vortex maze.

Project 27: Core Graphics

Core Graphics

Draw 2D shapes using Apple's high-speed drawing framework.

Project 28: Secret Swift

Touch ID, device keychain

Save user data securely using the device keychain and Touch ID.

Project 29: Exploding Monkeys

Mixing UIKit and SpriteKit, texture atlases, scene transitions, destructible terrain

Remake a classic DOS game and learn about destructible terrain and scene transitions.

Project 30: Instruments

Profiling, shadows, image caching

Become a bug detective and track down lost memory, slow drawing and more.

Project 31: Multibrowser

UIStackView, multitasking for iPad, size classes

Get started with UIStackView and see just how easy iPad multitasking can be.

Project 32: SwiftSearcher

Core Spotlight, SFSafariViewController, NSAttributedString, Dynamic Type, automatic UITableViewCell sizing

Add your app's content to iOS 9's Spotlight search and take advantage of the new Safari integration.

Project 33: What's that Whistle?

CloudKit, CKRecord, CKQuery, CKQuerySubscription, AVAudioRecorder, and push messages

Build a crowd-sourced song recognition app using Apple's free platform as a service: CloudKit.

Project 34: Four in a Row

GameplayKit, GKMinmaxStrategist, GKGameModel, UIStackView, map()

Let iOS take over the AI in your games using GameplayKit.

Project 35: Generating random numbers

GameplayKit, GKRandomSource, GKARC4RandomSource, GKRandomDistribution, GKShuffledDistribution, GKGaussianDistribution

GameplayKit lets you generate random numbers in ways you soon won't be able to live without.

Project 36: Crashy Plane

SKAudioNode, GameplayKit randomization, and the guard keyword

Ever wanted to make a Flappy Bird clone? Now you can do it in under an hour thanks to SpriteKit.

Project 37: Psychic Tester

CAEmitterLayer, CAGradientLayer, IBDesignable, transition(with:), 3D Touch, WatchKit

Are you psychic? Of course not. But what if we could use our coding skills to make a game to fool your friends into thinking otherwise?

Project 38: GitHub Commits

Core Data, NSPersistentContainer, NSFetchRequest, NSSortDescriptor, NSFetchedResultsController, DateFormatter

Get on board with Core Data and learn to read, write and query objects using Apple's object graph and persistence framework.

Project 39: Unit testing with XCTest

XCTest, measure(), filter(), sort(), NSCountedSet

Learn how to write unit tests and user interface tests using Xcode's built-in testing framework.

 

 

ARTICLES


Get free Swift example code

Search 300 Swift examples, all updated for Swift 3.0 so you can be guaranteed they work.

Test your Swift skills!

How well do you know Swift? Find out with three graded language tests – good luck!

What's new in iOS 10?

Learn about MSMessagesAppViewController, UIViewPropertyAnimator, SFSpeechRecognizer, UNMutableNotificationContent, SiriKit and much more.

What's new in iOS 9?

Learn about Core Spotlight, SFSafariViewController, GameplayKit, app thinning and much more.

Free iOS 9 tutorials!

This brings together all my iOS 9 tutorials in one place, and it's the perfect way to get started with all the great new features announced by Apple.

What's new in Swift 3?

Learn about the major name changes coming up in Swift 3 with before and after examples.

What's new in Swift 2.2?

Learn about the deprecations, additions and improvements in this interim language release.

What's new in Swift 2?

A brief overview of the key changes to Swift introduced at WWDC.

New features of Swift 2 by example

Try your hand at the new error checking, guard, defer and API availability checking.

Safari Content Blocking: a tutorial by example

How to write a content blocker extension in 10 minutes (and never see the Daily Mail again).

SUPPORT MY WORK


Click here to visit the Hacking with Swift store >>