Latest 1.0.0
Homepage https://github.com/gaelfoppolo/UIDefaultFont
License MIT
Platforms ios 10.0
Authors

CI Status
Swift 4
Version
License
Platform
Carthage compatible
Documentation
codecov.io

Replace the system font in the whole app easily

No more wasted time and effort, searching and overriding the font of every displayed string in your app. At runtime, you can change the system font and it will be replaced everywhere it’s used in the application.

This library is simply one extension to UIFont, adding three properties:

  • normalFontName
  • boldFontName
  • italicFontName

Usage

Simply:

UIFont.normalFontName = "Courier"
UIFont.boldFontName = "Noteworthy-Bold"
UIFont.italicFontName = "HelveticaNeue-ThinItalic"

If you want to be notify (to update already displayed labels for example), you can observe these three notifications:

  • normalFontChanged
  • boldFontChanged
  • italicFontChanged
NotificationCenter.default.addObserver(self, selector: #selector(updateNormalFont), name: .normalFontChanged, object: nil)

Requirements

  • Xcode 9.0
  • Swift 4

Swift 3 support is available on the branch swift-3 on this repository.

Installation

CocoaPods

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

pod 'UIDefaultFont'

Carthage

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

github "gaelfoppolo/UIDefaultFont"

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

Swift Pacakge Manager

If you use Swift Pacakage Manager to manage your dependencies, simply add
UIDefaultFont to your Package.swift:

dependencies: [
    .Package(url: "https://github.com/gaelfoppolo/UIDefaultFont.git")
]

Documentation

Full documentation is available on GitHub. You can also install documentation locally using jazzy.

Author

Gaël Foppolo, [email protected]

Contribution and Maintenance

System font available on iOS is surely subject to possible change,
and when it does, this library should still work properly.
If you would like to help maintain or improve this library please feel free to do so.

License

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

Latest podspec

{
    "name": "UIDefaultFont",
    "version": "1.0.0",
    "summary": "Replace the system font in the whole app easily",
    "description": "Replace the system font in the whole app easily.nThis micro libray is simply just a swizzle of the default UIFont method, regarding system font.nWe UIDefaultFont you can replace the default system font with a couple of lines.",
    "homepage": "https://github.com/gaelfoppolo/UIDefaultFont",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Gaeu0308l Foppolo": "[email protected]"
    },
    "social_media_url": "http://twitter.com/gaelugio",
    "platforms": {
        "ios": "10.0"
    },
    "source": {
        "git": "https://github.com/gaelfoppolo/UIDefaultFont.git",
        "tag": "1.0.0"
    },
    "source_files": "Sources/**/*",
    "documentation_url": "https://gaelfoppolo.github.io/UIDefaultFont",
    "pushed_with_swift_version": "4.0"
}

Pin It on Pinterest

Share This