Category: All

How to make a Today Extension Widget in Swift

Swift Today Extension Widget

We are going to learn how to use the new feature of iOS8: Today Extension (Widget for your notification center screen). We are going to take, as the base project, the one explained here. You will learn:

  1. How to create a Today Extension in Xcode: Target
  2. How to use the method widgetPerformUpdateWithCompletionHandler
  3. How to share data between the Today Extension and the main app

At the end of the post you will have a widget that gets data from its container app. The app gets stock values from Yahoo Finance API and the widgets recovers the last one received from AAPL.

Read More

Swift App Tutorial: Swing Copters Part I

wift Copters Swing Copters

In this tutorial you are going to learn how to use SpriteKit and Swift for iOS8! We are going to make a game like Swing Copters (last game of Flappy Bird creator), in order to choose an easy and well-know example. Here is the full list of features that you will learn today:

  • How to create a SpriteKit+Swift project in Xcode 6
  • How to create a infinite scroll game with SpriteKit and Swift
  • How to use SKNode, SKSpriteNode, SKLabelNode and SKActions in Swift
  • How to use SKPhysicsBody, impulses and gravity with Swift
  • How to make transitions with SKTransion in Swift

See the video with the final app:

Read More

Swift App Tutorial: SwiftStocks (Part II)

SwiftStocks Tutorial Part 2

In the first chapter of this series, we designed a model, created a mockup, and started a swift project, ending up with the first viewController -the tableView- with some hardcoded stocks and values.

In this second post, we are going to explain:

  1. How to create a Swift project (Part I)
  2. How to hide the status bar (Part I)
  3. How to use UITableView in Swift (Part I)
  4. How to use tuples in Swift
  5. How to use switch in Swift
  6. How to use  singleton pattern in Swift (Part II)
  7. How to use web services in Swift (Part II)
  8. How to use the NSNotificationCenter in Swift (Part II)
Read More

Swift App Tutorial: SwiftStocks (Part I)

SwiftStocks Tutorial Part 1
During this tutorial we are going to develop a simple Swift app. We will create and app with swift that will show the value of some stocks. The app will have the following functionalities:

  1. Show a table with different stocks and values
  2. Search for new stocks.
  3. Show an individual stock in detail.

What you will learn:

  1. How to create a Swift project (Part I)
  2. How to hide the status bar (Part I)
  3. How to use UITableView in Swift (Part I)
  4. How to use tuples in Swift 
  5. How to use switch in Swift
  6. How to use  singleton pattern in Swift (Part II)
  7. How to use web services in Swift (Part II)
  8. How to use the NSNotificationCenter in Swift (Part II)

In order to get the stock values, we will use Yahoo Finance API. Hope you enjoy this tutorial!

Read More