Skip to content

Instantly share code, notes, and snippets.

@interstateone
Forked from mattt/uiappearance-selector.md
Last active April 7, 2020 14:39
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save interstateone/09e839478bcb8acb5f43a8aaee3cb7a1 to your computer and use it in GitHub Desktop.
Save interstateone/09e839478bcb8acb5f43a8aaee3cb7a1 to your computer and use it in GitHub Desktop.
A list of methods and properties conforming to `UIAppearance` as of iOS 13.4

Generate the list yourself:

$ cd /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS*.sdk/System/Library/Frameworks/UIKit.framework/Headers
$ grep UI_APPEARANCE_SELECTOR ./*     | \
  sed 's/NS_AVAILABLE_IOS(.*)//g'     | \
  sed 's/NS_DEPRECATED_IOS(.*)//g'    | \
  sed 's/API_AVAILABLE(.*)//g'        | \
  sed 's/API_UNAVAILABLE(.*)//g'      | \
  sed 's/UI_APPEARANCE_SELECTOR//g'   | \
  sed 's/__TVOS_PROHIBITED//g'        | \
  sed 's/@property (/@property(/g'    | \
  awk -F"\.h:"                          \
      'BEGIN {
          print "# UIAppearance Selectors\n"
       }
       $1!= header && NR > 1 {
           print "```"
       };
       $1!= header {
           print "\n## " $1 "\n\n```objc"
       };
       header = $1;
       END {
           print "```\n"
       }'                             | \
  sed 's/## .\//## /g'                | \
  sed 's/.*\.h://g'                   | \
  sed 's/[ ]\{2,\}/ /g'               | \
  sed 's/[ ]*;/;/g'                   | \
  sed 's/ \/\/.*$//'

UIAppearance Selectors

UIActivityIndicatorView

@property(null_resettable, readwrite, nonatomic, strong) UIColor *color;

UIAppearance

/* To participate in the appearance proxy API, tag your appearance property selectors in your header with .
#define __attribute__((annotate("ui_appearance_selector")))

UIBarButtonItem

- (void)setBackgroundImage:(nullable UIImage *)backgroundImage forState:(UIControlState)state barMetrics:(UIBarMetrics)barMetrics;
- (nullable UIImage *)backgroundImageForState:(UIControlState)state barMetrics:(UIBarMetrics)barMetrics;
- (void)setBackgroundImage:(nullable UIImage *)backgroundImage forState:(UIControlState)state style:(UIBarButtonItemStyle)style barMetrics:(UIBarMetrics)barMetrics;
- (nullable UIImage *)backgroundImageForState:(UIControlState)state style:(UIBarButtonItemStyle)style barMetrics:(UIBarMetrics)barMetrics;
- (void)setBackgroundVerticalPositionAdjustment:(CGFloat)adjustment forBarMetrics:(UIBarMetrics)barMetrics; 
- (CGFloat)backgroundVerticalPositionAdjustmentForBarMetrics:(UIBarMetrics)barMetrics;
- (void)setTitlePositionAdjustment:(UIOffset)adjustment forBarMetrics:(UIBarMetrics)barMetrics; 
- (UIOffset)titlePositionAdjustmentForBarMetrics:(UIBarMetrics)barMetrics;
- (void)setBackButtonBackgroundImage:(nullable UIImage *)backgroundImage forState:(UIControlState)state barMetrics:(UIBarMetrics)barMetrics;
- (nullable UIImage *)backButtonBackgroundImageForState:(UIControlState)state barMetrics:(UIBarMetrics)barMetrics;
- (void)setBackButtonTitlePositionAdjustment:(UIOffset)adjustment forBarMetrics:(UIBarMetrics)barMetrics;
- (UIOffset)backButtonTitlePositionAdjustmentForBarMetrics:(UIBarMetrics)barMetrics;
- (void)setBackButtonBackgroundVerticalPositionAdjustment:(CGFloat)adjustment forBarMetrics:(UIBarMetrics)barMetrics;
- (CGFloat)backButtonBackgroundVerticalPositionAdjustmentForBarMetrics:(UIBarMetrics)barMetrics;

UIBarItem

- (void)setTitleTextAttributes:(nullable NSDictionary<NSAttributedStringKey,id> *)attributes forState:(UIControlState)state;
- (nullable NSDictionary<NSAttributedStringKey,id> *)titleTextAttributesForState:(UIControlState)state;

UIButton

@property(nonatomic) UIEdgeInsets contentEdgeInsets;
- (void)setTitleColor:(nullable UIColor *)color forState:(UIControlState)state;
- (void)setTitleShadowColor:(nullable UIColor *)color forState:(UIControlState)state;
- (void)setBackgroundImage:(nullable UIImage *)image forState:(UIControlState)state;
- (void)setPreferredSymbolConfiguration:(nullable UIImageSymbolConfiguration *)configuration forImageInState:(UIControlState)state;

UILabel

@property(null_resettable, nonatomic,strong) UIFont *font;
@property(null_resettable, nonatomic,strong) UIColor *textColor;
@property(nullable, nonatomic,strong) UIColor *shadowColor;
@property(nonatomic) CGSize shadowOffset;
@property(nullable, nonatomic,strong) UIColor *highlightedTextColor;

UINavigationBar

@property(nonatomic,assign) UIBarStyle barStyle;
@property(nonatomic,assign,getter=isTranslucent) BOOL translucent;
@property(nonatomic, readwrite, assign) BOOL prefersLargeTitles;
@property(nullable, nonatomic,strong) UIColor *barTintColor;
- (void)setBackgroundImage:(nullable UIImage *)backgroundImage forBarPosition:(UIBarPosition)barPosition barMetrics:(UIBarMetrics)barMetrics;
- (nullable UIImage *)backgroundImageForBarPosition:(UIBarPosition)barPosition barMetrics:(UIBarMetrics)barMetrics;
- (void)setBackgroundImage:(nullable UIImage *)backgroundImage forBarMetrics:(UIBarMetrics)barMetrics;
- (nullable UIImage *)backgroundImageForBarMetrics:(UIBarMetrics)barMetrics;
@property(nullable, nonatomic,strong) UIImage *shadowImage;
@property(nullable,nonatomic,copy) NSDictionary<NSAttributedStringKey, id> *titleTextAttributes;
@property(nullable, nonatomic, copy) NSDictionary<NSAttributedStringKey, id> *largeTitleTextAttributes;
- (void)setTitleVerticalPositionAdjustment:(CGFloat)adjustment forBarMetrics:(UIBarMetrics)barMetrics;
- (CGFloat)titleVerticalPositionAdjustmentForBarMetrics:(UIBarMetrics)barMetrics;
@property(nullable,nonatomic,strong) UIImage *backIndicatorImage;
@property(nullable,nonatomic,strong) UIImage *backIndicatorTransitionMaskImage;
@property(nonatomic, readwrite, copy) UINavigationBarAppearance *standardAppearance;
@property(nonatomic, readwrite, copy, nullable) UINavigationBarAppearance *compactAppearance;
@property(nonatomic, readwrite, copy, nullable) UINavigationBarAppearance *scrollEdgeAppearance;

UIPageControl

@property(nullable, nonatomic,strong) UIColor *pageIndicatorTintColor;
@property(nullable, nonatomic,strong) UIColor *currentPageIndicatorTintColor;

UIProgressView

@property(nonatomic, strong, nullable) UIColor* progressTintColor;
@property(nonatomic, strong, nullable) UIColor* trackTintColor;
@property(nonatomic, strong, nullable) UIImage* progressImage;
@property(nonatomic, strong, nullable) UIImage* trackImage;

UIRefreshControl

@property(nullable, nonatomic, strong) NSAttributedString *attributedTitle;

UISearchBar

@property(nullable, nonatomic,strong) UIColor *barTintColor;
@property(nullable, nonatomic,strong) UIImage *backgroundImage;
@property(nullable, nonatomic,strong) UIImage *scopeBarBackgroundImage;
- (void)setBackgroundImage:(nullable UIImage *)backgroundImage forBarPosition:(UIBarPosition)barPosition barMetrics:(UIBarMetrics)barMetrics;
- (nullable UIImage *)backgroundImageForBarPosition:(UIBarPosition)barPosition barMetrics:(UIBarMetrics)barMetrics;
- (void)setSearchFieldBackgroundImage:(nullable UIImage *)backgroundImage forState:(UIControlState)state;
- (nullable UIImage *)searchFieldBackgroundImageForState:(UIControlState)state;
- (void)setImage:(nullable UIImage *)iconImage forSearchBarIcon:(UISearchBarIcon)icon state:(UIControlState)state;
- (nullable UIImage *)imageForSearchBarIcon:(UISearchBarIcon)icon state:(UIControlState)state;
- (void)setScopeBarButtonBackgroundImage:(nullable UIImage *)backgroundImage forState:(UIControlState)state; 
- (nullable UIImage *)scopeBarButtonBackgroundImageForState:(UIControlState)state;
- (void)setScopeBarButtonDividerImage:(nullable UIImage *)dividerImage forLeftSegmentState:(UIControlState)leftState rightSegmentState:(UIControlState)rightState;
- (nullable UIImage *)scopeBarButtonDividerImageForLeftSegmentState:(UIControlState)leftState rightSegmentState:(UIControlState)rightState;
- (void)setScopeBarButtonTitleTextAttributes:(nullable NSDictionary<NSAttributedStringKey,id> *)attributes forState:(UIControlState)state;
- (nullable NSDictionary<NSAttributedStringKey, id> *)scopeBarButtonTitleTextAttributesForState:(UIControlState)state;
@property(nonatomic) UIOffset searchFieldBackgroundPositionAdjustment;
@property(nonatomic) UIOffset searchTextPositionAdjustment;
- (void)setPositionAdjustment:(UIOffset)adjustment forSearchBarIcon:(UISearchBarIcon)icon;
- (UIOffset)positionAdjustmentForSearchBarIcon:(UISearchBarIcon)icon;

UISegmentedControl

@property(nullable, nonatomic, strong) UIColor *selectedSegmentTintColor;
- (void)setBackgroundImage:(nullable UIImage *)backgroundImage forState:(UIControlState)state barMetrics:(UIBarMetrics)barMetrics; 
- (nullable UIImage *)backgroundImageForState:(UIControlState)state barMetrics:(UIBarMetrics)barMetrics;
- (void)setDividerImage:(nullable UIImage *)dividerImage forLeftSegmentState:(UIControlState)leftState rightSegmentState:(UIControlState)rightState barMetrics:(UIBarMetrics)barMetrics;
- (nullable UIImage *)dividerImageForLeftSegmentState:(UIControlState)leftState rightSegmentState:(UIControlState)rightState barMetrics:(UIBarMetrics)barMetrics;
- (void)setTitleTextAttributes:(nullable NSDictionary<NSAttributedStringKey,id> *)attributes forState:(UIControlState)state;
- (nullable NSDictionary<NSAttributedStringKey,id> *)titleTextAttributesForState:(UIControlState)state;
- (void)setContentPositionAdjustment:(UIOffset)adjustment forSegmentType:(UISegmentedControlSegment)leftCenterRightOrAlone barMetrics:(UIBarMetrics)barMetrics; 
- (UIOffset)contentPositionAdjustmentForSegmentType:(UISegmentedControlSegment)leftCenterRightOrAlone barMetrics:(UIBarMetrics)barMetrics;

UISlider

@property(nullable, nonatomic,strong) UIColor *minimumTrackTintColor;
@property(nullable, nonatomic,strong) UIColor *maximumTrackTintColor;
@property(nullable, nonatomic,strong) UIColor *thumbTintColor;

UIStepper

- (void)setBackgroundImage:(nullable UIImage*)image forState:(UIControlState)state;
- (nullable UIImage*)backgroundImageForState:(UIControlState)state;
- (void)setDividerImage:(nullable UIImage*)image forLeftSegmentState:(UIControlState)leftState rightSegmentState:(UIControlState)rightState;
- (nullable UIImage*)dividerImageForLeftSegmentState:(UIControlState)state rightSegmentState:(UIControlState)state;
- (void)setIncrementImage:(nullable UIImage *)image forState:(UIControlState)state;
- (nullable UIImage *)incrementImageForState:(UIControlState)state;
- (void)setDecrementImage:(nullable UIImage *)image forState:(UIControlState)state;
- (nullable UIImage *)decrementImageForState:(UIControlState)state;

UISwitch

@property(nullable, nonatomic, strong) UIColor *onTintColor;
@property(nullable, nonatomic, strong) UIColor *thumbTintColor;
@property(nullable, nonatomic, strong) UIImage *onImage;
@property(nullable, nonatomic, strong) UIImage *offImage;

UITabBar

@property(nullable, nonatomic, strong) UIColor *barTintColor;
@property(nonatomic, readwrite, copy, nullable) UIColor *unselectedItemTintColor;
@property(nullable, nonatomic, strong) UIColor *selectedImageTintColor API_DEPRECATED_WITH_REPLACEMENT("tintColor", ios(5.0, 8.0));
@property(nullable, nonatomic, strong) UIImage *backgroundImage;
@property(nullable, nonatomic, strong) UIImage *selectionIndicatorImage;
@property(nullable, nonatomic, strong) UIImage *shadowImage;
@property(nonatomic) UITabBarItemPositioning itemPositioning;
@property(nonatomic) CGFloat itemWidth;
@property(nonatomic) CGFloat itemSpacing;
@property(nonatomic) UIBarStyle barStyle;
@property(nonatomic, readwrite, copy) UITabBarAppearance *standardAppearance;

UITabBarItem

@property(nonatomic, readwrite, assign) UIOffset titlePositionAdjustment;
@property(nonatomic, readwrite, copy, nullable) UIColor *badgeColor;
- (void)setBadgeTextAttributes:(nullable NSDictionary<NSAttributedStringKey,id> *)textAttributes forState:(UIControlState)state;
- (nullable NSDictionary<NSAttributedStringKey,id> *)badgeTextAttributesForState:(UIControlState)state;
@property(nonatomic, readwrite, copy, nullable) UITabBarAppearance *standardAppearance;

UITableView

@property(nonatomic) UIEdgeInsets separatorInset;
@property(nonatomic, strong, nullable) UIColor *sectionIndexColor;
@property(nonatomic, strong, nullable) UIColor *sectionIndexBackgroundColor;
@property(nonatomic, strong, nullable) UIColor *sectionIndexTrackingBackgroundColor;
@property(nonatomic, strong, nullable) UIColor *separatorColor;
@property(nonatomic, copy, nullable) UIVisualEffect *separatorEffect;

UITableViewCell

@property(nonatomic) UIEdgeInsets separatorInset;
@property(nonatomic) UITableViewCellFocusStyle focusStyle;

UIToolbar

@property(nonatomic) UIBarStyle barStyle;
@property(nonatomic,assign,getter=isTranslucent) BOOL translucent;
@property(nullable, nonatomic, strong) UIColor *barTintColor;
- (void)setBackgroundImage:(nullable UIImage *)backgroundImage forToolbarPosition:(UIBarPosition)topOrBottom barMetrics:(UIBarMetrics)barMetrics;
- (nullable UIImage *)backgroundImageForToolbarPosition:(UIBarPosition)topOrBottom barMetrics:(UIBarMetrics)barMetrics;
- (void)setShadowImage:(nullable UIImage *)shadowImage forToolbarPosition:(UIBarPosition)topOrBottom;
- (nullable UIImage *)shadowImageForToolbarPosition:(UIBarPosition)topOrBottom;
@property(nonatomic, readwrite, copy) UIToolbarAppearance *standardAppearance;
@property(nonatomic, readwrite, copy, nullable) UIToolbarAppearance *compactAppearance;

UIView

@property(nullable, nonatomic,copy) UIColor *backgroundColor;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment