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
MobileProgramming Class
Search
yuichiro_takahashi
October 31, 2018
Technology
0
140
MobileProgramming Class
Mobile Programmingの授業で使うスライドです
yuichiro_takahashi
October 31, 2018
Tweet
Share
More Decks by yuichiro_takahashi
See All by yuichiro_takahashi
App Clip - in a nutshell
yuichirokato
0
240
巨大な機能を VIPER + MicroViewController でいい感じに実装した話
yuichirokato
1
720
Mobile Programming Protocol Extension
yuichirokato
0
74
Mobile Programming Protocol
yuichirokato
0
73
Mobile Programming enum
yuichirokato
0
150
Mobile Programming Optional
yuichirokato
0
120
Mobile Programming Struct
yuichirokato
0
120
Mobile Programming Initializer Beta
yuichirokato
0
110
Mobile Programming Inheritance
yuichirokato
0
130
Other Decks in Technology
See All in Technology
Hands-on / Kaname Frusawa / Cloud Compare Users Meetup 2024 at University of Tokyo on April 17
paraworld
2
470
巨大なテーブルのテーブル定義を無停止で安全に誰でも変更できるようにする / Table-definitions-for-huge-tables-can-be-modified-by-anyone-safely-and-non-disruptively
freee
1
740
少数チームで挑む: SwiftUI, TCA, KMPを用いた 新規動画配信アプリ 「ABEMA Live」の開発について
tomu28
0
540
**強い**エンジニアのなり方 - フィードバックサイクルを勝ち取る / grow one day each day
soudai
61
18k
強みを伸ばすキャリアデザイン
yug1224
0
200
Tableau事例紹介 / Tableau Case Study of Eureka
kazuya_araki_tokyo
1
170
Terraformあれやこれ/terraform-this-and-that
emiki
4
450
オーナーシップを持つ領域を明確にする
konifar
11
2.6k
HEXA OSINT CTF V3 作戦会議
meow_noisy
0
110
o11y入門_外形監視を利用したWebアプリケーションへの最適なモニタリング_TechBrew
k5k
3
100
KubeCon EU 2024 Recap “Kubernetes Policy Time Machine: Where to Next?”
ryysud
0
110
AWS を使う上で知っておきたいオンプレミス知識/aws-on-premise-essentials
emiki
1
4.2k
Featured
See All Featured
Infographics Made Easy
chrislema
237
18k
What’s in a name? Adding method to the madness
productmarketing
PRO
15
2.6k
Embracing the Ebb and Flow
colly
79
4.1k
RailsConf 2023
tenderlove
2
530
The Brand Is Dead. Long Live the Brand.
mthomps
48
28k
KATA
mclloyd
14
12k
Teambox: Starting and Learning
jrom
128
8.4k
Designing on Purpose - Digital PM Summit 2013
jponch
110
6.4k
Automating Front-end Workflow
addyosmani
1355
200k
A Philosophy of Restraint
colly
196
16k
StorybookのUI Testing Handbookを読んだ
zakiyama
11
4.6k
For a Future-Friendly Web
brad_frost
171
8.9k
Transcript
CLASS MOBILE PROGRAMMING 31ST OCT
1. CLASSͱ
ςΩετ CLASS ▸ Objectࢦݴޠʹ͓͍ͯϓϩάϥϜΛܗͮ͘ΔҰͭͷ·ͱ ·Γ ▸ Class͝ͱʹׂ(ػೳ)ΛܾΊͯ࠶ར༻͍͢͠ܗʹ͢Δ͜ ͱͰϓϩάϥϜΛ࡞ɺӡ༻͘͢͢͠Δ ▸ ϓϩάϥϜதͰ·ͣClassΛఆٛ͠ɺClassΛ͍͍ͨՕॴ
ͰΠϯελϯεԽ͢Δͱ͍͏ྲྀΕʹͳΔ ▸ ClassΛΠϯελϯεԽͨ͠ͷΛΦϒδΣΫτͱݺͿ
1-1. CLASSͷఆٛ
ςΩετ CLASSͷఆٛ ▸ ·͍͍ͣͨClassΛఆٛ͢Δඞཁ͕͋Δ ▸ ۩ମతʹ ▸ ClassͲΜͳ໊લ͔ ▸ ClassʹͲΜͳσʔλ͕͋Δ͔(property)
▸ Class͕ͲΜͳػೳΛ͍࣋ͬͯΔ͔(method) ▸ Λఆ͍ٛͯ͘͠
ςΩετ CLASSͷఆٛ ▸ Swiftʹ͓͚ΔClassͷจ๏ҎԼͷ௨Γ class <ClassName>: <SuperClass> { let property1:
String var property2: String func method() { … } }
ςΩετ 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)
1-2. CLASSͷ༻
ςΩετ CLASSͷఆٛ ▸ ఆٛ͞ΕͨClassͦͷ··Ͱҙຯ͕͋Γ·ͤΜ ▸ ఆٛ͞ΕͨClassΛ͍͍ͨॴͰ ▸ ΠϯελϯεԽ͠(ClassͷΦϒδΣΫτΛ࡞͢Δ) ▸ ClassͷػೳΛ͏
▸ ͜ͱͰClassʹॻ͔Εͨίʔυ͕࣮ߦ͞Ε·͢
ςΩετ CLASSͷఆٛ ▸ Swiftʹ͓͚ΔClassͷΠϯελϯεԽɺ༻ͷํ๏ҎԼͷ௨Γ let dog = <ClassName>() dog.property1 dog.method(hoge:
“hoge”)
ςΩετ CLASSͷఆٛ ▸ ࣮ࡍͷίʔυ let dog = Dog(name: "pochi", kind:
"Doberman") dog.name dog.selfIntroduction() ClassͷΠϯελϯεԽ Classͷσʔλ(Property)ʹΞΫηε ClassͷػೳΛ͏(ϝιουݺͼग़͠)
2. CLASSͷཁૉ
ςΩετ 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.") } }
ςΩετ 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
ςΩετ 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
ςΩετ 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
ςΩετ 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
ςΩετ 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
ޙଓ͘