Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
おしゃれなTabBarを作る!
Search
Kanta
April 22, 2023
68
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
おしゃれなTabBarを作る!
Kanta
April 22, 2023
More Decks by Kanta
See All by Kanta
最新技術をキャッチアップしたい~The Composable Architecture~
kantaswift
3
270
Swift丸1年学んだらどこまでできる!?
kantaswift
3
520
Featured
See All Featured
Git: the NoSQL Database
bkeepers
PRO
432
67k
Embracing the Ebb and Flow
colly
88
5.2k
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
1
320
DBのスキルで生き残る技術 - AI時代におけるテーブル設計の勘所
soudai
PRO
68
57k
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
940
30 Presentation Tips
portentint
PRO
1
400
Are puppies a ranking factor?
jonoalderson
2
3.9k
Paper Plane (Part 1)
katiecoart
PRO
2
11k
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
1
320
Claude Code のすすめ
schroneko
67
230k
Documentation Writing (for coders)
carmenintech
77
5.5k
Navigating Algorithm Shifts & AI Overviews - #SMXNext
aleyda
1
1.6k
Transcript
PayPayのようなおしゃれな TabBarを作る! 上條 栞汰 ~ in SwiftUI ~
⾃⼰紹介 l 上條栞汰(かみじょうかんた) l 東洋⼤学総合情報学部2年 l Swift歴 1年(あと3週間ぐらい!!) l UIKit
11ヶ⽉ l SwiftUI 1ヶ⽉ 経歴(インターン) l 株式会社ゆめみ l 株式会社サイバーエージェント CA Tech iOS Dojo @kanta_Swift @KantaSwift よろしければフォローお願い致します🙇
PayPayのTabBar 1. 浮いてるように⾒えるデザイン! 2. View(スクロール)と連携している! 3. 膨らんでいる部分がある! <特徴>
3つの特徴を押さえて 実際に作ってみる!!
完成品
冒頭で挙げた特徴を どのように実現していったか 簡単に紹介します!
特徴1. 浮いているように⾒えるデザイン overlayを使⽤! 👈のようなモデルを定義!! -> タブの個数を任意にすることができる! タブとViewを対応させることができる! -> 浮いているように⾒せることができる!
特徴2. スクロールと連携 GeometryReader + PreferenceKey 👇 ScrollViewのOffsetを 取得することができる! [参考] https://medium.com/@maxnatchanon/sw
iftui-how-to-get-content-offset-from- scrollview-5ce1f84603ec 外国の⽅の記事が ⼀番わかりやすかったです!! 👆
特徴3. 膨らみの再現 addLine(to: CGPoint) 現在の位置から引数(to)で指定した位置まで move(to: CGPoint) pathの始点 などなど... いろいろ試してみると楽しい👍
👇 👇
以上3つの特徴を押さえた技術分野をまとめると... • PreferenceKey -> ⼦ビューから親ビューにデータを渡す仕組み • GeometryReader -> ⾃⾝の親のViewに対する位置を知る仕組み •
ShapeとPath -> いろんな形の図形を作ることができる!!
おまけ @resultBuilderについて 配列なのにカンマとシンタックスがない!? 1. 要素の組み合わせを宣⾔的にかける! 2. 可読性が上がってる?かも!
開発する上で参考したサイト達 最後に 特徴1. 浮いているように⾒えるデザイン+おまけ • https://capibara1969.com/2723/ • https://capibara1969.com/2771/ 特徴2. スクロールと連携
特徴3. 膨らみの表現 • https://medium.com/@maxnatchanon/swiftui-how-to-get-content-offset-from-scrollview-5ce1f84603ec • https://qiita.com/hcrane/items/3f3a9ff2ef0fccd01338 • https://qiita.com/maiyama18/items/a64bab2094750319ef8d • https://speakerdeck.com/chocoyama/20fen-dewakaru-su-xi-resultbuilder-iosdc-2022 • https://speakerdeck.com/uhooi/iosdc-japan-2022
ご清聴ありがとうございました! ※近⽇(今⽉中!)に今回開発したTabViewのコードを公開するので 気になる⽅いらっしゃいましたらフォローお願いします🙇 @KantaSwift