ProductPromotion
Logo

Swift

made by https://0x3d.site

GitHub - Nirma/UIFontComplete: Font management (System & Custom) for iOS and tvOS
Font management (System & Custom) for iOS and tvOS - Nirma/UIFontComplete
Visit Site

GitHub - Nirma/UIFontComplete: Font management (System & Custom) for iOS and tvOS

GitHub - Nirma/UIFontComplete: Font management (System & Custom) for iOS and tvOS

UIFontComplete

Build Status Swift 5.0 platforms CodeCov CocoaPods compatible Carthage compatible Swift Package Manager compatible License

Font management (System & Custom) for iOS and tvOS

Usage

No more wasted time searching for names of UIFont fonts and no more surprises at runtime if a font name was mistyped. This library is simply one extension to UIFont and one Font enum with a case for each system font on iOS and tvOS. Custom font support is also available, please keep reading for details!

Instead of using the String based constructor native to 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:

This library currently provides two different options for creating UIFont objects. The first is calling the font name off of the provided BuiltInFont enumeration and then calling of(size:) to provide the desired size.

let myFont: UIFont? = BuiltInFont.helvetica.of(size: 12.0)

The other UIFont creation method offered by this library is similar to the normal UIFont constructor except that instead of providing a String of the desired font, a case of the Font enum is provided instead.

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

What about Custom Fonts?

Custom Fonts can be added with the help of the FontRepresentable protocol. Simply create your own CustomFont String based enumeration that adapts the FontRepresentable and add a case per font that you want to add like so:

// In your project using custom fonts

enum CustomFont: String, FontRepresentable {
    case alexBrushRegular = "AlexBrush-Regular"
}

CustomFont.alexBrushRegular.of(size: 12.0) // => UIFont

SwiftUI support

SwiftUI Font is handled in a same way as UIKit UIFont.

You can do both:

let myFont: Font = BuiltInFont.helvetica.of(size: 12.0)
let font = Font(font: .arialBoldItalicMT, 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'

Swift Package Manager

In Xcode, select File > Add Packages, then copy-paste the URL for this repository to the search field and hit the "Add Package" button.

Requirements

  • Xcode 9.0
  • Swift 4.0+

Contributing to UIFontComplete

Pull Requests are Welcome! If you feel that this library could be made better then please do so by sending over a pull request!

License

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

More Resources
to explore the angular.

mail [email protected] to add your project or resources here ๐Ÿ”ฅ.

Related Articles
to learn about angular.

FAQ's
to learn more about Angular JS.

mail [email protected] to add more queries here ๐Ÿ”.

More Sites
to check out once you're finished browsing here.

0x3d
https://www.0x3d.site/
0x3d is designed for aggregating information.
NodeJS
https://nodejs.0x3d.site/
NodeJS Online Directory
Cross Platform
https://cross-platform.0x3d.site/
Cross Platform Online Directory
Open Source
https://open-source.0x3d.site/
Open Source Online Directory
Analytics
https://analytics.0x3d.site/
Analytics Online Directory
JavaScript
https://javascript.0x3d.site/
JavaScript Online Directory
GoLang
https://golang.0x3d.site/
GoLang Online Directory
Python
https://python.0x3d.site/
Python Online Directory
Swift
https://swift.0x3d.site/
Swift Online Directory
Rust
https://rust.0x3d.site/
Rust Online Directory
Scala
https://scala.0x3d.site/
Scala Online Directory
Ruby
https://ruby.0x3d.site/
Ruby Online Directory
Clojure
https://clojure.0x3d.site/
Clojure Online Directory
Elixir
https://elixir.0x3d.site/
Elixir Online Directory
Elm
https://elm.0x3d.site/
Elm Online Directory
Lua
https://lua.0x3d.site/
Lua Online Directory
C Programming
https://c-programming.0x3d.site/
C Programming Online Directory
C++ Programming
https://cpp-programming.0x3d.site/
C++ Programming Online Directory
R Programming
https://r-programming.0x3d.site/
R Programming Online Directory
Perl
https://perl.0x3d.site/
Perl Online Directory
Java
https://java.0x3d.site/
Java Online Directory
Kotlin
https://kotlin.0x3d.site/
Kotlin Online Directory
PHP
https://php.0x3d.site/
PHP Online Directory
React JS
https://react.0x3d.site/
React JS Online Directory
Angular
https://angular.0x3d.site/
Angular JS Online Directory