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
IdentifiableUIKit
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
gaussbeam
November 25, 2016
Technology
1
500
IdentifiableUIKit
2016.11.25 shinagawa.swift
gaussbeam
November 25, 2016
Tweet
Share
More Decks by gaussbeam
See All by gaussbeam
AIプロダクトのリサーチとデザイン_インサイトで繋ぐヒト・モノ・ヒト
gaussbeam
0
55
成長する組織のナレッジベースのつくりかた_知識基盤のデザインとメタデザイン
gaussbeam
0
1.8k
CI/CDと継続的ワークフロー改善
gaussbeam
2
2.5k
(UI)Switch は つくれる
gaussbeam
1
740
Human Interface Guidelinesから滲み出る限界感を考える
gaussbeam
5
4.2k
ローカライズの苦しみに立ち向かう
gaussbeam
1
700
Storyboardを積極的に使うべきか?その役割に基づく一考察
gaussbeam
1
2k
Other Decks in Technology
See All in Technology
Yahoo!ショッピングのレコメンデーション・システムにおけるML実践の一例
lycorptech_jp
PRO
1
190
Exadata Database Service on Dedicated Infrastructure(ExaDB-D) UI スクリーン・キャプチャ集
oracle4engineer
PRO
8
7.2k
スクリプトの先へ!AIエージェントと組み合わせる モバイルE2Eテスト
error96num
0
150
When an innocent-looking ListOffsets Call Took Down Our Kafka Cluster
lycorptech_jp
PRO
0
120
脳内メモリ、思ったより揮発性だった
koutorino
0
130
モブプログラミング再入門 ー 基本から見直す、AI時代のチーム開発の選択肢 ー / A Re-introduction of Mob Programming
takaking22
5
1.3k
マネージャー版 "提案のレベル" を上げる
konifar
22
15k
Evolution of Claude Code & How to use features
oikon48
1
590
OCI技術資料 : コンピュート・サービス 概要
ocise
4
54k
決済サービスを支えるElastic Cloud - Elastic Cloudの導入と推進、決済サービスのObservability
suzukij
2
600
猫でもわかるKiro CLI(AI 駆動開発への道編)
kentapapa
0
110
20260311 技術SWG活動報告(デジタルアイデンティティ人材育成推進WG Ph2 活動報告会)
oidfj
0
290
Featured
See All Featured
What’s in a name? Adding method to the madness
productmarketing
PRO
24
4k
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
470
My Coaching Mixtape
mlcsv
0
69
How to Ace a Technical Interview
jacobian
281
24k
Darren the Foodie - Storyboard
khoart
PRO
3
2.8k
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
1
140
Done Done
chrislema
186
16k
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
140
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
99
HDC tutorial
michielstock
1
530
How to train your dragon (web standard)
notwaldorf
97
6.6k
The World Runs on Bad Software
bkeepers
PRO
72
12k
Transcript
IdentifiableUIKit hanyu 2016.11.25 shinagawa.swift #1
Interface Builderʹͬͱؤுͬͯ΄͍͜͠ͱ ͦͷ̍ ɹؙ֯ʹ͍ͨ͠ ɹυϩοϓγϟυ͚͍ͭͨ ɹϘʔμʔ͚͍ͭͨ WJFXMBZFSDPSOFS3BEJVT WJFXMBZFSCPSEFS8JEUI WJFXMBZFSCPSEFS$PMPS 6*$PMPSXIJUF$PMPS
$($PMPS WJFXMBZFSTIBEPX0QBDJUZ WJFXMBZFSTIBEPX0⒎TFU $(4J[F XJEUI IFJHIU WJFXMBZFSTIBEPX$PMPS 6*$PMPSCMBDL$PMPS $($PMPS WJFXMBZFSTIBEPX3BEJVT TIBEPX3BEJVT
Interface Builderʹͬͱؤுͬͯ΄͍͜͠ͱ ͦͷ̎ ɹഎܠ৭ΞϓϦͷςʔϚΧϥʔͰ 0, ɹ͜͜ΞϓϦͷςʔϚΧϥʔͰ ɹ͜͜ΞϓϦͷςʔϚΧϥʔͰ … 0, ʜ
ɹ͝ΊΜɺςʔϚΧϥʔมߋʹͳͬͨ
IdentifiableUIKit •ϏϡʔͷελΠϧΛIDͰࢦఆ •Interface Builder্(=Ϗϧυෆཁ)Ͱଈ࣌ө •ελΠϧࣗ༝ʹఆٛͰ͖Δ
DEMO
@IBDesignable class IdentifiableView: UIView { @IBInspectable var … ɹoverride drawRect(rect:
CGRect) { ɹɹ… ɹ} } Interface Builder্Ͱଈ࣌ө →@IBDesignable, @IBInspectableͰ࣮ݱ
@IBDesignable class IdentifiableView: UIView { @IBInspectable var backgroundColorKey: String =
“" ɹ… ɹoverride drawRect(rect: CGRect) { ɹɹview.backgroundColor = colorStyle.getColor(colorKey: self.backgroundColorKey) ɹɹ… ɹ} } Interface Builder্Ͱଈ࣌ө + ϏϡʔͷελΠϧΛIDͰࢦఆ →drawRect()Ͱͷ৭ελΠϧऔಘΛIDʹΑΓߦ͏
protocol ColorIdentifiable { var colorStyle: ColorStyleType.Type? { get } }
protocol ColorStyleType { static var colorDic: [String: UIColor] { get } } @IBDesignable class IdentifiableView: UIView, ColorIdentifiable { … } ϏϡʔͷελΠϧΛIDͰࢦఆ →Ϗϡʔʹ(ColorStyleTypeͷมΛ௨ͯ͡)ελΠϧͷࣙॻΛ࣋ͨͤΔ
class MyColorStyle: NSObject, ColorStyleType { static var colorDic: [String: UIColor]
= [ “C01": UIColor.redColor(), … ] } ελΠϧࣗ༝ʹఆٛͰ͖Δ →IdentifiableViewΛܧঝͨ͠Ϗϡʔʹඥ͚ class MyView: IdentifiableView { override var colorStyle: ColorStyleType.Type? { return MyColorStyle.self } } →ColorStyleTypeʹద߹ͨ͠ClassΛఆٛ͠
!*#%FTJHOBCMF*EFOUJpBCMF7JFX .Z7JFX .Z$PMPS4UZMF $PMPS4UZMF5ZQF !*#*OTQFDUBCMFCBDLHSPVOE$PMPS,FZ 1: αϒΫϥεΛఆٛ 2: Interface BuilderͰIDΛࢦఆ
֓೦ਤ ݉ ͍ํ .Z7JFX4UZMF 7JFX4UZMF5ZQF
IdentifiableUIKit •ϏϡʔͷελΠϧΛIDͰࢦఆ •Interface Builder্(=Ϗϧυෆཁ) Ͱଈ࣌ө •ελΠϧࣗ༝ʹఆٛͰ͖Δ Sorry, it’s for Swift
2.2… • (view.layerͰখࡉ͍ͯ͠ΔͨΊɺෳࡶͳϏϡʔͰॏ͘ͳΔ͔…) https://github.com/gaussbeam/IdentifiableUIKit