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
750
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
1.1k
enum で KeyPaths のような機能を実現する CasePaths
kalupas226
4
920
SwiftUI Navigation のすべて
kalupas226
11
8k
Refreshable API を TCA で使う
kalupas226
0
200
Combineを使ったコードのテストをSchedulerで操る方法とその仕組み
kalupas226
2
1.7k
Composable FormsでTCAのボイラープレートとおさらばする
kalupas226
1
1.1k
Swiftの関数と代数学
kalupas226
0
640
Swiftのstruct・enumと代数学_part1
kalupas226
2
1.3k
Examples の Search プロジェクトから学ぶ The Composable Architecture
kalupas226
0
360
Other Decks in Technology
See All in Technology
宇宙ベンチャーにおける最近の情シス取り組みについて
axelmizu
0
120
[トレノケ雲の会 mod.13] 3回目のre:Inventで気づいたこと -CloudOperationsを添えて-
shintaro_fukatsu
0
110
1等無人航空機操縦士一発試験 合格までの道のり ドローンミートアップ@大阪 2024/12/18
excdinc
0
180
JVM(JavaVM)の性能分析者観点で探るInstanaの可能性
instanautsjp
0
120
Server-Side Engineer of LINE Sukimani
lycorp_recruit_jp
0
360
コンテナセキュリティのためのLandlock入門
nullpo_head
2
330
どちらを使う?GitHub or Azure DevOps Ver. 24H2
kkamegawa
0
1.2k
生成AIのガバナンスの全体像と現実解
fnifni
1
210
スタートアップで取り組んでいるAzureとMicrosoft 365のセキュリティ対策/How to Improve Azure and Microsoft 365 Security at Startup
yuj1osm
0
240
20241218_今年はSLI/SLOの導入を頑張ってました!
zepprix
0
100
開発生産性向上! 育成を「改善」と捉えるエンジニア育成戦略
shoota
2
460
生成AIをより賢く エンジニアのための RAG入門 - Oracle AI Jam Session #20
kutsushitaneko
4
290
Featured
See All Featured
Writing Fast Ruby
sferik
628
61k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
191
16k
Site-Speed That Sticks
csswizardry
2
190
Rails Girls Zürich Keynote
gr2m
94
13k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
33
2k
A Modern Web Designer's Workflow
chriscoyier
693
190k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
29
910
Optimising Largest Contentful Paint
csswizardry
33
3k
What's in a price? How to price your products and services
michaelherold
244
12k
Practical Orchestrator
shlominoach
186
10k
Building Flexible Design Systems
yeseniaperezcruz
327
38k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
6
520
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) ͕ಘҙͰ͢