Take this
course

Software Development / Web Development

Advanced Swift 2 Application Development

Learn to develop powerful iOS and WatchOS applications by harnessing the full potential of Swift 2

Description

About This Video

  • Master advanced iOS and WatchOS frameworks and technologies such as CoreData, CoreLocation, and CoreAnimation
  • Gain a deeper understanding of application development within Swift 2 and see the reasons behind each development decision
  • Delve into CoreData and NSManaged properties to build a data-driven application


In Detail

The number of smartphone users is increasing every single day, and as more and more of them are looking for new and interesting ways to improve their lives through mobile applications, the need for a language that will deploy on all platforms has become a necessity. This is where Swift 2 steps in, a beautifully crafted and evolving language released by Apple and used across iOS, WatchOS, tvOS, and MacOS native applications. Swift brings additional functionality and stability to your applications, allowing you to create new and exciting ideas with ease.


This step-by-step guide will help you craft beautiful, well-structured, and stable applications and help you bring innovation to life. As soon as we begin, we'll take a look at what it takes to integrate third-party libraries into our project using CocoaPods, see what the pros and cons are, and get to know how we can set our criteria on suitable libraries.


Throughout the course, we will delve deep into topics such as animation on views and layers, powering strongly data driven and location-driven applications using CoreData and MapKit, integrating our application with WatchOS, and sharing code and data between each application. Finally, we will test our application using Unit Tests and UI Tests, then walk through the process of submitting it to the App Store.


This course truly covers a vast range of topics, providing a hands-on guide throughout each subject area, and ensuring you have the right tools and knowledge to create an advanced-level application. By the end of this course, you will be able to develop iOS applications using Swift 2 and work with some of the more advanced developer frameworks.

Full details

