Upgrade to Pro — share decks privately, control downloads, hide ads and more …

MobileProgramming Class

MobileProgramming Class

Mobile Programmingの授業で使うスライドです

yuichiro_takahashi

October 31, 2018
Tweet

More Decks by yuichiro_takahashi

Other Decks in Technology

Transcript

  1. ςΩετ CLASSͷఆٛ ▸ ࣮ࡍͷίʔυ class Dog: Animal { let name:

    String let kind: String init(name: String, kind: String) { self.name = name self.kind = kind } func selfIntroduction() { print("My name is \(name)") print("I'm \(kind)") print("nice to meet you sir.") } } Classͷ͍࣋ͬͯΔσʔλ(Property) ͜͜ͰॳظԽ͢Δ(constructor, initializer) Classͷ͍࣋ͬͯΔػೳ(Method)
  2. ςΩετ CLASSͷఆٛ ▸ ࣮ࡍͷίʔυ let dog = Dog(name: "pochi", kind:

    "Doberman") dog.name dog.selfIntroduction() ClassͷΠϯελϯεԽ Classͷσʔλ(Property)ʹΞΫηε ClassͷػೳΛ࢖͏(ϝιουݺͼग़͠)
  3. ςΩετ 2. CLASSͷཁૉ ▸ Classͷதʹ͸༷ʑͳཁૉ͕ଘࡏ͠·͢ class Dog: Animal { let

    name: String private let kind: String init(name: String, kind: String) { self.name = name self.kind = kind } func selfIntroduction() { print("My name is \(name)") print("I'm \(kind)") print("nice to meet you sir.") } }
  4. ςΩετ 2. CLASSͷཁૉ ▸ Classͷதʹ͸༷ʑͳཁૉ͕ଘࡏ͠·͢ class Dog: Animal { let

    name: String private let kind: String init(name: String, kind: String) { self.name = name self.kind = kind } func selfIntroduction() { print("My name is \(name)") print("I'm \(kind)") print("nice to meet you sir.") } } Property
  5. ςΩετ 2. CLASSͷཁૉ ▸ Classͷதʹ͸༷ʑͳཁૉ͕ଘࡏ͠·͢ class Dog: Animal { let

    name: String private let kind: String init(name: String, kind: String) { self.name = name self.kind = kind } func selfIntroduction() { print("My name is \(name)") print("I'm \(kind)") print("nice to meet you sir.") } } Property Method
  6. ςΩετ 2. CLASSͷཁૉ ▸ Classͷதʹ͸༷ʑͳཁૉ͕ଘࡏ͠·͢ class Dog: Animal { let

    name: String private let kind: String init(name: String, kind: String) { self.name = name self.kind = kind } func selfIntroduction() { print("My name is \(name)") print("I'm \(kind)") print("nice to meet you sir.") } } Property initializer(constructor) Method
  7. ςΩετ 2. CLASSͷཁૉ ▸ Classͷதʹ͸༷ʑͳཁૉ͕ଘࡏ͠·͢ class Dog: Animal { let

    name: String private let kind: String init(name: String, kind: String) { self.name = name self.kind = kind } func selfIntroduction() { print("My name is \(name)") print("I'm \(kind)") print("nice to meet you sir.") } } Property ΞΫηεम০ࢠ initializer(constructor) Method
  8. ςΩετ 2. CLASSͷཁૉ ▸ Classͷதʹ͸༷ʑͳཁૉ͕ଘࡏ͠·͢ class Dog: Animal { let

    name: String private let kind: String init(name: String, kind: String) { self.name = name self.kind = kind } func selfIntroduction() { print("My name is \(name)") print("I'm \(kind)") print("nice to meet you sir.") } } ܧঝ Property ΞΫηεम০ࢠ initializer(constructor) Method