FlagKit

Beautiful flag icons for usage in apps and on the web.

Github星跟蹤圖

Header

FlagKit

Beautiful flag icons for usage in apps and on the web. All flags are provided as stand-alone PNG and SVG files. FlagKit also provides an Asset Catalog and framework for easy use on Apple platforms.

Installation (iOS, macOS, tvOS)

FlagKit provides a framework for easy installation as a dependency. You can also manually copy the Asset Catalog into your project.

Carthage

Add the following line to your Cartfile:

github "madebybowtie/FlagKit"

CocoaPods

Add the following line to your Podfile:

pod 'FlagKit'

Manual

Add Assets/FlagKit.xcassets to your target.

Usage (iOS, macOS, tvOS)

FlagKit provides both rectangular unstyled flags and styled flags in a variety of shapes. Our sample project demonstrates how to display flags and customize them into different shapes (rounded corners, square, circle).

Note: Styling is currently not supported by FlagKit on macOS

This brief example loads the flag for the users current locale, and retrieves the unstyled flag and a styled flag:

let countryCode = Locale.current.regionCode!
let flag = Flag(countryCode: countryCode)!

// Retrieve the unstyled image for customized use
let originalImage = flag.originalImage

// Or retrieve a styled flag
let styledImage = flag.image(style: .circle)

You can always access the underlying assets directly, through the bundled Asset Catalog:

let countryCode = Locale.current.regionCode!
let bundle = FlagKit.assetBundle
let originalImage = UIImage(named: countryCode, in: bundle, compatibleWith: nil)

Reference

FlagKit provides over 250 flags. A list of all flags can be found here.

More Info

Have a question? Please open an issue!

License

FlagKit is released under the MIT license. See
LICENSE.

主要指標

概覽
名稱與所有者madebybowtie/FlagKit
主編程語言Swift
編程語言Ruby (語言數: 3)
平台
許可證MIT License
所有者活动
創建於2015-08-19 18:35:42
推送於2024-04-19 11:11:58
最后一次提交2021-05-04 13:24:23
發布數14
最新版本名稱2.4.0 (發布於 )
第一版名稱v1.0 (發布於 )
用户参与
星數3.1k
關注者數53
派生數330
提交數113
已啟用問題?
問題數80
打開的問題數25
拉請求數7
打開的拉請求數7
關閉的拉請求數14
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?