Curriculum

  • Setting the Scene and Using CocoaPods for Dependency Management
    The Course Overview
    This video describes the overview of the entire course.
    4:11
    Reviewing the Project Code
    Before we start on the course, we need to review the current code base. • Open the project files in Xcode to see the current code • Review the User Interface in Storyboards • Review the Swift code in the project files
    3:15
    Installing CocoaPods
    Before we can begin integrating pods into our project, we need to install CocoaPods. • Open the terminal in order to access the command line • Install cocoaPods by typing:gem install –n /usr/local/bin cocoapods • Verify the version by typing:pod --version
    3:20
    Reviewing Pods
    Now that we have installed CocoaPods, we need to determine the pods we want to install and review its suitability. • Find the pod in the terminal using pod search webimage • Go to www.cocoacontrols.com and search for SDWebImage to review the framework suitability • Review the comments and visit the source page for further instructions
    3:30
    Creating a Podfile to Manage Dependencies
    We have decided on a pod we want to include, so now we want to install it in our project. • Open the terminal and go to the directory. Create a podfile using pod init • Open the podfile and include the pod using pod 'SDWebImage' • Go to the terminal and install the framework using pod install
    4:20
    Using SDWebImage for Lazy Image Loading
    The pod has been installed, so now it is time to use it. • Pen DreamSeekr.xcworkspace and go to the DreamTableViewController class • Import the SDWebimage framework using this: import SDWebImage • Replace the code in the collectionView delegate method for implementation of images with third-party code
    3:34
  • Using Animations to Bring Your App to Life
    Animating Our Views with UIView
    We need to add an animation that will present a view and then fade out to reveal our main screen. • Create a view programmatically • Add the view to the parent view • Use UIView class animations to animate the alpha property
    5:58
    Working with CALayer
    CALayers are an important component in the land of iOS, and we need to see how they fit into our world. • Instantiate a subclass of UIView • Access the layer properties on the view • Build and run the application to see the results
    3:28
    Animating with CABasicAnimation
    Animating layers is different from animating views, so we will discover how this is done. • Create a CABasicAniamtion with a keyPath • Add the animation to the layer • Build and run the application to see the results
    3:38
    Creating Our Logo in CAShapeLayer
    We want to animate our logo, so we will create the letter D using a CAShapeLayer. • Create a CAShapeLayer and set the frame • Build the UIBezierPath and add it to the Shape Layer • Add the shape layer as a sublayer
    6:12
  • Using Core Data to Persist Your Data
    Understanding Core Data Terminology
    In order to take advantage of better data persistence and working with the preferred methodology, we should make use of Core Data. • Add the Core Data Model to the project • Create a helper class to manage the Core Data functionality • Create the required CoreDataPersistent Store and Managed Object Contexts
    8:59
    Creating Entities and Attributes in the Core Data Editor
    In order to work with the data, we must first create Entities and Attributes, as well as an associated NSManagedObject. • Create an entity within Core Data Editor and add attributes • Add properties as NSManagedProperties to an NSManagedObject subclass • Create a method to populate data in NSManagedObject
    5:53
    Saving Data
    Now that we have our Entities, we should know how to save our data in the database. • Create a save method • Insert entities into the managed object context • Populate the entities and save the context
    6:15
    Retrieving Data Using NSFetchedResultsController
    Having saved some data in our database, the next thing we want to do is retrieve it. • Create an NSFetchedResultsController variable • Perform a fetch using try fetchedResultsController.performFetch() • Populate tableview with the results
    6:38
    Updating Data
    We need a way to uniquely identify data for updating and duplication checking. • Create a unique identifier attribute • Select an object using the unique identifier • Update the object with new data to replace the old data
    6:05
    Deleting Data
    Sometimes, we need to remove data from the database, so we will make use of Core Data’s inbuilt functionality to do this. • Add UITableViewRowAction to a cell • Use delete object on the managedObjectContext • Update the tableview
    2:40
    Updating the Database
    Changing the schema without migrating properly will cause your users to crash. • Create a new database version • Add NSMigratePersistentStoresAutomaticallyOptionNSInferMappingModelAutomaticallyOption as options to the persistent store coordinator • Run the application to see the data migrate
    3:37
  • Implementing Core Location and MapKit
    Implementing Core Location to Receive Your users’ Location Updates
    We want to be able to work with our user’s location to provide great location-based services. • Create an instance of LocationManager • Set the usage type and start updating the location • Add a user message into Info.plist
    4:41
    Creating a MapView and Centering on Their Position
    In order to display our user’s information, we need to create a MapView. • Import MapKit and create a MKMapView • Add a Map Viewas a view in loadView • Present or push to the view controller
    6:36
    Creating Map Annotations to Display Your Data
    In order to present the information in the MapView, we will need to generate annotations. • Fetch the data you want to present from core data • Create an MKAnnotation with coordinates • Add annotations to MapView
    5:55
    Working with MapView Delegate Methods
    There are many delegate methods we would want to work with, but one of the most important is selecting the annotation. • Set the mapview delegate • Implement the mapview delegate protocol on UIViewController • Add in functionality with the didSelectAnnotation method
    7:54
  • Creating a WatchOS 2 Application
    Adding a Watch Target
    Before we can start creating a Watch application that will be paired to our iOS application, we need to add a WatchOS target to our project. • Add a watch target to the project • Choose the WatchOS components • Review the new schemes created
    2:53
    Working with the Interface Builder
    The watch Interface builder has many similarities to iOS but many differences as well. So we want to create a table view to display our dreams. • Open the interface builder in Watch App • Drag tableview onto the interface • Create a table row controller to manage data
    4:42
    Making Use of App Groups
    In order to make use of Core Data in both targets, we need to use the App Groups entitlement. • Add an App Group entitlement to the project • Share classes between targets • Set the Core Data path using the App Group URL
    3:57
    Working with WCSession
    We want to send messages across from iOS and Watch OS applications, and we can do this with WCSession. • Create a WCSession default session and set the delegate at both ends • Send a message using the send method • Receive the message using the delegate callback
    7:10
    Navigating Through the App
    As with the iOS app, we can navigate across multiple controllers and pass data between them. • Create a segue in the Interface Builder and name it • Send data across to the next controller using a context • Awaken the next controller with the context and check the value
    4:37
    Implementing a Complication
    A complication is a new way for users to get snapshots of data for your watch app on their device screen and get immediate access to your app. • Create a subclass of NSObject with the CLKComplicationDataSource protocol • Add in the relevant delegate methods • Ensure that the correct template types are added to the target
    7:58
  • Testing Your Application
    Introducing Unit Tests
    The quality of our code is only as good as the quality of our tests, so let’s add some unit tests to validate our code base. • Go to the project • Click on add target and select Unit Tests • Enter the relevant information and click on enter
    3:14
    Setting Up and Tearing Down Tests
    There is often repetitive code that we will want to implement before and after each test. Fortunately, XCTestCase provides a way to do this. • Go to XCTestCase and create a setup method • Populate this with the code you want to run before each test • Create a teardown method populated with code to run after the test
    3:37
    Using XCAssert to Validate Code
    We will need a way to validate the results we receive on each test. • Create a test method • Run code • Validate the results using XCAssert
    5:38
    Looking at Code Coverage Reports
    When we write our tests, we don’t always know whether we are writing breadth or depth in testing. Code coverage reports allow us to see how much of our code is being tested. • Edit the scheme and go to tests • Check the Gather Coverage Data box • Run the tests and review the report
    2:41
    Using Xcode to Record UI Tests
    Unit tests are good, but we also want to validate that our UI is working as expected, so we need to introduce UI Tests. • Add a UI Test target to the project • Click on a test and begin recording • Navigate around the app and see the tests being recorded
    2:45
  • Preparing an App for Submission
    Creating a Distribution Certificate
    In order to be able to upload our application, we must first sign it with a Distribution certificate and provisioning profiles. • Go to Membercenter and click on the Certificates, Identifers and Provisioning profiles section • Add a certificate and follow instructions • Create provisioning profiles on App Ids and sign with the certificate
    5:04
    Setting Up the App in iTunes Connect
    Before we can upload our binary, we must create a new application in iTunesConnect. • Go to itunesconnect.apple.com and sign in • Go to apps and create a new app • Add in the relevant information
    1:47
    Archiving the App and Uploading It to iTunes Connect
    Now that we have everything we need set up, we want to create an archive and upload it to iTunesConnect. • Add code signing and provisioning profiles to build settings • Select Generic iOS Device and archive the application • Upload to iTunesConnect in Organizer
    3:09

Skills

  • iOS
  • Swift 2.0

Similar Courses

More Courses by this Instructor