AdmiralUIResources - admiral-team/admiralui-ios GitHub Wiki

Overview

A set of icons and fonts used in the AdmiralUIKit and AdmiralSwiftUI libraries. You can also use the AdmiralUIResources library separately in your project.

Font

AdmiralUIResources uses the San Francisco Font You can read more about it on the website https://developer.apple.com/fonts

Before using the library fonts, you need to register the fonts in the AppDelegate class in the didFinishLaunchingWithOptions function.

Example:

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
        FontFamily.registerAllCustomFonts()
        return true
    }

For the convenience of using font styles, access is implemented through the public enum FontFamily

Example of using Fonts for UIKit

import UIKit
import AdmiralUIResources

class ViewController: UIViewController {

    @IBOutlet weak var lable: UILabel!
    @IBOutlet weak var icon: UIImageView!
    
    override func viewDidLoad() {
        super.viewDidLoad()
        lable.font = AdmiralUIResources.FontFamily.SFProText.medium.font(size: 26)
        icon.image = AdmiralUIResources.Asset.Service.Outline.checkOutline.image
    }
}

Example of using Fonts for SwiftUI

struct ContentView: View {
    var body: some View {
        Text("Hello, world!")
           .font(SwiftUI.Font(AdmiralUIResources.FontFamily.SFProText.medium.font(size: 26)))
    }
}

Asset & Symbols

There are two types of images in the AdmiralUIResources library: Images and Symbols Images - standard sets of icon images in pdf format Symbols - icons of the SFSymbols format, can be integrated into the San Francisco Font. The image depends on the font size and font style.

All icons are presented in two types Outline and Solid Images are divided into thematic sections:

System Icons: A set of icons that are used to indicate basic actions, such as editing, deleting, personal account, navigation interface elements and more.

Service Icons: A set of icons that are used to indicate statuses, informers, signs.

Category Icons: A set of icons that are used to denote various categories often encountered when working with online services, such as ATMs, PFMs, graphic signs and more.

Documents Icons: A set of icons that are used to indicate different types of documents, document formats and signatures.

Security Icons: A set of icons that are used to indicate data security elements, such as PIN codes, passwords and keys.

Finance Icons: A set of icons that are used to indicate currencies, accounts, bank cards.

Communication Icons: A set of icons that are used to indicate communication elements.

Location Icons: A set of icons that are used to indicate locations, maps, and addresses.

Redact Icons: A set of icons that are used to designate editing tools for documents, texts and tables.

For the convenience of using Asset & Symbols, access is implemented through the public enum Assets and enum AssetSymbol. The enum is generated using SwiftGen. Learn more https://github.com/SwiftGen/SwiftGen

Example of using Images in UIKit

import UIKit
import AdmiralUIResources

class ViewController: UIViewController {

    @IBOutlet weak var lable: UILabel!
    @IBOutlet weak var icon: UIImageView!
    
    override func viewDidLoad() {
        super.viewDidLoad()
        lable.font = AdmiralUIResources.FontFamily.SFProText.medium.font(size: 26)
        icon.image = AdmiralUIResources.Asset.Service.Outline.checkOutline.image
    }
    
}

Example of using Symbols in SwiftUI

struct ContentView: View {
    var body: some View {
        HStack {
            Text("Hello, world!")
                .font(SwiftUI.Font(AdmiralUIResources.FontFamily.SFProText.medium.font(size: 26)))
            AdmiralUIResources.AssetSymbol.Service.Outline.check.image
                .font(.system(size: 22))
                .foregroundColor(.blue)
        }
    }
}