User Tools

Site Tools


ios-labs-f15:start

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
ios-labs-f15:start [2015/10/21 19:41]
achin
ios-labs-f15:start [2015/10/30 12:04] (current)
mbarboi
Line 8: Line 8:
  
 [[https://​docs.google.com/​presentation/​d/​1HcV2kBdjdOZzGV9D2N8sc_OOvNorVjmFYu4w7wikexA/​edit?​usp=sharing|Week 3 Slides]] [[https://​docs.google.com/​presentation/​d/​1HcV2kBdjdOZzGV9D2N8sc_OOvNorVjmFYu4w7wikexA/​edit?​usp=sharing|Week 3 Slides]]
 +
 +[[https://​docs.google.com/​presentation/​d/​16BTLmHk1JQzTwAoZimGI0xcz4n8HvsrPGPOyawa6TE4/​edit?​usp=sharing|Week 4 Slides]]
 +
 +[[https://​gist.github.com/​damouse/​d34a8506aad904943f8a|Closures and Optionals Playground]]
 +
 +
 +=====Midterm Topics=====
 +These are the basic topics covered this semester presented as *first principles* (see a great explanation of first principles from [[http://​www.youtube.com/​watch?​v=NV3sBlRgzTI|Elon]]). This means that the first tier of information requires no knowledge of iOS programming to understand and is easily accessible. The second tier relies on a comprehensive understanding of the first tier, and so on with the last. Each page should be the pure essence of the topic, the bare minimum needed to understand and use it. 
 +
 +Each of the pages are split into three categories based on your TA's somewhat arbitrary sense of difficulty. ​
 +**Consider this a topics list for the exam,.** You will not be tested on topics followed by an asterix.
 +
 +===Basics===
 +  *[[ios-labs-s14:​basics-mvc|MVC Theory]]
 +  *Basic Interface
 +    *[[ios-labs-s14:​basics-ib|IB]]
 +    *[[ios-labs-s14:​basics-views|Common UIViews]]
 +    *[[ios-labs-s14:​basics-tables|UITableView]]
 +  *Basic Controller
 +    *[[ios-labs-s14:​basics-controllers|ViewControllers]]
 +    *[[ios-labs-s14:​basics-navs|UINavigation Controller]]
 +  *Basic Model
 +    *[[ios-labs-s14:​basics-nsurl|NSURLSession]]*
 +    *[[ios-labs-s14:​basics-json|JSON ]]
 +  *Basic Swift
 +    *[[ios-labs-s14:​basics-objects|Objects]]
 +    *[[ios-labs-s14:​basics-methods|Methods]]
 +    *[[ios-labs-s14:​basics-structs|Data Structures]]
 +    *[[ios-labs-s14:​basics-delegation|Delegation]]
 +  *Basic Development
 +    *[[ios-labs-s14:​basics-git|Version Control]]
 +    *[[ios-labs-s14:​basics-xcode|XCode]]
 +    *[[http://​blog.teamtreehouse.com/​understanding-optionals-swift|Optionals]]
 +
 +===Intermediate===
 +  *Intermediate Interface
 +    *[[ios-labs-s14:​intermediate-ui|Designing and Building UI]]
 +    *[[ios-labs-s14:​intermediate-cells|Custom UITableViewCells]]
 +    *[[ios-labs-s14:​intermediate-views|View Hierarchy and Manipulation]]
 +  *Intermediate ViewControllers
 +    *[[ios-labs-s14:​intermediate-modal|Modal Segue]]
 +    *[[ios-labs-s14:​intermediate-tabs|TabBarControllers]]
 +  *Intermediate Models
 +    *[[ios-labs-s14:​intermediate-stores|Persistent Stores]]
 +    *[[ios-labs-s14:​intermediate-defaults|NSUserDefaults]]
 +    *[[ios-labs-s14:​intermediate-api|Intermediate API]]
 +  *Intermediate Swift
 +    *[[ios-labs-s14:​intermediate-arc|Memory Management]]*
 +    *[[ios-labs-s14:​intermediate-notif|NSNotification]]
 +    *[[ios-labs-s14:​intermediate-scope|Variable Declarations]]*
 +  *I/O
 +    *[[ios-labs-s14:​intermediate-gps|GPS]]*
 +  *Intermediate XCode
 +    *[[ios-labs-s14:​intermediate-prov|Provisioning]]*
 +    *[[ios-labs-s14:​intermediate-debugging|Debugging]]
 +    *[[ios-labs-s14:​intermediate-pics|Pictures]]
 +
 +===Advanced===
 +  *Advanced Interface
 +    *[[ios-labs-s14:​advanced-animations|Animations]]*
 +  *Advanced Models
 +    *[[ios-labs-s14:​advanced-core|CoreData]]*
 +    *[[ios-labs-s14:​advanced-singleton|Singletons]]
 +    *[[ios-labs-s14:​advanced-social|Social]]*
 +  *Advanced Swift
 +    *[[ios-labs-s14:​advanced-blocks|Closures]]
 +  *Advanced XCode
 +    *[[ios-labs-s14:​advanced-plist|Project Settings]]
 +    *[[ios-labs-s14:​advanced-frameworks|Frameworks]]
 +
  
 ====== Lab 1 - Sept 11 2015 ====== ====== Lab 1 - Sept 11 2015 ======
Line 367: Line 437:
 DONE!! DONE!!
  
-====== Lab 7 - Models, JSON, Tables and more ======+====== Lab 7 - Models, JSON, Tables and more - 23rd October 2015 ======
  
 ===== Introduction ===== ===== Introduction =====
  
-For today'​s lab, we intend to give you a more holistic view of iOS app development using Swift. This week’s lecture threw some light on Models and data representation like JSON, and XML. This tutorial ​would build upon those and  would also help recap of the concepts you have already learned. Hopefully, making things crystal clear.+For today'​s lab, we intend to give you a more holistic view of iOS app development using Swift. This week’s lecture threw some light on Models and data representation like JSON, and XML. This tutorial ​builds ​upon those concepts ​and  would also help recap the concepts you guys have already learned. Hopefully, making things crystal clear.
  
 The only way to learn the code and get used to the syntax is the struggle with it a little bit. The only way to learn the code and get used to the syntax is the struggle with it a little bit.
Line 473: Line 543:
 The displayViewController class should look like this. The displayViewController class should look like this.
  
-{{ :​ios-labs-f15:​screen_shot_2015-10-21_at_5.55.16_pm.png}} +{{:​ios-labs-f15:​screen_shot_2015-10-21_at_5.55.16_pm.png ​|}}
  
 The job is not over yet The job is not over yet
Line 480: Line 549:
 The first part of the application that needs some data loaded into it is going to be our Table Views. So go into NamesTableViewController,​ and in viewDidLoad,​ add some name objects. I know, I know, we said we will get data from JSON. We will, let’s just do it in a simple way first. ​ I'll create a new variable called newName. It should look something like this, pretty intuitive. The first part of the application that needs some data loaded into it is going to be our Table Views. So go into NamesTableViewController,​ and in viewDidLoad,​ add some name objects. I know, I know, we said we will get data from JSON. We will, let’s just do it in a simple way first. ​ I'll create a new variable called newName. It should look something like this, pretty intuitive.
  
-{{ :​ios-labs-f15:​screen_shot_2015-10-21_at_6.08.58_pm.png}}+ 
 +{{:​ios-labs-f15:​screen_shot_2015-10-21_at_6.08.58_pm.png ​|}} 
  
 So we have the objects in the array, but now we need to load them into a table view. If you haven’t seen the tutorial on Tables, do that now or learn on the go. We need to edit the methods provided as part of the code that came with UITableViewController,​ primarily numberOfSectionsInTableView and numberOfRowsInSection. Make them look like this. So we have the objects in the array, but now we need to load them into a table view. If you haven’t seen the tutorial on Tables, do that now or learn on the go. We need to edit the methods provided as part of the code that came with UITableViewController,​ primarily numberOfSectionsInTableView and numberOfRowsInSection. Make them look like this.
  
-{{ :​ios-labs-f15:​screen_shot_2015-10-21_at_6.11.44_pm.png}}+ 
 +{{:​ios-labs-f15:​screen_shot_2015-10-21_at_6.11.44_pm.png ​|}} 
  
 It just says that we are returning one section, row count and what to display in each cell. It just says that we are returning one section, row count and what to display in each cell.
Line 492: Line 565:
 So it is saying that the cell in the storyboard should have that name. To make sure that that is the case, go to storyboard. Take a look at the table view controller. Select a cell and in the utilities panel, in the “Table view cell” section, give the identifier a name “nameCell” and make the change in the tableView function as well. So it is saying that the cell in the storyboard should have that name. To make sure that that is the case, go to storyboard. Take a look at the table view controller. Select a cell and in the utilities panel, in the “Table view cell” section, give the identifier a name “nameCell” and make the change in the tableView function as well.
  
-{{ :​ios-labs-f15:​screen_shot_2015-10-21_at_6.14.27_pm.png}}+ 
 +{{:​ios-labs-f15:​screen_shot_2015-10-21_at_6.14.27_pm.png ​|}} 
  
 Build the project and hopefully everything should work. At this moment, we are not passing any data in between the scenes, so let’s do that. Build the project and hopefully everything should work. At this moment, we are not passing any data in between the scenes, so let’s do that.
Line 501: Line 576:
 Go to the NamesTableViewController.swift file and un comment the prepareForSegue function and make it look like below. Go to the NamesTableViewController.swift file and un comment the prepareForSegue function and make it look like below.
  
-{{ :​ios-labs-f15:​screen_shot_2015-10-21_at_6.18.16_pm.png}} ​+{{:​ios-labs-f15:​screen_shot_2015-10-21_at_6.18.16_pm.png ​|}} 
  
 Alright, now run the app and hopefully it should work perfectly fine. Now, we will bring JSON and NSURLConnection in. But first, a short primer on both of them. Alright, now run the app and hopefully it should work perfectly fine. Now, we will bring JSON and NSURLConnection in. But first, a short primer on both of them.
Line 512: Line 587:
   - Create API call and receiving variable, fire API call   - Create API call and receiving variable, fire API call
   - Implement delegate methods   - Implement delegate methods
-  - +
 The delegate methods are called as NSURLConnection moves about its business. They are extremely boilerplate,​ and generally you'll find yourself copying and pasting them constantly instead of writing them from scratch. The delegate methods are called as NSURLConnection moves about its business. They are extremely boilerplate,​ and generally you'll find yourself copying and pasting them constantly instead of writing them from scratch.
  
Line 523: Line 598:
 ==== Implement Delegate Methods ==== ==== Implement Delegate Methods ====
  
-{{ :​ios-labs-f15:​screen_shot_2015-10-21_at_6.29.38_pm.png}}+{{ :​ios-labs-f15:​screen_shot_2015-10-21_at_6.29.38_pm.png ​|}}
  
 Note that the receiver object has been omitted in the code above (it should be right after the colon). This is the data object that the Connection class loads the data into and you have yet to make it. The circle in the screenshot above shows where it should be as a method parameter for the JSONDeserializer class. Note that the receiver object has been omitted in the code above (it should be right after the colon). This is the data object that the Connection class loads the data into and you have yet to make it. The circle in the screenshot above shows where it should be as a method parameter for the JSONDeserializer class.
Line 538: Line 613:
 Ok. We've implemented the methods and created the receiving variable. Two steps lie between us and talking to the internet: manipulating the data object previously created, and firing the API call. Again, the steps detailed below are almost always like this; I'm having you work through them manually not simply to get practice calling methods. The formation of the NSURL and NSURLRequest objects commonly look like this, treat them as one step and don't get boggled down trying to find meaning in the code. Ok. We've implemented the methods and created the receiving variable. Two steps lie between us and talking to the internet: manipulating the data object previously created, and firing the API call. Again, the steps detailed below are almost always like this; I'm having you work through them manually not simply to get practice calling methods. The formation of the NSURL and NSURLRequest objects commonly look like this, treat them as one step and don't get boggled down trying to find meaning in the code.
  
-{{ :​ios-labs-f15:​screen_shot_2015-10-21_at_6.29.10_pm.png}}+{{ :​ios-labs-f15:​screen_shot_2015-10-21_at_6.29.10_pm.png ​|}}
  
 We should be hooked up to the internet. As you can see from the post above, the URL we're headed to is http://​pages.cs.wisc.edu/​~achink/​cs407.json . In order to check the results of your code, go there now and inspect the JSON that is returned. We should be hooked up to the internet. As you can see from the post above, the URL we're headed to is http://​pages.cs.wisc.edu/​~achink/​cs407.json . In order to check the results of your code, go there now and inspect the JSON that is returned.
Line 570: Line 645:
 ===== Conclusion ===== ===== Conclusion =====
  
-The complete app can be found [[https://​github.com/​achinkulshrestha/​xApp]] +Some of [[http://​www.raywenderlich.com/​ | Raywenderlich ]] tutorials are pretty good on the topic of JSON and Models. Hope you guys enjoyed today'​s session. ​The complete app can be found [[https://​github.com/​achinkulshrestha/​xApp]]
ios-labs-f15/start.1445474467.txt.gz · Last modified: 2015/10/21 19:41 by achin