Link
Embed
Share
Beginning
This slide
Copy link URL
Copy link URL
Copy iframe embed code
Copy iframe embed code
Copy javascript embed code
Copy javascript embed code
Share
Tweet
Share
Tweet
Slide 1
Slide 1 text
Build programmatic UI with Xcode Previews Xcode Previews ͷվળ Tips Λཁͯ͠հ͠·͢ SwiftѪձεϐϯΦϑ WWDC23ηογϣϯཁձ
Slide 2
Slide 2 text
հ͢Δ͜ͱ • Xcode Previews ͱʁ • Xcode Previews ͷվળ ‣ `#Preview` macro ͷొ ‣ Widgets ͷ Preview ͕Մೳʹ ‣ Previews Λදࣔ͢ΔσόΠε͕બՄೳʹ • Xcode Previews Λར༻͢Δࡍͷ Tips ‣ Library targets Ͱ Preview ͢Δํ๏ ‣ Previews Ͱ assets ͳͲΛར༻͢Δํ๏ ‣ Previews ͰσόΠεݻ༗ͷػೳΛར༻͢Δํ๏
Slide 3
Slide 3 text
Xcode Previews ͱʁ
Slide 4
Slide 4 text
No content
Slide 5
Slide 5 text
No content
Slide 6
Slide 6 text
Color Scheme Variants
Slide 7
Slide 7 text
Orientation Variants
Slide 8
Slide 8 text
Dynamic Type Variants
Slide 9
Slide 9 text
ҧ͏ View ʹҠΓͳ͕Β࡞ۀͰ͖Δ Pin Preview
Slide 10
Slide 10 text
https://developer.apple.com/wwdc23/10252
Slide 11
Slide 11 text
Xcode Previews ͷվળ
Slide 12
Slide 12 text
`#Preview` macro ͷొ https://developer.apple.com/wwdc23/10252
Slide 13
Slide 13 text
Con fi gurations ઃఆͰ͖Δ https://developer.apple.com/wwdc23/10252
Slide 14
Slide 14 text
UIKit AppKit Ͱ Preview ͕؆୯ʹ https://developer.apple.com/wwdc23/10252
Slide 15
Slide 15 text
Widgets ͷ Preview ͕Մೳʹ - Timeline provider - https://developer.apple.com/wwdc23/10252
Slide 16
Slide 16 text
Widgets ͷ Preview ͕Մೳʹ - Timeline entries - https://developer.apple.com/wwdc23/10252
Slide 17
Slide 17 text
Widgets ͷ Preview ͕Մೳʹ - Live Activities - https://developer.apple.com/wwdc23/10252
Slide 18
Slide 18 text
Previews Λදࣔ͢ΔσόΠε͕બՄೳʹ https://developer.apple.com/wwdc23/10252
Slide 19
Slide 19 text
Xcode Previews Λ ར༻͢Δࡍͷ Tips
Slide 20
Slide 20 text
Xcode Previews Λར༻͢Δࡍͷ Tips • Library targets Ͱ Preview ͢Δํ๏ • Previews Ͱ data assets Λར༻͢Δํ๏ • ࣮ػͰ͔͠Ͱ͖ͳ͍͜ͱΛ Previews Ͱࢼ͢ํ๏
Slide 21
Slide 21 text
Library targets Ͱ Preview ͢Δ • Library targets ‣ Frameworks, Packages, Dynamic libraries • Library targets Λར༻͢Δతྫ ‣ ϚϧνϞδϡʔϧԽ ‣ ϥΠϒϥϦͷ։ൃ • Library targets Ͱ Preview ͢ΔʹͲ͏͢Εʁ
Slide 22
Slide 22 text
Xcode Previews ͷΈ • ௨ৗɺPreviews Λىಈͯ͠ϨϯμϦϯά͢ΔͨΊʹ App Widget ͳͲͷExecutable ͕ඞཁ • Previews Executable Λݟ͚ͭΔͨΊʹҎԼͷ 3 ͭΛ༻͢Δ ‣ Edited source fi les - ࡞ۀ͍ͯ͠ΔιʔεϑΝΠϧ ‣ Target dependencies - ࡞ۀ͍ͯ͠ΔϑΝΠϧΛؚΉ target ͓Αͼ target ͷશͯͷґଘؔ ‣ Selected scheme - બ͞Ε͍ͯΔ scheme ͱ Target dependencies ΛΈ߹ΘͤΔ
Slide 23
Slide 23 text
App target ʹ 1 ͚ͭͩͷϑΝΠϧ͕͋Δ߹ https://developer.apple.com/wwdc23/10252
Slide 24
Slide 24 text
ผͷ target ͕͋Δ߹ https://developer.apple.com/wwdc23/10252
Slide 25
Slide 25 text
ผͷ target ͕͋Δ߹ https://developer.apple.com/wwdc23/10252
Slide 26
Slide 26 text
2 ͭͷϑΝΠϧ͕ผʑͷ package ʹ͋Δ߹ https://developer.apple.com/wwdc23/10252
Slide 27
Slide 27 text
Executable ͕ݟ͔ͭΒͳ͍߹ https://developer.apple.com/wwdc23/10252
Slide 28
Slide 28 text
XCPreviewAgent ͕ࣗಈͰ࡞͞ΕΔ https://developer.apple.com/wwdc23/10252 • ࣗಈͰ XCPreviewAgent ͱ͍͏ΞϓϦΛ࡞Γɺ library ΛಡΈࠐ͏ͱ͢Δ • Previews ͰΫϥογϡͨ࣌͠ ͳͲɺXCPreviewAgent ͱ͍͏ ϓϩηεΛ͓ͬͯ͘ͱศར • ͕ى͖ͨݪҼΛߜΕΔ͔
Slide 29
Slide 29 text
Library targets Ͱ Previews ΛΑΓշదʹ ಈ࡞ͤ͞ΔͨΊͷํ๏ • Previews ͷΈΛར༻͢Εɺ͍͔ͭ͘ͷํ๏Ͱ Previews Λ շదʹಈ࡞ͤ͞ΒΕΔ • հ͞Ε͍ͯͨ 2 ͭͷํ๏ ‣ ίʔυΛ library targets ʹϞδϡʔϧԽͯ͠খ͞ͳ scheme Λ࡞Δ ‣ Preview ઐ༻ͷখ͞ͳΞϓϦ (executable) Λ࡞͢Δ - ࡞ํ๏ʹ͍ͭͯηογϣϯͷதͰղઆ͞Ε͍ͯ·͢
Slide 30
Slide 30 text
Previews Ͱ assets ͳͲΛར༻͢Δ https://developer.apple.com/wwdc23/10252
Slide 31
Slide 31 text
Development Assets Ͱ App Store ༻ͷΞϓϦ ͔ΒPreviews ༻ assets ͳͲΛࣗಈͰআ͢Δ https://developer.apple.com/wwdc23/10252
Slide 32
Slide 32 text
Previews ͰσόΠεݻ༗ͷػೳΛར༻͢Δํ๏ • Previews ͰΧϝϥηϯαʔɺ৭ʑͳσʔλʹΞΫηε͍ͨ͠ • ͦΜͳ࣌ Previews Λ࣮ػͰ͏͜ͱ͕Ͱ͖·͢ ‣ લ͔ΒͰ͖͚ͨͲ Canvas ্ͷ interface ͕ͪΐͬͱมΘ͍ͬͯΔ
Slide 33
Slide 33 text
Previews Ͱ࣮ػΛར༻͢Δ https://developer.apple.com/wwdc23/10252
Slide 34
Slide 34 text
Ҿ༻ɾࢀߟ • 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
Slide 35
Slide 35 text
ࣗݾհ • ΞΠΧϫ • Twitter: @kalupas226 • ຊۀ෭ۀͰ৭ʑΞϓϦΛ࡞ͬͨΓج൫උͨ͠Γ • The Composable Architecture (TCA) ͕ಘҙͰ͢