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
Swift愛好会WWDC要約会 Build programmatic UI with Xcod...
Search
Aikawa
June 22, 2023
Technology
2
720
Swift愛好会WWDC要約会 Build programmatic UI with Xcode Previews
Aikawa
June 22, 2023
Tweet
Share
More Decks by Aikawa
See All by Aikawa
DocC Tutorial と TCA におけるテスト機能の紹介
kalupas226
1
950
enum で KeyPaths のような機能を実現する CasePaths
kalupas226
4
900
SwiftUI Navigation のすべて
kalupas226
11
7.9k
Refreshable API を TCA で使う
kalupas226
0
190
Combineを使ったコードのテストをSchedulerで操る方法とその仕組み
kalupas226
2
1.6k
Composable FormsでTCAのボイラープレートとおさらばする
kalupas226
1
1.1k
Swiftの関数と代数学
kalupas226
0
620
Swiftのstruct・enumと代数学_part1
kalupas226
2
1.3k
Examples の Search プロジェクトから学ぶ The Composable Architecture
kalupas226
0
340
Other Decks in Technology
See All in Technology
ZOZOTOWNのホーム画面をパーソナライズすることの難しさと裏話を語る
f6wbl6
1
420
AWS⼊社という選択肢、⾒えていますか
iwamot
2
1.1k
データの信頼性を支える仕組みと技術
chanyou0311
3
1.2k
[FOSS4G 2024 Japan LT] LLMを使ってGISデータ解析を自動化したい!
nssv
0
130
Mini Tokyo 3D × PLATEAU - 公共交通デジタルツインにリアルな風景を
nagix
1
230
TinyGoを使ったVSCode拡張機能実装
askua
2
200
徹底比較!HA Kubernetes ClusterにおけるControl Plane LoadBalancerの選択肢
logica0419
2
130
社内で最大の技術的負債のリファクタリングに取り組んだお話し
kidooonn
0
290
Product Engineer Night #6プロダクトエンジニアを育む仕組み・施策
hacomono
PRO
1
540
Intuneお役立ちツールのご紹介
sukank
3
690
GraphRAGを用いたLLMによるパーソナライズド推薦の生成
naveed92
0
180
オーティファイ会社紹介資料 / Autify Company Deck
autifyhq
9
120k
Featured
See All Featured
The Cost Of JavaScript in 2023
addyosmani
45
6.6k
Raft: Consensus for Rubyists
vanstee
136
6.6k
Building a Modern Day E-commerce SEO Strategy
aleyda
38
6.9k
Fashionably flexible responsive web design (full day workshop)
malarkey
404
65k
Building Applications with DynamoDB
mza
90
6.1k
Intergalactic Javascript Robots from Outer Space
tanoku
268
27k
Optimising Largest Contentful Paint
csswizardry
33
2.9k
A designer walks into a library…
pauljervisheath
202
24k
How to Ace a Technical Interview
jacobian
276
23k
Side Projects
sachag
452
42k
jQuery: Nuts, Bolts and Bling
dougneiner
61
7.5k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
226
22k
Transcript
Build programmatic UI with Xcode Previews Xcode Previews ͷվળ
Tips Λཁͯ͠հ͠·͢ SwiftѪձεϐϯΦϑ WWDC23ηογϣϯཁձ
հ͢Δ͜ͱ • Xcode Previews ͱʁ • Xcode Previews ͷվળ ‣
`#Preview` macro ͷొ ‣ Widgets ͷ Preview ͕Մೳʹ ‣ Previews Λදࣔ͢ΔσόΠε͕બՄೳʹ • Xcode Previews Λར༻͢Δࡍͷ Tips ‣ Library targets Ͱ Preview ͢Δํ๏ ‣ Previews Ͱ assets ͳͲΛར༻͢Δํ๏ ‣ Previews ͰσόΠεݻ༗ͷػೳΛར༻͢Δํ๏
Xcode Previews ͱʁ
None
None
Color Scheme Variants
Orientation Variants
Dynamic Type Variants
ҧ͏ View ʹҠΓͳ͕Β࡞ۀͰ͖Δ Pin Preview
https://developer.apple.com/wwdc23/10252
Xcode Previews ͷվળ
`#Preview` macro ͷొ https://developer.apple.com/wwdc23/10252
Con fi gurations ઃఆͰ͖Δ https://developer.apple.com/wwdc23/10252
UIKit AppKit Ͱ Preview ͕؆୯ʹ https://developer.apple.com/wwdc23/10252
Widgets ͷ Preview ͕Մೳʹ - Timeline provider - https://developer.apple.com/wwdc23/10252
Widgets ͷ Preview ͕Մೳʹ - Timeline entries - https://developer.apple.com/wwdc23/10252
Widgets ͷ Preview ͕Մೳʹ - Live Activities - https://developer.apple.com/wwdc23/10252
Previews Λදࣔ͢ΔσόΠε͕બՄೳʹ https://developer.apple.com/wwdc23/10252
Xcode Previews Λ ར༻͢Δࡍͷ Tips
Xcode Previews Λར༻͢Δࡍͷ Tips • Library targets Ͱ Preview ͢Δํ๏
• Previews Ͱ data assets Λར༻͢Δํ๏ • ࣮ػͰ͔͠Ͱ͖ͳ͍͜ͱΛ Previews Ͱࢼ͢ํ๏
Library targets Ͱ Preview ͢Δ • Library targets ‣ Frameworks,
Packages, Dynamic libraries • Library targets Λར༻͢Δతྫ ‣ ϚϧνϞδϡʔϧԽ ‣ ϥΠϒϥϦͷ։ൃ • Library targets Ͱ Preview ͢ΔʹͲ͏͢Εʁ
Xcode Previews ͷΈ • ௨ৗɺPreviews Λىಈͯ͠ϨϯμϦϯά͢ΔͨΊʹ App Widget
ͳͲͷExecutable ͕ඞཁ • Previews Executable Λݟ͚ͭΔͨΊʹҎԼͷ 3 ͭΛ༻͢Δ ‣ Edited source fi les - ࡞ۀ͍ͯ͠ΔιʔεϑΝΠϧ ‣ Target dependencies - ࡞ۀ͍ͯ͠ΔϑΝΠϧΛؚΉ target ͓Αͼ target ͷશͯͷґଘؔ ‣ Selected scheme - બ͞Ε͍ͯΔ scheme ͱ Target dependencies ΛΈ߹ΘͤΔ
App target ʹ 1 ͚ͭͩͷϑΝΠϧ͕͋Δ߹ https://developer.apple.com/wwdc23/10252
ผͷ target ͕͋Δ߹ https://developer.apple.com/wwdc23/10252
ผͷ target ͕͋Δ߹ https://developer.apple.com/wwdc23/10252
2 ͭͷϑΝΠϧ͕ผʑͷ package ʹ͋Δ߹ https://developer.apple.com/wwdc23/10252
Executable ͕ݟ͔ͭΒͳ͍߹ https://developer.apple.com/wwdc23/10252
XCPreviewAgent ͕ࣗಈͰ࡞͞ΕΔ https://developer.apple.com/wwdc23/10252 • ࣗಈͰ XCPreviewAgent ͱ͍͏ΞϓϦΛ࡞Γɺ library
ΛಡΈࠐ͏ͱ͢Δ • Previews ͰΫϥογϡͨ࣌͠ ͳͲɺXCPreviewAgent ͱ͍͏ ϓϩηεΛ͓ͬͯ͘ͱศར • ͕ى͖ͨݪҼΛߜΕΔ͔
Library targets Ͱ Previews ΛΑΓշదʹ ಈ࡞ͤ͞ΔͨΊͷํ๏ • Previews ͷΈΛར༻͢Εɺ͍͔ͭ͘ͷํ๏Ͱ
Previews Λ շదʹಈ࡞ͤ͞ΒΕΔ • հ͞Ε͍ͯͨ 2 ͭͷํ๏ ‣ ίʔυΛ library targets ʹϞδϡʔϧԽͯ͠খ͞ͳ scheme Λ࡞Δ ‣ Preview ઐ༻ͷখ͞ͳΞϓϦ (executable) Λ࡞͢Δ - ࡞ํ๏ʹ͍ͭͯηογϣϯͷதͰղઆ͞Ε͍ͯ·͢
Previews Ͱ assets ͳͲΛར༻͢Δ https://developer.apple.com/wwdc23/10252
Development Assets Ͱ App Store ༻ͷΞϓϦ ͔ΒPreviews ༻ assets
ͳͲΛࣗಈͰআ͢Δ https://developer.apple.com/wwdc23/10252
Previews ͰσόΠεݻ༗ͷػೳΛར༻͢Δํ๏ • Previews ͰΧϝϥηϯαʔɺ৭ʑͳσʔλʹΞΫηε͍ͨ͠ • ͦΜͳ࣌ Previews Λ࣮ػͰ͏͜ͱ͕Ͱ͖·͢ ‣
લ͔ΒͰ͖͚ͨͲ Canvas ্ͷ interface ͕ͪΐͬͱมΘ͍ͬͯΔ
Previews Ͱ࣮ػΛར༻͢Δ https://developer.apple.com/wwdc23/10252
Ҿ༻ɾࢀߟ • Build programmatic UI with Xcode Previews ‣ https://developer.apple.com/wwdc23/10252
• Xcode 15 Beta Release Notes ‣ https://developer.apple.com/documentation/xcode-release-notes/ xcode-15-release-notes#DeviceDiscoveryUI
ࣗݾհ • ΞΠΧϫ • Twitter: @kalupas226 • ຊۀ෭ۀͰ৭ʑΞϓϦΛ࡞ͬͨΓج൫උͨ͠Γ • The
Composable Architecture (TCA) ͕ಘҙͰ͢