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
Exit 8 for SwiftUI
Search
ojun
April 12, 2025
Programming
0
130
Exit 8 for SwiftUI
ojun
April 12, 2025
Tweet
Share
More Decks by ojun
See All by ojun
Swift Evolution かるた
ojun9
2
100
Xcode 16のPreviewModifierと@Previewableを活用した効率的なプレビュー方法の考察
ojun9
4
780
Catch Up with Swift 5.10
ojun9
2
800
Overview: Swift OpenAPI Generator
ojun9
3
2k
if 式と switch 式による SwiftUI のプレビューエラー対策
ojun9
1
1.7k
楽しい夏休み!String Catalogs で新しい発見
ojun9
0
2.1k
ユニットテストを学んだ次に知りたかったApple標準APIに対するテストのやり方
ojun9
1
420
ハッカソンにおけるiOSアプリ開発での学びと楽しさ
ojun9
1
330
Other Decks in Programming
See All in Programming
AIコードエディタの基盤となるLLMのFlutter性能評価
alquist4121
0
210
Kamal 2 – Get Out of the Cloud
aleksandrov
1
190
プロダクト横断分析に役立つ、事前集計しないサマリーテーブル設計
hanon52_
2
440
ComposeでWebアプリを作る技術
tbsten
0
110
Deoptimization: How YJIT Speeds Up Ruby by Slowing Down / RubyKaigi 2025
k0kubun
0
830
Agentic Applications with Symfony
el_stoffel
2
300
設計の本質:コード、システム、そして組織へ / The Essence of Design: To Code, Systems, and Organizations
nrslib
4
490
[NG India] Event-Based State Management with NgRx SignalStore
markostanimirovic
1
160
Defying Front-End Inertia: Inertia.js on Rails
skryukov
0
490
Amazon CloudWatchの地味だけど強力な機能紹介!
itotsum
0
160
The Evolution of the CRuby Build System
kateinoigakukun
0
700
PHPで書いたAPIをGoに書き換えてみた 〜パフォーマンス改善の可能性を探る実験レポート〜
koguuum
0
160
Featured
See All Featured
The Straight Up "How To Draw Better" Workshop
denniskardys
232
140k
Building a Modern Day E-commerce SEO Strategy
aleyda
40
7.2k
Stop Working from a Prison Cell
hatefulcrawdad
268
20k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
19
1.1k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
16k
Code Review Best Practice
trishagee
67
18k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
251
21k
How to Think Like a Performance Engineer
csswizardry
23
1.5k
How GitHub (no longer) Works
holman
314
140k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
507
140k
GraphQLとの向き合い方2022年版
quramy
46
14k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
Transcript
Exit 8 for SwiftUI ojun - DeNA co., Ltd. try!
Swift Tokyo 2025 LT 2025 / 04 / 11
None
Exit 1 Prevent double taps or simultaneous taps
Exit 1 Prevent double taps or simultaneous taps Two buttons
inside a VStack
Exit 1 Prevent double taps or simultaneous taps In this
case, we need to prevent multiple buttons from being tapped simultaneously. However, SwiftUI doesn’t provide a direct API to handle mutual exclusion between buttons.
Exit 1 Prevent double taps or simultaneous taps Set isExclusiveTouch
to false on the wrapped UIView and all of its child views. If needed, implement a custom gesture recognizer to handle touch exclusivity.
None
Exit 2 Match the line height to the Text
Exit 2 Match the line height to the Text Inside
the ZStack, there's a Color and an HStack. The HStack contains a Rectangle and a titleView.
Exit 2 Match the line height to the Text This
UI is similar to what you might see in a train schedule display.
Exit 2 Match the line height to the Text This
UI is similar to what you might see in a train schedule display. However, you can see that the orange line doesn't match the height of the Text.
Exit 2 Match the line height to the Text By
creating a structure that conforms to the Layout protocol, you can align their heights.
Exit 2 Match the line height to the Text Applying
this layout to the original code allows the orange line to match the height of the Text.
None
Exit 3 Customize the loading indicator
Exit 3 Customize the loading indicator
Exit 3 Customize the loading indicator Since customization isn't possible
in SwiftUI, we need to implement it using UIKit.
None
Exit 4 Dismiss the keyboard on scroll
Exit 4 Dismiss the keyboard on scroll This behavior is
supported on iOS 16 and later. The keyboard automatically hides when the user scrolls, which simpli fi es the design.
Exit 4 Dismiss the keyboard on scroll By using scrollDismissesKeyboard,
we can implement this in a much simpler way.
Exit 5 Presenting a share sheet
Exit 5 Presenting a share sheet This code works on
iOS 16 and later. We're currently using UIActivityViewController to show the Share Sheet.
Exit 5 Presenting a share sheet By switching to ShareLink,
we can eliminate the dependency on UIKit.
Exit 6 Empty data state
Exit 6 Empty data state
Exit 6 Empty data state
Exit 7 Mesh gradient expression
Exit 7 Mesh gradient expression
Exit 7 Mesh gradient expression Starting from iOS 18, MeshGradient
makes it easy to implement mesh gradients.
None
Exit 8 Square Without GeometryReader
Exit 8 Square Without GeometryReader
Exit 8 Square Without GeometryReader It's possible to create a
square without using GeometryReader by leveraging scaledToFit.
None
None