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
1
680
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
820
enum で KeyPaths のような機能を実現する CasePaths
kalupas226
4
860
SwiftUI Navigation のすべて
kalupas226
11
7.7k
Refreshable API を TCA で使う
kalupas226
0
190
Combineを使ったコードのテストをSchedulerで操る方法とその仕組み
kalupas226
2
1.6k
Composable FormsでTCAのボイラープレートとおさらばする
kalupas226
1
1.1k
Swiftの関数と代数学
kalupas226
0
590
Swiftのstruct・enumと代数学_part1
kalupas226
2
1.2k
Examples の Search プロジェクトから学ぶ The Composable Architecture
kalupas226
0
330
Other Decks in Technology
See All in Technology
マーケットプレイス版Oracle WebCenter Content For OCI
oracle4engineer
PRO
1
160
バックログを導入し やっぱやめた話
ota42y
0
170
Azure Cosmos DB での時系列ログの運用と改善
sansantech
PRO
0
190
四国のあのイベントの〇〇システムを45日間で構築した話 / cloudohenro2024_tachibana
biatunky
0
150
Javaにおける関数型プログラミンへの取り組み
skrb
6
220
日経電子版から始まった内製開発の現在地と向き合っている課題/inhouse
nishiuma
0
230
Dive Deep in Cloud Run: Automatic Base Image update
aoto
PRO
0
900
歴史と背景から改めて振り返るVPC
shotashiratori
2
220
Namespace, Now and Then
tagomoris
0
170
Dojo 20240830 COBOL to Java on Z
ichikawayasuhisa
0
240
スーパーマリオRPGのリメイク版の変更点からみるUX
nishiharatsubasa
1
140
20分で分かるIAM全機能 (拡大版) / 20240903-jawsug-yokohama-iam
opelab
3
120
Featured
See All Featured
How to name files
jennybc
75
97k
Designing for Performance
lara
604
68k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
246
1.3M
Testing 201, or: Great Expectations
jmmastey
35
6.9k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
225
22k
Fantastic passwords and where to find them - at NoRuKo
philnash
47
2.7k
What's in a price? How to price your products and services
michaelherold
241
11k
Thoughts on Productivity
jonyablonski
65
4.2k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
325
21k
Building a Modern Day E-commerce SEO Strategy
aleyda
35
6.8k
Six Lessons from altMBA
skipperchong
26
3.3k
Optimising Largest Contentful Paint
csswizardry
28
2.7k
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) ͕ಘҙͰ͢