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
IBとUIの適度な階層化の提案
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
naru-jpn
March 28, 2018
Technology
1.6k
3
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
IBとUIの適度な階層化の提案
IB上でUIの適度な階層化をすることによって、標準の仕組みでより簡単に扱えるような設計を目指しました。
naru-jpn
March 28, 2018
More Decks by naru-jpn
See All by naru-jpn
配信アプリのためのリアルタイムプッシュ通知ぼかしの夢
narujpn
3
1.2k
PiPを応用した配信コメントバー機能の開発秘話と技術の詳解 / pip_streaming_comment_bar
narujpn
3
5.1k
Updating an App to Use Swift Concurrency 解説
narujpn
2
420
PiP で実現するミラティブの配信コメントバー / pip-streaming-comment-bar
narujpn
0
1.4k
App Extension のスタックトレース情報からクラッシュを解析/集計する / Analyzing app extension's stack trace
narujpn
3
1.9k
ミラティブとWebRTC - WebRTC framework の中身を覗いてみよう / WebRTC framework AudioUnit Processing
narujpn
1
2.3k
CoreML3のオンデバイストレーニングでつくる母音推定
narujpn
0
510
AltConfと周辺の歩き方
narujpn
0
2.1k
エンジニア経験を活かしたスクラムマスターとして 開発チームとプロダクトを成長させる
narujpn
1
450
Other Decks in Technology
See All in Technology
In-Context Learning再入門。ICLの勾配降下的解釈の研究動向を追ってみる。
dai08srhg
1
750
AWS Quick 入門 | 目指せ Quick マスター 01
inariku
PRO
2
240
Kiro Crew の Bot (続く役目を任せる窓口) | 目指せ Kiro マスター 12
inariku
PRO
2
340
生成AI時代のIAMのマニアックな話
takuros
6
2.8k
Metadata - Section 3 : Dublin Core Standard · DC
mohab1
0
120
自律的なチームを作るためにTechPMがやらないこと
ny7760
1
530
[General] 개발자로 해외 기업에서 일하기
skydoves
1
310
【dbts2026】AIエージェントの 判断と探索を変える、 データベース エンジニアリング― 既存DBの処理と依存関係から作る、オペレーショナルオントロジー ―
shisyu_gaku
0
260
MCPでAIが自分で調べに行く
cdataj
0
110
[dbts2026]数十PBの超巨大データ×AI活用を支えるSnowflakeの実力〜大規模環境におけるアーキテクチャと運用のリアル〜
y_matsubara
0
120
ライフワーク「猫でもわかるDirectConnect」
kentapapa
0
300
re:Invent2026 事前勉強会 歴史と愉しみ方10分LT編
toshi_atsumi
0
170
Featured
See All Featured
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
380
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.6k
YesSQL, Process and Tooling at Scale
rocio
174
15k
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
1
300
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
33
5.7k
Leading Effective Engineering Teams in the AI Era
addyosmani
9
2.9k
The SEO Collaboration Effect
kristinabergwall1
1
620
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
550
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
35
2.9k
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
470
Scaling GitHub
holman
464
140k
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
760
Transcript
IBͱUIͷదͳ֊ԽͷఏҊ 2018.3.28 AKIBA.swift × ΤϨΧ ίʔυϨΠΞτษڧձ Naruki Chigira @timers-inc.
Lib arXiv arxiv.org ʹߘ͞ΕΔจΛӾཡɾอଘɾڞ༗͢ΔͨΊͷΞϓϦ
No Interface Builder No Auto Layout iPhone & iPad (&
iPhoneX) Portrait & Landscape
class ApplicationStyle { static let isiPhone = UIDevice.current.userInterfaceIdiom == .phone
class Category { static func TableViewCellRowHeight() -> CGFloat { if isiPhone { return 50.0 } else { return 60.0 } } …
https://github.com/naru-jpn/LayoutXML LayoutXML Android styled XML template engine for iOS written
in Swift.
https://github.com/naru-jpn/LayoutXML
https://github.com/naru-jpn/LayoutXML
https://github.com/naru-jpn/LayoutXML
https://github.com/naru-jpn/LayoutXML $ pod try LayoutXML
XML͔Βੜ͞ΕΔϏϡʔͷ֊ߏ
http://grepcode.com/.../LinearLayout.java grepcode.com LinearLayout View Λܧঝ͍ͯ͠Δ
None
֊ߏ͕͔Ε͍ͯΔͷͰ ֤ʑͷ෦ͷϨΠΞτಠཱʹܭࢉ͕Ͱ͖Δ ᶃ ᶄ ᶅ
લఏ͓ΘΓ
ຊ
ϏϡʔίϯτϩʔϥʹԿΛ͍͔ͤͨ͞ʁ
ϏϡʔͷίϯτϩʔϧΛ͍ͤͨ͞
Ͱ͖ΕϏϡʔͷίϯτϩʔϧʮ͚ͩʯ͍ͤͨ͞
͖ͬ͞ͷxmlͷྫΛࢥ͍ग़ͯ͠ΈΔ
https://github.com/naru-jpn/LayoutXML
https://github.com/naru-jpn/LayoutXML
ಡΈࠐΈ3ߦɺ෦ใͷߋ৽4ߦʂ
Ͱո͍͠ϥΠϒϥϦ͍ͨ͘ͳ͍
ʮ֊ߏʯ͕ΩʔʹͳΔͷͰ…!
Ծʹɺ࣍ͷΑ͏ͳ࣮Λߟ͑ͯΈ·͠ΐ͏
ίʔυϨΠΞτ ҎԼͷจষΛ֬͝ೝ͍ͩ͘͞ ͋ͳͨInterface BuilderΛ ͍͚ͬͯ·ͤΜ ͍ɺΘ͔Γ·ͨ͠ ҙࣄ߲
ίʔυϨΠΞτ ͋Γ͕ͱ͏͍͟͝·ͨ͠ ҙࣄ߲
ίʔυϨΠΞτ ҎԼͷจষΛ֬͝ೝ͍ͩ͘͞ ͋ͳͨInterface BuilderΛ ͍͚ͬͯ·ͤΜ ͍ɺΘ͔Γ·ͨ͠ ҙࣄ߲ ίʔυϨΠΞτ ͋Γ͕ͱ͏͍͟͝·ͨ͠ ҙࣄ߲
Ͳ͏࡞Γ·͔͢ʁ
·ͣϑϥοτʹ࡞ͬͯΈ·͠ΐ͏
FlattenViewController
class FlattenViewController: UIViewController, Instantiatable { @IBOutlet weak var titleLabel: UILabel!
@IBOutlet weak var messageLabel: UILabel! @IBOutlet weak var confirmLabel: UILabel! @IBOutlet weak var confirmButton: UIButton! @IBOutlet weak var notesButton: UIButton! @IBAction func onAcceptButtonClicked(sender: Any) { messageLabel.text = "͋Γ͕ͱ͏͍͟͝·ͨ͠" // ϨΠΞτͷߋ৽... } }
ϨΠΞτͷߋ৽͕େม
ಈతͳ༷͕͞Βʹ૿͑ͨΒ…?
֊ԽΛͯ͠ΈΑ͏
LayeredViewController
LayeredViewController LayeredHeaderView LayeredBodyView LayeredFooterView
class LayeredViewController: UIViewController, Instantiatable { @IBOutlet weak var header: LayeredHeaderView!
@IBOutlet weak var body: LayeredBodyView! @IBOutlet weak var footer: LayeredFooterView! } ֤ΧελϜϏϡʔͷ࡞Γํɺ͍ํΛΈ͍͖ͯ·͠ΐ͏
class LayeredHeaderView: UIView { @IBOutlet weak var titleLabel: UILabel! @IBOutlet
weak var messageLabel: UILabel! /// ঝ͞Εͨ func accept() { messageLabel.text = "͋Γ͕ͱ͏͍͟͝·ͨ͠" } }
UIViewΛՃɺCustom Class ʹఆٛͨ͠ϏϡʔͷΫϥεΛࢦఆ͢Δ Tips1 ΧελϜϏϡʔͷࢦఆ
Outlets ʹΧελϜϏϡʔͷϓϩύςΟ͕ݟ͑ΔͷͰɺܨ͙ Tips1 ΧελϜϏϡʔͷࢦఆ
class LayeredBodyView: UIView { @IBOutlet weak var messageLabel: UILabel! @IBOutlet
weak var button: UIButton! @IBOutlet weak var zeroHeightConstraint: NSLayoutConstraint! /// ։ด var isOpen: Bool = true { didSet { zeroHeightConstraint.isActive = !isOpen } } }
0 A B C Priority: A, B < C ੍CͷΞΫςΟϒɾඇΞΫςΟϒͷΓସ͑ʹΑͬͯදࣔɾඇද͕ࣔͰ͖Δ
100 100 Tips2 ੍ͷߏԽ
class LayeredFooterView: UIView { @IBOutlet weak var notesButon: UIButton! }
class LayeredViewController: UIViewController, Instantiatable { @IBOutlet weak var header: LayeredHeaderView!
@IBOutlet weak var body: LayeredBodyView! @IBOutlet weak var footer: LayeredFooterView! @IBAction func onAcceptButtonClicked(sender: Any) { header.accept() body.isOpen = false } } 13ߦʂ
ಈతͳ༷͕૿͑ͯฏؾͳؾ͕͠·ͤΜ͔ʁ
·ͱΊ ʮదͳ֊ԽʯʹΑͬͯ ɾ໌֬ͳػೳΛ࣋ͬͨΧελϜϏϡʔ͕࡞͘͢͠ͳΔ ɾ੍͕ߏԽ͞Εͯར༻͘͢͠ͳΔ ɾϏϡʔίϯτϩʔϥͰͷॲཧΛநԽ͘͢͠ͳΔ
IBͱUIͷదͳ֊ԽͷఏҊ ͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠ !