Wednesday 8 April 2015

Swift Crash Course

Beginner

Intermediate and Advanced topics

Code

Video

Thank you all for your feedback and support! :)

Swift RoadMap

Basic iOS
Learn how to make applications using the
autogenerator tools of Xcode. These are things
like storyboards and the Xcode generators like
the master-details template. Inevitably this will
be an application that uses a UITableView and
then some sort of detail view with some
buttons. Understand how connecting UI
elements with the IBActions and instance
variables works.
Objective-C
The language of iOS. You can easily write apps
without getting super familiar with Objective-C
but you should learn some of the basic
features of Objective-C. I’d make sure you
understand @property and how method
passing. In the end Objective-C is a pretty
standard Objective Orientated language.
Object-oriented Principles
Pretty much you need to learn and understand
the Delegate and Protocol patterns. You’ll use
them constantly. Everything else is just icing
on the cake
Core Data
Besides reading tutorials/articles on the topic
playing around with the core data Xcode
template is a great way to understand the
basics of Core Data. Core Data contains an
insane amount of classes and interconnected
parts, which makes it very difficult to get
going with. As you’re reading all this, keep
reminding yourself that Core Data is not a
database ORM.
API Integration
Play around with Helios.io because it’s super
awesome and will get you started with
networking and the incredibly complex world
of dealing with that stuff on iOS. Eventually
you’ll move onto integrating other SDKs (like
foursquare, instagram, twitter, etc) but just
start simple and move forward.
Core Location
This will be the first serious use of delegation.
Really the two topics you need to understand
are the MapKit view and the
CLLocationManagerDelegate.
Mobile Design
This is a slightly nebulous topic. I’ve provided
some good resources on my github project,
but the most important thing to learn is to
never. ever. ever. ever. block the main UI
thread. When you click something, the UI
should always respond
Customizing UIKit
Customizing the UI really adds an air of
professionalism to your app. The big UI
elements to learn how to customize are the
navigationbar, uitableviewcells, buttons and
the new collection view cells. These are the
bread and butter of iOS apps and everyone
customizes them.
Hardware
iOS devices have a whole host of hardware to
play with. To get going I would just focus on
the camera/photo library. That’s probably the
only hardware pieces you’ll end up using.
Core Animation
Pretty much the point of Core Animation is for
the cool factor. That’s why I put it last in this
list. I don’t find that animation really adds
much in terms of “features” but I think it’s
pretty cool and can be a lot of fun. The most
important stuff to learn here when/how to use
the transitions from UIView to UIView.

iOS Human Interface Guidelines

Essential Tools for iOS Developers

As an iOS developer there are many products, services and libraries that you must consider when building, testing, launching, marketing and monitoring your apps.
Here are the ones I have chosen to use currently.

Services

Crash Reporting

Crash reporting is essential. Knowing when you’ve introduced bugs and getting stack traces should be top of your list.
There are a wide variety of services to use for this, but the one I think stands head and shoulders above all others is Crashlytics (acquired by Twitter). The web interface design I find a little over the top, but the initial setup and email alerts are amazing.

Analytics

I have tried a lot of analytics services (even our own). At the moment I have settled on Google Analytics. It’s super simple to integrate and if you are tracking web and/or Android it’s all right there in one location. The live functionality is fun during launches and updates.

Reviews & Features

I made AppBot so of course I think it’s the best :) You need to know what people are saying about your app, you may not always like it, but good reviews are essential for a successful app. The best way to improve reviews is to read them and accept feedback.
Get a daily email digest of reviews for your apps from all countries. Once a week any Apple features of your apps in the store (e.g. Editors Choice) will be email to you.

Sales & Downloads

Of course we all want to know how are apps are going, pick any one of the following they all get the job done.

Testing

For testing I really like http://www.usertesting.com you can create an ad hoc build of your app and get videos of people using them.
A really useful looking service that I am yet to try is http://www.testelf.com, a full service mobile app testing site.

Beta Testers

You have built your app and want to send it to friends and family to check out. There are two services that stand out:
  • Hockey App – http://hockeyapp.net – reliable and solid. Paid.
  • Test Flight – http://testflightapp.com – Most regular app testers (and review sites) are already on here, so they could find it a bit easier to install your app.

Source Control

I hope your app is in source control, it’s saved me many times as a backup and it’s a great collaboration tool. My source control of choice is git (and also most open source software).
There is two services I recommend:
  • GitHub (Paid) – https://github.com – the choice of most open source software.
  • Bitbucket (Free for small teams) – https://bitbucket.org – A great option if you have a small team with lots of repositories.

Custom Web Service Hosting

If I need to use a custom web service for my application (which I write in Ruby on Rails) I current use two different hosting options depending on the size and budget of the app.
  • Amazon Web Services – http://aws.amazon.com – AWS has an amazing amount of products, great support (both paid and on the web) and is great to scale with. But it isn’t cheap, I use it for larger projects.
  • Digital Ocean – https://www.digitalocean.com – For smaller projects and personal hacks I have recently began using Digital Ocean, amazingly cheap and has been solid so far.

Collaboration & Project Management

I really like Trello http://trello.com. Free, simple and a great iPad app.

Support

Software, Frameworks & Libraries

Dependency Management

CocoaPods – http://cocoapods.org is “the best way to manage library dependencies in Objective-C projects”. Use it.

Networking

