Skip to content

Make working with UIFont faster and less error-prone.

License

Notifications You must be signed in to change notification settings

nlory-ma/UIFontComplete

 
 

Repository files navigation

UIFontComplete

Build Status Swift 3.1.0 CodeCov CocoaPods compatible CocoaPods Carthage compatible License

Make working with UIFont faster and less error-prone

Usage

This library is simply one extension to UIFont and one Font enum with a case for each standard installed font on iOS. No more muddling around searching for names of UIFont types and no more surprises at runtime if a font name was mistyped.

Instead of the String base constructor for UIFont:

let font = UIFont(name: "Arial-BoldItalicMT", size: 12.0)

You can now simply start typing the name of the font enum and let code completion help you:

let font = UIFont(font: .arialBoldItalicMT, size: 12.0)

There is also a handy (and way cooler) extension to the Font enumeration that allows the creation of UIFont objects with a certain size like so:

let myFont = Font.helvetica.of(size: 12.0)

Installation

Carthage

If you use Carthage to manage your dependencies, simply add UIFontComplete to your Cartfile:

github "Nirma/UIFontComplete"

If you use Carthage to build your dependencies, make sure you have added UIFontComplete.framework to the "Linked Frameworks and Libraries" section of your target, and have included UIFontComplete.framework in your Carthage framework copying build phase.

CocoaPods

If you use CocoaPods to manage your dependencies, simply add UIFontComplete to your Podfile:

pod 'UIFontComplete'

Requirements

  • Xcode 8.0
  • Swift 3.0+

Contribution and Maintenance

Fonts available on iOS are surely subject to possible change, and when they do the Font enum in this library will need to be updated as well. If you would like to help maintain or improve this library please feel free to do so.

License

UIFontComplete is free software, and may be redistributed under the terms specified in the LICENSE file.

About

Make working with UIFont faster and less error-prone.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Swift 97.7%
  • Ruby 1.5%
  • Objective-C 0.8%