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
730
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
980
enum で KeyPaths のような機能を実現する CasePaths
kalupas226
4
910
SwiftUI Navigation のすべて
kalupas226
11
7.9k
Refreshable API を TCA で使う
kalupas226
0
200
Combineを使ったコードのテストをSchedulerで操る方法とその仕組み
kalupas226
2
1.7k
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
Amazon CloudWatch Network Monitor のススメ
yuki_ink
1
210
Oracle Cloud Infrastructureデータベース・クラウド:各バージョンのサポート期間
oracle4engineer
PRO
29
13k
強いチームと開発生産性
onk
PRO
36
12k
アプリエンジニアのためのGraphQL入門.pdf
spycwolf
0
110
The Rise of LLMOps
asei
9
1.8k
アジャイルチームがらしさを発揮するための目標づくり / Making the goal and enabling the team
kakehashi
3
160
AGIについてChatGPTに聞いてみた
blueb
0
130
個人でもIAM Identity Centerを使おう!(アクセス管理編)
ryder472
4
240
CysharpのOSS群から見るModern C#の現在地
neuecc
2
3.6k
Taming you application's environments
salaboy
0
200
適材適所の技術選定 〜GraphQL・REST API・tRPC〜 / Optimal Technology Selection
kakehashi
1
710
Adopting Jetpack Compose in Your Existing Project - GDG DevFest Bangkok 2024
akexorcist
0
120
Featured
See All Featured
Designing on Purpose - Digital PM Summit 2013
jponch
115
7k
VelocityConf: Rendering Performance Case Studies
addyosmani
325
24k
GraphQLの誤解/rethinking-graphql
sonatard
67
10k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
232
17k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
109
49k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
16
2.1k
Visualization
eitanlees
145
15k
Put a Button on it: Removing Barriers to Going Fast.
kastner
59
3.5k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
31
2.7k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
246
1.3M
Into the Great Unknown - MozCon
thekraken
32
1.5k
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) ͕ಘҙͰ͢