Search code examples
iphoneiosuikituiappearance

Definitive list of classes that support the UIKit UIAppearance protocol


I'm looking for a complete list of classes that support the UIAppearance protocol. I have not been able to find one. I'm open to suggestions for how to programmatically generate such a list (which I have given a tiny bit of thought to already).


Solution

  • This is not a definitive or complete list, but of course minutes after posting the question (by following a link to this related question), I find this weblink:

    http://blog.mosheberman.com/list-of-classes-that-support-uiappearance-in-ios-5/

    There the poster used a grep command (grep -r UI_APPEARANCE_SELECTOR ./ > ~/Desktop/UI_APPEARANCE.txt) to dump out all the classes that have UI_APPEARANCE_SELECTOR in a method prototype. The list they came up with is as follows:

    • UIActivityIndicatorView.h
    • UIBarButtonItem.h
    • UIBarItem.h
    • UINavigationBar.h
    • UIProgressView.h
    • UISearchBar.h
    • UISegmentedControl.h
    • UISlider.h
    • UISwitch.h
    • UITabBar.h
    • UITabBarItem.h
    • UIToolbar.h

    Of course, this doesn't include classes that subclass those listed above. Also, the poster mentions UIView, which definitely implements the protocol, but doesn't have any methods marked with UI_APPEARANCE_SELECTOR. I wonder if a more complete list could be created by grepping for UIAppearance.

    Here is another related question: iOS 5: Curious about UIAppearance