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
740
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
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
630
Swiftのstruct・enumと代数学_part1
kalupas226
2
1.3k
Examples の Search プロジェクトから学ぶ The Composable Architecture
kalupas226
0
350
Other Decks in Technology
See All in Technology
KubeCon NA 2024 Recap / Running WebAssembly (Wasm) Workloads Side-by-Side with Container Workloads
z63d
1
160
セキュリティ系アップデート全体像と AWS Organizations 新ポリシー「宣言型ポリシー」を紹介 / reGrowth 2024 Security
masahirokawahara
0
320
A/Aテストにおけるサンプルサイズ/japanr2024
nikkei_engineer_recruiting
1
630
Oracle Base Database Service:サービス概要のご紹介
oracle4engineer
PRO
0
15k
Splunk Enterpriseで S3のデータを直接検索してみた!
recruitengineers
PRO
2
100
ブラックフライデーで購入したPixel9で、Gemini Nanoを動かしてみた
marchin1989
1
210
同一クラスタ上でのFluxCDとArgoCDのリソース最適化の話
kumorn5s
0
190
宇宙最速のランチRecap LT会(開発者ツール&運用監視編)
nnydtmg
1
190
アップデート紹介:AWS Data Transfer Terminal
stknohg
PRO
0
110
Reliability Engineering at Studist
katsuhisa91
PRO
0
130
イベントをどう管理するか
mikanichinose
1
120
プロダクトの爆速開発を支える、 「作らない・削る・尖らせる」技術
applism118
10
9.4k
Featured
See All Featured
Large-scale JavaScript Application Architecture
addyosmani
510
110k
The Straight Up "How To Draw Better" Workshop
denniskardys
232
140k
The Pragmatic Product Professional
lauravandoore
32
6.3k
Building Better People: How to give real-time feedback that sticks.
wjessup
365
19k
Build The Right Thing And Hit Your Dates
maggiecrowley
33
2.4k
Why Our Code Smells
bkeepers
PRO
335
57k
It's Worth the Effort
3n
183
27k
GraphQLとの向き合い方2022年版
quramy
44
13k
Navigating Team Friction
lara
183
15k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
10
790
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
330
21k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
45
2.2k
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) ͕ಘҙͰ͢