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
UI Appearance Customizing in iOS 5
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Karl Bode
December 01, 2011
Technology
810
1
Share
UI Appearance Customizing in iOS 5
Mein Beitrag zur iPhone Developer Conference 2011 in Köln.
Karl Bode
December 01, 2011
More Decks by Karl Bode
See All by Karl Bode
Xcode in der Praxis
kpbode
0
200
Core Data - App-Design, Nested ManagedObjectContexts, Migration
kpbode
0
250
Other Decks in Technology
See All in Technology
地元にいないローカルオーガナイザーの立ち回り
uvb_76
1
410
Databricks 月刊サービスアップデート 2026年05月号
tyosi1212
0
130
Oracle AI Database@Azure:サービス概要のご紹介
oracle4engineer
PRO
6
1.8k
はじめてのDatadog
kairim0
0
250
個人AIからチームAIへ:開発における品質と生産性の再設計
moongift
PRO
0
340
脅威をエンジニアリングの糧にして:恐怖を乗り越えた先にあったもの / Turn threats into fuel for engineering: what lay beyond overcoming fear
nrslib
1
360
Mastering Ruby Box
tagomoris
3
120
ChatworkとBPaaS 異なる特性で学んだAI機能開発の ベストプラクティス
kubell_hr
2
570
テストコードのないプロジェクトにテストを根付かせる
tttol
1
240
Oracle AI Database@AWS:サービス概要のご紹介
oracle4engineer
PRO
4
2.8k
【Gen-AX】20260530開催_JJUG CCC 2026 Spring
genax
0
230
Generative UI × A2UI で AI エージェントを作った話 AI-DLC も使ってみた!
kmiya84377
1
300
Featured
See All Featured
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
200
Reflections from 52 weeks, 52 projects
jeffersonlam
356
21k
Information Architects: The Missing Link in Design Systems
soysaucechin
0
950
How to train your dragon (web standard)
notwaldorf
97
6.6k
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
440
The Language of Interfaces
destraynor
162
26k
Code Review Best Practice
trishagee
74
20k
Automating Front-end Workflow
addyosmani
1370
210k
Un-Boring Meetings
codingconduct
0
300
The Invisible Side of Design
smashingmag
302
52k
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
220
Context Engineering - Making Every Token Count
addyosmani
9
930
Transcript
UI Customization API Karl Bode @karl_in Neu in iOS 5...
hot coffee apps
• Neue Styling-Properties • UIAppearance • UIAppearanceContainer • Code-Beispiele Übersicht
Karl Bode iOS 5 - UI Customization API
• Neue Styling-Properties • UIAppearance • UIAppearanceContainer • Code-Beispiele Übersicht
Karl Bode iOS 5 - UI Customization API
• Neue Styling-Properties • UIAppearance • UIAppearanceContainer • Code-Beispiele Übersicht
Karl Bode iOS 5 - UI Customization API
TintColor • UIActivityIndicatorView • UIProgressView • UISlider • UISwitch •
UISegmentedControl • UI***Bar • UIBarButtonItem Karl Bode iOS 5 - UI Customization API
Image • UIBarButtonItem • UINavigationBar • UISearchBar • UITabBar •
UIToolbar • UIProgressView • UISegmentedControl Karl Bode iOS 5 - UI Customization API
TextAttributes • UIBarItem • UINavigationBar • UISearchBar • UISegmentedControl Karl
Bode iOS 5 - UI Customization API [NSDictionary dictionaryWithObjectsAndKeys: [UIColor whiteColor], UITextAttributeTextColor, nil]];
PositionAdjustment • UIBarButtonItem • UINavigationBar • UISearchBar • UISegmentedControl Karl
Bode iOS 5 - UI Customization API
Proxy-Mechanismus [UISwitch appearance]
• UIAppearance Protokoll • Klassenmethode: appearance • iOS-Runtime liefert Proxy-Instanz
• Styling wird “aufgezeichnet” • Styling wird vor [UIView layoutSubviews] “abgespielt” Proxy-Mechanismus Karl Bode iOS 5 - UI Customization API
• kein Styling in Echtzeit, View muss neu aufgebaut werden
• funktioniert auch mit Subklassen • direktes Styling wird immer bevorzugt Proxy-Mechanismus Karl Bode iOS 5 - UI Customization API
Proxy-Mechanismus ... UISwitch *switchProxy = [UISwitch appearance]; switchProxy.onTintColor = [UIColor
greenColor]; ... Alle Instanzen der Klasse UISwitch anpassen: Karl Bode iOS 5 - UI Customization API
[self showCode]; Karl Bode iOS 5 - UI Customization API
Proxy-Mechanismus ... @interface KBCustomView : UIView<UIAppearance> @property(nonatomic, retain) UIColor* someColor
UI_APPEARANCE_SELECTOR; @end ... Style-Properties werden mit UI_APPEARANCE_SELECTOR markiert: Karl Bode iOS 5 - UI Customization API
[self showCode]; Karl Bode iOS 5 - UI Customization API
Containment • UIAppearanceContainer<NSObject> als Marker-Protokoll • +[id<UIAppearance> whenContainedIn: [Class<UIAppearanceContainer> class],
nil]; • Statement von unten nach oben schreiben Karl Bode iOS 5 - UI Customization API
UIWindow UIView UITabBarViewController UIView KBSecondViewController UIView KBFirstViewController UIView UINavigationController UIView
KBNavigationController UISwitch UISwitch Containment-Hierarchie Karl Bode iOS 5 - UI Customization API
UIWindow UIView UITabBarViewController UIView KBSecondViewController UIView KBFirstViewController UIView UINavigationController UIView
KBNavigationController UISwitch UISwitch Containment-Hierarchie [UISwitch appearance]; Karl Bode iOS 5 - UI Customization API
UIWindow UIView UITabBarViewController UIView KBSecondViewController UIView KBFirstViewController UIView UINavigationController UIView
KBNavigationController UISwitch UISwitch Containment-Hierarchie Karl Bode iOS 5 - UI Customization API
UIWindow UIView UITabBarViewController UIView KBSecondViewController UIView KBFirstViewController UIView UINavigationController UIView
KBNavigationController UISwitch UISwitch Containment-Hierarchie [UISwitch appearanceWhenContainedIn:[KBFirstViewController class], nil]]; Karl Bode iOS 5 - UI Customization API
UIWindow UIView UITabBarViewController UIView KBSecondViewController UIView KBFirstViewController UIView UINavigationController UIView
KBNavigationController UISwitch UISwitch Containment-Hierarchie Karl Bode iOS 5 - UI Customization API
UIWindow UIView UITabBarViewController UIView KBSecondViewController UIView KBFirstViewController UIView UINavigationController UIView
KBNavigationController UISwitch UISwitch Containment-Hierarchie Karl Bode iOS 5 - UI Customization API [UISwitch appearanceWhenContainedIn: [KBSecondViewController class], [KBNavigationController class], nil]];
Containment-Hierarchie • erster eindeutiger Treffer von oben nach unten “gewinnt”
• spezieller vor unspezieller • teilweise müssen z.B. leere Klassen als Marker erstellt werden Karl Bode iOS 5 - UI Customization API
[self showCode]; Karl Bode iOS 5 - UI Customization API
Fazit • neue Properties vereinfachen das Customizing deutlich • reicht
für viele einfache Fälle aus • Containment-Statement könnte ausdrucksstärker sein • Statements unbedingt immer wieder testen! Karl Bode iOS 5 - UI Customization API
Fragen? Karl Bode iOS 5 - UI Customization API @karl_in
[email protected]
Quellen • Customizing the Appearance of UIKit Controls, Chris Parker,
WWDC ’11 • iOS Reference Documentation Karl Bode iOS 5 - UI Customization API