Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Kotlin エンジニアへ送る:Swift 案件に参加させられる日に備えて~似てるけど色々違う...
Search
Elvis Shi
June 24, 2025
Programming
410
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Kotlin エンジニアへ送る:Swift 案件に参加させられる日に備えて~似てるけど色々違う Swift の仕様 / from Kotlin to Swift
Elvis Shi
June 24, 2025
More Decks by Elvis Shi
See All by Elvis Shi
為什麼你並不需要ViewModel / No, you don't need a ViewModel
lovee
1
580
@Environment(\.keyPath)那么好我不允许你们不知道! / atEnvironment keyPath is so good and you should know it!
lovee
0
570
ゼロから始めるPreferenceの実装 / Let's implement Preferences from scratch
lovee
0
160
個人アプリを2年ぶりにアプデしたから褒めて / I just updated my personal app, praise me!
lovee
0
790
How did I build an Open-Source SwiftUI Toast Library
lovee
1
190
SwiftUIで使いやすいToastの作り方 / How to build a Toast system which is easy to use in SwiftUI
lovee
3
1.3k
SwiftUIで二重スクロール作ってみた / When I tried to make a dual-scroll-ish view in SwiftUI
lovee
1
390
Observation のあれこれ / A brief introduction about Observation
lovee
3
460
ChatGPT 時代の勉強 / Learning under ChatGPT era
lovee
27
9.1k
Other Decks in Programming
See All in Programming
ジョジョの世界をXRで再現する
mofurune
0
160
動作中のプログラムの中身をリアルタイムに覗く / Realtime Debugger for CSharp with Roslyn
prota
1
1.9k
Everything will be SERVERLESS — 信じて運用した10年の経験値 / Everything Will be Serverless — Lessons Learned from 10 Years of Operational Experience
seike460
PRO
1
1.1k
ハーネス設計入門 〜 基礎知識の整理から実務へのステップアップ 〜
kinopeee
28
31k
カツオ、ご期待ください
suneo3476
0
190
複雑なUIコンポーネントとの ⻑い付き合い⽅:波及するバグからテスト戦略を経て、安全な再設計へ
mixplace
0
410
すこし踏み込む CancellationToken
htkym
2
1.7k
Agents on Rails - Rails at Scale 2026
irinanazarova
0
550
Starting & Sustaining Code-Based E2E Testing for Non-Coding QA Teams( #jasstniigata )
teyamagu
PRO
1
1k
コーディング自動化の次へ。人の介入をゼロにするファクトリーとサポートAIによる実践
timakin
4
3.4k
Herb in Rails 8.2: Your ERB views, now HTML-aware @ Rails World 2026, Austin, Texas
marcoroth
0
220
APNsからLive Activityを開始する話
yumnumm
0
170
Featured
See All Featured
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
12k
Jamie Indigo - Trashchat’s Guide to Black Boxes: Technical SEO Tactics for LLMs
techseoconnect
PRO
0
710
GraphQLの誤解/rethinking-graphql
sonatard
75
12k
Leo the Paperboy
mayatellez
10
2.4k
Building the Perfect Custom Keyboard
takai
2
910
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
2
6.3k
Imperfection Machines: The Place of Print at Facebook
scottboms
270
14k
Skip the Path - Find Your Career Trail
mkilby
1
260
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
33
5.2k
AI Search: Implications for SEO and How to Move Forward - #ShenzhenSEOConference
aleyda
1
1.4k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
232
55k
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
600
Transcript
ࣅͯΔ͚Ͳ৭ʑҧ͏4XJGUͷ༷ forϞόνΩʙ.PCJMF5JQTڞ༗ձʙ ,PUMJOΤϯδχΞૹΔɿ4XJGUҊ݅ʹࢀՃͤ͞ΒΕΔʹඋ͑ͯʙ
} var employedBy = "YUMEMI Inc." var job = "iOS
Developer" var organizerOf = "HAKATA.swift" var favoriteLanguage = "Swift" var twitter = "@lovee" var qiita = "lovee" var github = "el-hoshino" var additionalInfo = """ ࠓ͔Β iPhone ͰϚΠφϯόʔΧʔυ͕ ͑ΔΑ͏ʹͳͬͨΑʂ iOS 26 Developer Beta 2 ϦϦʔεͨ͠Αʂ """ final class Me: Developable, Talkable {
͓͓ɺ,PUMJO׳Εͨํ͕4XJGUॻ͘ͱ͜Μͳͱ͜ΖͰ,PUMJOͷश׳͕ݱΕΔΜͩ Ͷʂ 13ϨϏϡʔʜ ڵຯ͋Δ͔ΒΓ·͢! "OESPJEͱ,.1Ϧιʔε༨༟͋Δ͔Β୭͔J04ʹՃ͢Δਓ͍ͳ͍͔ʁ J04ͷ୲ऀগͳ͍͔Βਐ͕ͪΐͬͱ͍ͳʜ
%JTDMBJNFS w հྫ͕ͯࣗ͢ίʔυϨϏϡʔͷࡍʹग़ձͬͨίʔυͰ͢ ʢΦϦδφϧͰͳ͘ษڧձʹ߹Θͤͨมߋ͋Γʣ w ͦͷͨΊͯ͢Ϗϧυ௨Δ͚Ͳɺ4XJGUతʹ͋·Γ͜͏͠ͳ͍Αɺ ͱ͍͏ࡉ͔͍ͱ͜ΖΛϑΥʔΧεͨ͠ҧ͍Λհ͠·͢ w ·ͨશͯͷҧ͍ΛཏͰ͖ͯΔΘ͚Ͱͳ͍͜ͱΛѱ͔͠Βͣ
if (isUserValid) { // do something } 4XJGUجຊAifAจͷ݅ͰA()Aॻ͔ͳ͍͜ͱ͕ओྲྀͰ͢
if isUserValid { // do something }
enum LoginMethod { case userId case sns } 4XJGUීஈશ෦େจࣈΛ͏ུশ͕DBNFM$BTFʹೖΔ࣌ɺ େจࣈখจࣈΛଗ͑·͢
IUUQTXXXTXJGUPSHEPDVNFOUBUJPOBQJEFTJHOHVJEFMJOFTHFOFSBMDPOWFOUJPOT
enum LoginMethod { case userID case sns } IUUQTXXXTXJGUPSHEPDVNFOUBUJPOBQJEFTJHOHVJEFMJOFTHFOFSBMDPOWFOUJPOT //
શͯେจࣈͷུশͷ߹ var utf8Bytes: [UTF8.CodeUnit] var isRepresentableAsASCII = true var userSMTPServer: SecureSMTPServer // ಄จࣈ͚ͩେจࣈͷུশͷ߹ var radarDetector: RadarScanner var enjoysScubaDiving = true
enum LoginMethod { case userID case sns } func login(method:
LoginMethod) { // do something } login(method: LoginMethod) 4XJGUͷϝιουҾʹϥϕϧΛ༩Ͱ͖·͢ɺ ͦΕʹΑΓݺͼग़͕͠ಡΈ͘͢ͳΔ͜ͱ͕ଟ͍Ͱ͢
enum LoginMethod { case userID case sns } func login(with
method: LoginMethod) { // do something } login(with: LoginMethod)
enum LoginMethod { case userID case sns } func login(with
method: LoginMethod) { // do something } login(with: LoginMethod.userID) 4XJGUܕ͕ਪͰ͖Δ߹ɺ Θ͟Θ͟ܕΛॻ͔ͳͯ͘େৎͰ͢
enum LoginMethod { case userID case sns } func login(with
method: LoginMethod) { // do something } login(with: .userID)
struct ConnectionOption: OptionSet { // ... static let customDnsIpTable: Self
// ... } struct ConnectionOption: OptionSet { // ... static let customDNSipTable: Self // ... } struct ConnectionOption: OptionSet { // ... static let customDNSIPtable: Self // ... } struct ConnectionOption: OptionSet { // ... static let customDNSIPTable: Self // ... } ΫΠζ 4XJGU"1*%FTJHO(VJEFMJOFTʹԊͬͨม໊ʁ
struct ConnectionOption: OptionSet { // ... static let customDnsIpTable: Self
// ... } struct ConnectionOption: OptionSet { // ... static let customDNSipTable: Self // ... } struct ConnectionOption: OptionSet { // ... static let customDNSIPtable: Self // ... } struct ConnectionOption: OptionSet { // ... static let customDNSIPTable: Self // ... } ΫΠζ ͑߹Θͤ
func handle(option: ConnectionOption) { if (option.contains(ConnectionOption.customDNSIPTable)) { // ... }
} ಡΈ͍͢ϥϕϧΛ ͚ͭΒΕΔ ׅހ͕ඞཁͳ͍ ਪͰ͖Δ͔ΒܕཁΒͳ͍ ΫΠζ Լهͷ࣮ΛΑΓ4XJGUΒ͘͢͠Δʹʁ
func handle(_ option: ConnectionOption) { if option.contains(.customDNSIPTable) { // ...
} } ΫΠζ ͑߹Θͤ
func handle(_ option: ConnectionOption) { if option.contains(.customDNSIPTable) { // ...
} } let userOption: ConnectionOption = // ... handle(userOption) ΫΠζ ͑߹Θͤ
ࢀߟࢿྉ w IUUQTXXXTXJGUPSHEPDVNFOUBUJPOBQJEFTJHOHVJEFMJOFT
struct UserData { internal func doSomething() { // ... }
} 4XJGUσϑΥϧτείʔϓ͕JOUFSOBM͔ͩΒ جຊΘ͟Θ͟internal͚ͭΔඞཁͳ͍
struct UserData { func doSomething() { // ... } }
public struct UserData { func doSomething() { // ... }
} QVCMJDએݴͷܕͷதͰಉ͘͡ σϑΥϧτείʔϓJOUFSOBMͰ͢
public struct UserData { // ... } public extension UserData
{ internal func doSomething() { // ... } } །Ұͷྫ֎QVCMJDͳ֦ு͚ͩ σϑΥϧτείʔϓQVCMJDͰ͢ ͕ʜΘ͟Θ͟͜Μͳ͜ͱΔʜʁ
public struct UserData { // ... } extension UserData {
func doSomething() { // ... } } ͜ΕͰ͍͍ΑͶʜʁ
struct UserData { let nickName: String let level: Int }
structͷϓϩύςΟʔ جຊvarએݴͰͳ͍
ʮࢀরܕʯͱʮܕʯ w ʮࢀরܕʯͱɺೖ࣌ʹΠϯελϯεͷࢀরΛίϐʔͯ͠ೖ ͢Δܕͷ͜ͱ w ʮܕʯͱɺೖ࣌ʹΠϯελϯεͷͦͷͷΛίϐʔͯ͠ ೖ͢Δܕͷ͜ͱ w ࢀরܕࢀর͕ڞ༗͞ΕΔͷͰɺೖޙͷͷมߋڞ༗͞ΕΔ w
ܕࢀর͕ڞ༗͞Εͳ͍ͷͰɺೖޙͷͷมߋڞ༗͞Εͳ͍
ࢀরܕͷ߹ " A = SomeThing() ࢀর
ࢀরܕͷ߹ " B = A # ࢀর
ࢀরܕͷ߹ " B.property = new # #ʹର͢Δมߋ͕"ʹ ө͞Εͯ͠·͏ ࢀর
ΠϛϡʔλϒϧΫϥε
ࢀর ࢀরܕʢEBUBDMBTTʣͷ߹ A = SomeThing() " ࢀর
ࢀর ࢀরܕʢEBUBDMBTTʣͷ߹ B = A.copy(property = new) #ʹର͢Δมߋ #ʹཹ·Δ "
ࢀর #
# ܕͷ߹ " A = SomeThing()
# ܕͷ߹ " B = A
ܕͷ߹ " B.property = new # #ʹର͢Δมߋ #ʹཹ·Δ
struct UserData { var nickName: String var level: Int }
struct UserData { var nickName: String var level: Int }
struct UserView: View { @State private var userData: UserData = //... var body: some View { VStack { TextField("Nick Name", text: $userData.nickName) } } } @Stateͷঢ়ଶʹର͠$Ͱ؆୯ʹ ํόΠϯσΟϯά͕࡞ΕΔ
w IUUQT[FOOEFWLPIFSBSUJDMFTTXJGUTUSVDUJNNVUBCJMJUZ w IUUQTRJJUBDPNPNPDIJNFUBSVJUFNTFCDDC ࢀߟࢿྉ
ܕɺΠϛϡʔλϒϧΫϥεͱ΄΅ಉՁ
struct UserData { let id: UUID var nickName: String var
level: Int } ݸਓతྫ֎ มߋ͍ͨ͠໌ࣔతʹΠϯελϯεΛ࠶ੜͯ͠΄͍͠ ϓϩύςΟʔʹ͚ͩletΛ͍·͢
struct UserData { let id: UUID var nickName: String var
level: Int } struct UserView: View { @State private var userData: UserData = // var body: some View { VStack { TextField("Nick Name", text: $userData.nickName) TextField("ID", text: $userData.id) } } } $BOOPUBTTJHOUPQSPQFSUZJEJTBMFUDPOTUBOU
One more thing...
None
4XJGU6*Ͱɺ7JFX.PEFMΛ࡞Βͳ͍͍ͯ͘ w +FUQBDL$PNQPTFͱҧͬͯɺͦͦViewModelجఈΫϥεͷ Α͏ͳͷ༻ҙ͞Ε͍ͯͳ͍ w Ұൠతͳ.77.ͷViewModelɺઃܭͱͯ͠ϥΠϑαΠΫϧ Viewʹґଘ͍ͯ͠Δ͕ɺ4XJGU6*ʹ͓͚ΔViewͨͩͷܕͰ ʮϥΠϑαΠΫϧʯͷ֓೦͢Βͳ͍ w ը໘ͷϥΠϑαΠΫϧ4XJGU6*Τϯδϯ͕ࣗཧ͍ͯ͠Δ͕ɺ
ͦ͜ʹViewModel͕հࡏ͢Δ༨͕ͳ͍ w ͦͦ4XJGU6*ͷViewɺฆΕͳ͘7JFX.PEFMͰ͋Δ w w w w w w w w w w w w w w w w w
4XJGU6*ʹ͓͍ͯɺ ը໘ॲཧViewʹॻ͍ͯΑΖ͍͠ɻ
ࢀߟࢿྉʢफڭઓ૪ʣ w IUUQTYDPNB[BNTIBSQTUBUVT w IUUQTRJJUBDPNLBSBNBHFJUFNTBDDB⒎EFC w IUUQTEFWFMPQFSBQQMFDPNGPSVNTUISFBE
એ IUUQTIBLBUBTXJGUDPOOQBTTDPNFWFOU