Georges Boumis bfbb5cf4d4 2.20 Decouple AppearanceKit from ContentKit & RepresentationKit
Renders AppearanceKit dependencies on ContentKit & RepresentationKit
optional.

You can now use AppearanceKit without importing ContentKit &
RepresentationKit.

To avoid importing ContentKit & RepresentationKit comment the
dependencies in AppearanceKit.podspec.
2020-04-25 22:48:54 +02:00
2017-09-07 09:52:17 +03:00
2018-03-09 15:29:31 +02:00
2018-09-25 15:46:50 +03:00
2017-09-07 09:52:17 +03:00
2017-09-06 16:53:54 +03:00

AppearanceKit

Change the appearance of UIKit elements, using classes that declaratively describe the appearance.

AppearanceKit values immutability.

AppearanceKit is (optionally) dependent on ContentKit and RepresentationKit. It is recommended to include those dependencies. If you do not want to import them then comment out those dependencies in the AppearanceKit.podspec file.

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

// create an appearance
// by passing values throught the constructor
let appearance = ConfigurableUILabelAppearance(
							textColor: BlackColor(),
							numberOfLines: 3)

// or chaining calls
let appearance = ConfigurableUILabelAppearance()
						.updating(field: .textColor(BlackColor())
						.updating(field: .numberOfLines(3)

// or through a mutable container
var appearance = ConfigurableUILabelAppearance()
appearance.textColor = BlackColor()
apperanace.numberOfLines = 3


let label = // ...
// configure the label with the appearance
appearance.configure(label)

// you can use multiple times the appearance
let label2 = // ...
appearance.configure(label2)

Installation

AppearanceKit is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "AppearanceKit"

Discussion

AppearanceKit provides appearances for:

  • UILabel
  • UITextField
  • UITextView
  • UIButton
  • CALayer (and shadow)

AppearanceKit provides declarative types for:

  • Colors
  • Fonts

Author

Georges Boumis, developer.george.boumis@gmail.com

License

AppearanceKit is available under the Apache 2.0 license. See the LICENSE file for more info.

Description
Change the appearance of UIKit elements
Readme Apache-2.0 754 KiB
Languages
Swift 99.5%
Ruby 0.5%