I absolutely love AFNetworking (https://github.com/AFNetworking/AFNetworking). Use it for any networking and study the code for how to write simple and clean Objective-C.

HUD / Progress

MBProgressHUD is a great drop in component for showing modal progress.https://github.com/jdg/MBProgressHUD.

Side Menu

I’m not a fan of side menus (like in Path & Facebook), but a lot of people are. More than likely you are going to have to implement one at some point. The best I have found is ViewDeck (https://github.com/Inferis/ViewDeck).

More Controls

CocoaControls – https://www.cocoacontrols.com – Is a great site to look for controls you might need.

Swift frameworks, libraries and software.

A curated list of awesome Swift frameworks, libraries and software.

UI

  • FlourishUI – Framework for modals, color exensions and buttons.
  • SwiftColors – HEX color handling as an extension for UIColor.
  • FontAwesome.swift – Use FontAwesome in your Swift projects.
  • SwiftOverlays – GUI library for displaying various popups and notifications.

JSON/XML Manipulation

  • SwiftyJSON – The better way to deal with JSON data in Swift.
  • json-swift – A basic library for working with JSON in Swift.
  • Argo – JSON parsing library for Swift, inspired by Aeson.
  • ObjectMapper – JSON Object mapping written in Swift.
  • SWXMLHash – Simple XML parsing in Swift.
  • Alamofire-SwiftyJSON – Alamofire extension for serialize NSData to SwiftyJSON.
  • Starscream – WebSockets Library

Databases

Databases implemented in Swift.
  • Realm – A mobile database that runs directly inside phones, tablets or wearables.
  • SQLite.swift – A pure Swift framework wrapping SQLite3. Small. Simple. Safe.
  • SwiftData – A simple and effective wrapper around the SQLite3 C API written completely in Swift.
  • Squeal – A Swift wrapper for SQLite databases.
  • SQLiteDB – Basic SQLite wrapper for Swift.

Testing

Libraries for testing codebases and generating test data.
  • Quick – A behavior-driven development test framework for Swift and Objective-C.
  • Sleipnir – A BDD-style framework for Swift.
  • Nimble – A Matcher Framework for Swift.

Documentation

Libraries for generating documentation files.
  • jazzy – A soulful way to generate docs for Swift & Objective-C

Events

Libraries for one-to-many communications.
  • EmitterKit – An elegant event framework built in Swift
  • Swift-Custom-Events – A very simple way to implement Backbone.js style custom event listeners and triggering in Swift for iOS development.

Queue

Libraries for working with event and task queues.
  • TaskQueue – A Task Queue Class developed in Swift.
  • Dispatcher – Queues, timers, and task groups in Swift

HTTP

Swift libraries and wrappers for HTTP clients.
  • Alamofire – an HTTP networking library written in Swift.
  • SwiftHTTP – Thin wrapper around NSURLSession in swift. Simplifies HTTP requests.
  • Net – HttpRequest wrapper written in Swift.
  • OAuthSwift – Swift based OAuth library for iOS
  • Moya – Network abstraction layer written in Swift

Caching

Libraries for caching.
  • HanekeSwift – A lightweight generic cache for iOS written in Swift with extra love for images.

Security

Libraries for generating secure random numbers, encrypting data and scanning for vulnerabilities.
  • CryptoSwift – Crypto related functions and helpers for Swift implemented in Swift programming language.
  • SHA256-Swift – Swift framework wrapping CommonCrypto’s SHA256 methods.
  • SwiftSSL – An Elegant crypto toolkit in Swift.

Logging

Libraries for generating and working with log files.
  • XCGLogger – A debug log framework for use in Swift projects.
  • Swell – A logging utility for Swift and Objective C.

Third Party APIs

Libraries for accessing third party APIs.
  • GooglePlacesAutocomplete – Simple Google Places address entry for iOS.
  • Swifter – A Twitter framework for iOS & OS X written in Swift
  • SwiftIB – An InteractiveBrokers API Library for OS X written in Swift. InteractiveBrokers is one of a few, if not the best, brokerage company provide Gateway+API solution for traders.

Extensions

  • Dollar.swift – A functional tool-belt for Swift Language similar to Lo-Dash or Underscore in Javascript.
  • swiftz – A Swift library for functional programming.
  • ExSwift – JavaScript (Lo-Dash, Underscore) & Ruby inspired set of Swift extensions for standard types and classes.
  • Observable-Swift – Value Observing and Events for Swift.
  • PromiseKit – A delightful Promises implementation for iOS.
  • Promissum – Promise library with functional combinators like mapflatMap,whenAll &whenAny.
  • Promise – Simple promises library in Swift.
  • SwiftTask – Promise + progress + pause + cancel, using SwiftState (state machine).
  • Pythonic.swift – Pythonic tool-belt for Swift – a Swift implementation of selected parts of Python standard library.
  • SWRoute – A tiny Swift wrapper. Allows you to route (hook) quite any function/method with another function/method or even a closure.
  • Euler – Swift Custom Operators for Mathematical Notation.
  • swix – Swift Matrix and Machine Learning Library.
  • Easy-Cal-Swift – Overload +-*/ operator for Swift, make it easier to use (and not so strict).
  • AlecrimCoreData – A simple Core Data wrapper library written in Swift.
  • Async – Syntactic sugar in Swift for asynchronous dispatches in Grand Central Dispatch.
  • SwiftState – Elegant state machine for Swift.
  • LlamaKit – Collection of must-have functional Swift tools.
  • ReactKit – Swift Reactive Programming.
  • Basis – A number of foundational functions, types, and typeclasses.
  • CAAnimation + Closure – Add start / completion closures for CAAnimation instances
  • SwiftyUserDefaults — a cleaner, swiftier API for NSUserDefaults

Misc

  • acli – commandline tool to download curated libraries from github (very beta)
  • R.swift – tool to get strong typed, autocompleted resources like images and segues in your Swift project

Resources

Various resources, such as books, websites and articles, for improving your Swift development skills and knowledge.

Swift Websites

Swift Books

Swift Videos

Swift Playgrounds