🧰UIKit + AutoLayout
Lecture Slides
Lecture Video
Lecture Demo
Clone the Repository
Checkout Branches
Classes Demo Code
Last updated
Was this helpful?
Last updated
Was this helpful?
Was this helpful?
git clone https://github.com/intro-to-ios/lec2-uikit
OR git clone [email protected]:intro-to-ios/lec2-uikit.gitgit checkout origin/1-uilabel
OR git checkout 1-uilabel
git checkout origin/2-uiimageview
OR git checkout 2-uiimageviewclass Student {
// Properties
var name: String
var major: String
var age: Int
// Initializer
init(name: String, major: String, age: Int) {
self.name = name
self.major = major
self.age = age
}
}
let vin = Student(name: "Vin", major: "Info Sci", age: 20)
vin.major // Prints "Info Sci"
class EngineeringStudent: Student {
// Inherits properties from the superclass, but you can
// define other properties specific to this class
var doesShower: Bool
// Initializer
init(name: String, major: String, age: Int, doesShower: Bool) {
self.doesShower = doesShower // Initialize properties specific to this class
super.init(name: name, major: major, age: age) // Call superclass' initializer
}
}
let archit = EngineeringStudent(name: "Archit", major: "CS", age: 20, doesShower: false)
archit.name // Good
archit.doesShower // Good
vin.doesShower // Does not work