Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Mobile Programming Inheritance
Search
yuichiro_takahashi
November 26, 2018
Technology
170
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Mobile Programming Inheritance
モバイルプログラミングの授業で使うスライドです
yuichiro_takahashi
November 26, 2018
More Decks by yuichiro_takahashi
See All by yuichiro_takahashi
Claude Code の Skill で複雑な既存仕様をすっきり整理しよう
yuichirokato
1
630
App Clip - in a nutshell
yuichirokato
0
390
巨大な機能を VIPER + MicroViewController でいい感じに実装した話
yuichirokato
1
850
Mobile Programming Protocol Extension
yuichirokato
0
97
Mobile Programming Protocol
yuichirokato
0
100
Mobile Programming enum
yuichirokato
0
190
Mobile Programming Optional
yuichirokato
0
150
Mobile Programming Struct
yuichirokato
0
140
Mobile Programming Initializer Beta
yuichirokato
0
150
Other Decks in Technology
See All in Technology
ブラウザ研修 2026
recruitengineers
PRO
6
940
[ChatGPT Work LT]事務作業が苦手な人のための バックオフィスの「半」自動化
chimaki_iot
0
280
Data Hubグループ 紹介資料
sansan33
PRO
0
3.2k
FORENSIA: ローカルLLMフォレンジックハーネス
sumeshi
2
370
Flutterをカメラで動かしたかった話
sony
1
130
LanceDB入門
mocobeta
7
380
【CEDEC2026】『GRANBLUE FANTASY: Relink - Endless Ragnarok』のバトル制作事例 ~最高のキャラゲーを目指して~
cygames
PRO
0
250
【CEDEC2026】ゲームシナリオライターを支援するAIツール開発の実践 ― 設計とプロンプトの工夫 ―
cygames
PRO
1
790
ガバメントクラウドでのランサムウェア対策
techniczna
2
1.1k
モダンフロントエンド 開発研修
recruitengineers
PRO
4
610
ホームラボ紹介
y_sera15
0
150
Breaking the Seal: Static Deobfuscation of Compiled V8 JavaScript Bytecode Malware
hshrzd
0
720
Featured
See All Featured
The Cost Of JavaScript in 2023
addyosmani
55
10k
Why Our Code Smells
bkeepers
PRO
340
58k
Color Theory Basics | Prateek | Gurzu
gurzu
0
410
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.8k
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
250
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
2k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
34
2.8k
Amusing Abliteration
ianozsvald
1
240
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
63
45k
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
2
450
New Earth Scene 8
popppiees
3
2.5k
Transcript
ܧঝ MOBILE PROGRAMMING 26TH NOV
1. ܧঝʹ͍ͭ ͯ
ςΩετ ܧঝͬͯʁ ▸ Ϋϥε͕࣋ͭػೳͷҰͭ ▸ ͕࣋ͭϓϩύςΟϝιουΛड͚ܧ͙ ▸ ܧঝݩͷΫϥεΛΫϥε(super class) ▸
ܧঝઌͷΫϥεΛࢠΫϥε(sub class)ͱ͍͏ ▸ จ๏ class SubClass: Super Class { ... } ▸ swift Ͱ͏ॴݶΒΕΔ ▸ جຊతʹϙϦϞʔϑΟζϜ(ଟଶੑ)ͷͨΊʹΘΕΔ
ςΩετ ࣮ࡍͷίʔυ class Pokemon { let name: String var ability:
String var level: Int = 0 init(name: String, level: Int, ability: String = "͍ͨ͋ͨΓ") { self.name = name self.level = level self.ability = ability } func displayStatus() { print("\(self.name)ͷϨϕϧ\(self.level)Ͱ͢ɻ") } func doAbility(to pokemon: Pokemon) { print("\(self.name)\(pokemon.name)ʹ\(self.ability)ͨ͠ʂ") } } class Metagross: Pokemon { init(level: Int) { super.init(name: "ϝλάϩε", level: level, ability: "ίϝοτύϯν") } }
2. Ϋϥεͱ ࢠΫϥε
ςΩετ ΫϥεͱࢠΫϥε ▸ جຊతʹࢠΫϥε͔ΒΫϥεͷϓϩύςΟϝιουશͯΞΫ ηεՄೳ ▸ ͦͷࡍself ͷΘΓʹsuperΛ͏ ▸ ࢠΫϥεͰΫϥεͷϝιουΛॻ͖͑Δ͜ͱ͕Ͱ͖Δ
▸ ͜ΕΛϝιουͷΦʔόʔϥΠυͱݴ͏ ▸ ࢠΫϥεʹ৽͘͠ϝιουϓϩύςΟΛఆٛ͢Δ͜ͱ͕Ͱ͖Δ ▸ ࢠΫϥεΫϥεͷܕҾ͖ܧ͙
ςΩετ ࣮ࡍͷίʔυ class Pokemon { let name: String // pokemon's
name (ex pikachu) fileprivate(set) var level: Int // pokemon's level fileprivate(set) var health: Int = 1 // pokemon's hit point init(name: String, level: Int) { self.name = name self.level = level self.health = level * 2 } func displayStatus() { print("Name: \(self.name)") print("Lv: \(self.level)") print("HP: \(self.health)") } func doAbility() { print("\(self.name)ͷ͍ͨ͋ͨΓʂ") } } class Slowpoke: Pokemon { init(level: Int) { // ΫϥεͷϝιουΛݺͼग़͢ super.init(name: "Ϡυϯ", level: level) } // Ϋϥεʹఆٛ͞Ε͍ͯΔϝιουΛॻ͖͑Δ override func doAbility() { print("\(self.name)ͷͶΜΓ͖ʂ") } } let slowpoke: Pokemon = Slowpoke(level: 10) slowpoke.displayStatus() slowpoke.doAbility() // ϠυϯͷͶΜΓ͖ʂͱදࣔ͞ΕΔ(͍ͨ͋ͨΓͰͳ͍)