📜 ⬆️ ⬇️

UIAppearance. Manage the appearance of iOS applications

Style or Essence
Message or Media
Rhetoric or Dialectic

Is beauty something superficial or coming from deep truths?
What does “good design” mean?
Aesthetic judgments are relative or absolute?

These are important questions that have been discussed by philosophers, artists, and poets for millennia.
')
And while we continue our search for beauty and understanding of the world, the market for mobile applications in this area clearly states:

Users pay for beautiful applications.

When buying an iPhone, the user also buys Apple's philosophy: things must not only work well, but also look good. The same applies to the development on iOS - an ugly user interface affects the program code.

Historically, even for a minor change in the appearance of an application in iOS, a set of hacks was required, with the risk of rejecting the application in the AppStore. Fortunately, starting with iOS 5, developers have a new tool: UIAppearance .

UIAppearance allows UIAppearance to uniformly control the style of components throughout an application.

To implement this while preserving the existing UIKit structure, UIKit specialists implemented a rather interesting solution: UIAppearance is a protocol that provides a proxy object that is used to configure objects of a particular class. Why proxy, but not property or method of UIView itself? Because there are objects that are not part of the UIView hierarchy, such as UIBarButtonItem , with their own view. The appearance can be changed for all components of a particular type or only for those linked to a specific hierarchy:

Source: https://habr.com/ru/post/190858/


All Articles