第一课:Course Overview and Introduction to iOS, Xcode, and Swift

关于斯坦福的这个系列课程的所有笔记,都在这个文集里:Developing Apps for iOS9


实际上课时间为:2016年3月28日。课程发布在iTunes上的时间是2016年4月19日, 课程地址。

一、课程内容:

简单一提MVC,下节课详细说。

介绍:iOS体系,Xcode各个部分。

Demo讲解:

  1. 拖一个UIButton控件,创建Action连接@IBAction func touchDigit(sender: UIButton),然后在Storyboard中复制粘贴10个UIButton控件,组成数字0-9。
let digit = sender.currentTitle!
  1. 创建Label,Outlet连接。

  2. 解决第一次点击数字的开始显示数字0的问题

import UIKit

class ViewController: UIViewController {
  
  var userIsInTheMidlleOfTyping = false
  
  @IBOutlet weak var display: UILabel!
  
  @IBAction func touchDigit(sender: UIButton) {
        let digit = sender.currentTitle!    
  
        if userIsInTheMidlleOfTyping {
            let textCurrentlyInDisplay = display.text!
            display.text = textCurrentlyInDisplay + digit            
        } else {
            display.text = digit           
        }
        userIsInTheMidlleOfTyping = true
    }
}
  1. 创建π运算符Button,然后创建Action连接,未结束,下节课继续π。

二、课后作业:

  • 看教程视频
  • 回顾 Lecture 1 PPT 里的知识点
  • Reading 1:Intro to Swift

三、课后作业完成记录:Reading 1:Intro to Swift

阅读 Swift Programming Language文档。作业的阅读量很大,尤其是之前没有看过 Swift 编程语言,如果之前看过学过,那么这节课的作业就会非常轻松。

红色:重要且难懂,黄色:重要但不难理解,绿色:重要且简单基础,灰色:这节课还不需要看的知识点

1. The Basics

第一课:Course Overview and Introduction to iOS, Xcode, and Swift_第1张图片
The Basics

2. Basic Operators

第一课:Course Overview and Introduction to iOS, Xcode, and Swift_第2张图片
Basic Operators

3. Strings and Characters

第一课:Course Overview and Introduction to iOS, Xcode, and Swift_第3张图片
Strings and Characters

4. Collection Types

第一课:Course Overview and Introduction to iOS, Xcode, and Swift_第4张图片
Collection Types

5. Control Flow

第一课:Course Overview and Introduction to iOS, Xcode, and Swift_第5张图片
Control Flow

6. Functions

第一课:Course Overview and Introduction to iOS, Xcode, and Swift_第6张图片
Functions

7. Closures

第一课:Course Overview and Introduction to iOS, Xcode, and Swift_第7张图片
Closures

8. Enumerations

第一课:Course Overview and Introduction to iOS, Xcode, and Swift_第8张图片
Enumerations

9. Classes and Structures

第一课:Course Overview and Introduction to iOS, Xcode, and Swift_第9张图片
Classes and Structures

10. Properties

第一课:Course Overview and Introduction to iOS, Xcode, and Swift_第10张图片
Properties

你可能感兴趣的:(第一课:Course Overview and Introduction to iOS, Xcode, and Swift)