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

Overview

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.

SwiftPM

Add the folowinig as repository URL:

https://github.com/madebybowtie/FlagKit.git

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.

Comments
  • Deprecated

    Deprecated

    Is there a specific reason you removed the code part and integration with CocoaPods? The changes for Swift 3 are very little (just did this manually to keep it working).

    opened by edwardmp 7
  • Missing Flags for Island Countries and Territories

    Missing Flags for Island Countries and Territories

    Thanks for making FlagKit! I’m incorporating it into an open-source iOS app, and I noticed that the following island countries and territories are missing:

    BV: Bouvet Island CC: Cocos (Keeling) Islands CK: Cook Islands CX: Christmas Island FK: Falkland Islands (Islas Malvinas) GU: Guam HM: Heard & McDonald Islands (just a copy of the Australian national flag) IO: British Indian Ocean Territory MH: Marshall Islands MP: Northern Mariana Islands NF: Norfolk Island PN: Pitcairn Islands UM: United States Minor Outlying Islands (just a copy of the US flag) VI: United States Virgin Islands

    opened by nicolasgomollon 7
  • Flag representing

    Flag representing "North America"

    This is an amazing repo, the flags looks really good.

    I would love to see a flag representing North America. The one with a United States and Canada flag split diagonally.

    Do you accept pull requests by the way?

    North America Flag

    opened by hellozimi 7
  • Carthage build failed, OS X 10.11.6, Xcode 8, Swift 3.

    Carthage build failed, OS X 10.11.6, Xcode 8, Swift 3.

    I'm using FlagKit for macOS project, programming in Swift 3. My system is OS X 10.11.6, platform is Xcode 8, Carthage 0.18. In my Cartfile, I wrote: github "madebybowtie/FlagKit" "swift3"

    When I run "carthage update" in my console, it always failed to build:

    Failed to write to /Users/User/Documents/Projects/Lab/Project/Carthage/Build/Mac/FlagKit.framework: Error Domain=NSCocoaErrorDomain Code=260 "The file “FlagKit.framework” couldn’t be opened because there is no such file." UserInfo={NSFilePath=/Users/User/Documents/Projects/Lab/Project/Carthage/Checkouts/FlagKit/DerivedData/FlagKit/Build/Products/Release-iphoneos/FlagKit.framework, NSUnderlyingError=0x7f89ce1c04f0 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}}

    The 'FlagKit.framework' file actually exist in '/Release' folder, I tried "carthage update --platform Mac" got the same error.

    Looking for help, Thanks a lot.

    opened by aalenliang 6
  • Migrate to Swift 5

    Migrate to Swift 5

    This PR upgrades to Swift 5 and sets recommended Xcode 10.2 settings.

    It would also be nice to get a new release. The reason why I started this PR was that it failed to build on Xcode 10.2 with Carthage since 2.0.1 has SWIFT_VERSION=3.0.

    This error will probably hit quite a few users of this library using carthage like this: github "madebybowtie/FlagKit" "~> 2.0"

    opened by hannseman 5
  • Can't use FlagKit in Objective-C project

    Can't use FlagKit in Objective-C project

    Hi,

    Maybe there's something else going on here, but somehow I can't use FlagKit anymore in my Objective-C project.

    Using [[FKFlag alloc] initWithCountryCode:@"FLAGKIT"] leads to a compiler error claiming that FKFlag does not have any initWithCountryCode initializer.

    Is anyone else experiencing the same issue?

    opened by edwardmp 5
  • Module 'UIKit' not found

    Module 'UIKit' not found

    I'm using FlagKit for macOS project, programming in Swift 3. My system is OS X 10.11.6, platform is Xcode 8, Carthage 0.18. In my Cartfile, I wrote: github "madebybowtie/FlagKit" "swift3"

    After I drag the framework into my project and build after import flagkit, I got two errors said: .../Carthage/Build/Mac/FlagKit.framework/Headers/FlagKit-Swift.h:113:9: Module 'UIKit' not found MyClass.swift:12:8: Could not build Objective-C module 'FlagKit'

    opened by aalenliang 4
  • Support for NSImage

    Support for NSImage

    Create two separated frameworks Add extension to NSImage

    To preserve the API, I needed to use kind of new initialisers (declared in Objective-C). I don’t know if it is the correct way to perform it.

    Any suggestion is welcomed

    opened by yageek 4
  • Please add the flag for Sri Lanka

    Please add the flag for Sri Lanka

    Sorry I can't make a pull request... I don't have sketch not even a mac. Please add the flag for Sri Lanka :

    You can find the original file here : https://commons.wikimedia.org/wiki/File:Flag_of_Sri_Lanka.svg

    flag_of_sri_lanka svg

    opened by THPubs 4
  • :sparkles: Flag class can now instantiate flags regardless of character case

    :sparkles: Flag class can now instantiate flags regardless of character case

    :sparkles: Flag class can now instantiate flags regardless of character cases (uppercase or lowercase). Passed countryCode is also trimmed. :white_check_mark: Added tests :wrench: Updated demo app to use Swift 4 syntax

    opened by cHaLkdusT 3
  • Added 46

    Added 46 "countries"

    • American Samoa
    • Guam
    • Northern Mariana Islands
    • Sint Maarten
    • United States Virgin Islands
    • Guernsey
    • Isle of Man
    • Jersey
    • Svalbard and Jan Mayen Islands
    • Cocos (Keeling) Islands
    • Christmas Island
    • South Sudan
    • Western Sahara
    • British Indian Ocean Territory
    • Ascension Island
    • Zambia
    • Réunion
    • Mayotte
    • Saint Helena
    • Aruba
    • Faroe Islands
    • Greenland
    • Gibraltar
    • Vatican City
    • Falkland Islands
    • Saint-Pierre and Miquelon
    • Guadeloupe
    • Saint Barthélemy
    • Saint Martin
    • French Guiana
    • Martinique
    • Curaçao
    • Bonaire
    • Norfolk Island
    • Nauru
    • Vanuatu
    • Wallis and Futuna
    • Cook Islands
    • Niue
    • Kiribati
    • New Caledonia
    • Tuvalu
    • French Polynesia
    • Tokelau
    • Marshall Islands
    • Palestine
    opened by basvankuijck 3
  • Wrong shape/color of Albania's flag

    Wrong shape/color of Albania's flag

    The flag of Albania in this collection is very wrong, both the shape of the black double-headed eagle as well as the color red in the background.

    For reference, please see https://en.wikipedia.org/wiki/Flag_of_Albania

    opened by bgodole 0
  • Migration to `resource_bundle` from `resource`

    Migration to `resource_bundle` from `resource`

    • Migrated resources to resource_bundle in podspec for allowing build the app with static framework linking
    • Remove 1x icons because there are no devices with this screen resolution supporting iOS 10
    opened by atom-wintermute 0
  • FR: Add placeholder flags for unknown

    FR: Add placeholder flags for unknown

    We can add some flags to represent unknown. Multiple flags are preferred to represent different kind/styles of unknown.

    For example, adding a pirate flag seems cool and useful.

    opened by iceboy233 0
  • Broken Link!

    Broken Link!

    Hi Team, Appreciate the good work however the "sample project" @ https://github.com/madebybowtie/FlagKit/blob/master/Sources/Swift/FlagKitDemo-iOS is a broken link.

    Mind if we could have another link to the sample project for better reference.

    opened by sandeepsauravdas 0
Releases(2.4.0)
  • v2.3.0(Mar 13, 2021)

  • v2.2(Mar 26, 2019)

  • v2.0.1(Aug 22, 2017)

  • v2.0(Aug 9, 2017)

    This is a big release! All flags have been updated, SVG assets have been added, and the iOS/macOS/tvOS framework has been restored and improved.

    Updated flags

    Flags are no longer styled per default. FlagKit 1.0 styled the flags with rounded corners and shadows in the image. FlagKit 2.0 no longer provides that styling per default, instead we provide rectangular flags, allowing you to style them however fits your use case 🎉

    SVG assets

    All flags are now available as SVG assets.

    Framework for Apple platforms

    FlagKit is once again available as a framework for iOS, macOS, and tvOS. It can easily be installed using package managers such as Carthage and CocoaPods.

    ⚠️ FlagKit framework now requires at least iOS 10.0, tvOS 10.0, or macOS 10.10

    The API has changed significantly, because of the changes mentioned above. Flags are now retrieved as a Flag model, which allows you to access flags in different styled options (rounded rect, square, circle). You can also easily access the original styled flag for customizing yourself. See the readme for instructions on how to use the new API.

    A sample project has been created, showing how to list flags and customize the styling of flags in code.

    Project restructure

    • All assets are now grouped per asset type in the Assets folder
    • Source code for the framework and sample project is located in the Source folder
    Source code(tar.gz)
    Source code(zip)
  • v1.1.1(Jul 20, 2016)

  • v1.1(Jun 17, 2016)

  • v1.0.7(Dec 2, 2015)

  • v1.0.5(Oct 26, 2015)

  • v1.0.4(Oct 21, 2015)

  • v1.0.3(Oct 21, 2015)

  • v1.0.2(Oct 14, 2015)

  • v1.0.1(Oct 9, 2015)

  • v1.0(Oct 7, 2015)

Owner
Bowtie
We are Bowtie, an App Creation Studio based in Stockholm.
Bowtie
A set of UIKit helpers that simplify the usage of UIKit view's and controller's in SwiftUI.

A set of UIKit helpers that simplify the usage of UIKit view's and controller's in SwiftUI. Many of these helpers are useful even in a pure UIKit project.

SwiftUI+ 6 Oct 28, 2022
A replacement of default action sheet, but has very simple usage

KPActionSheet A replacement of default action sheet, but has very simple usage. Todo Add more custom affects and styles. Installation CocoaPods KPActi

Kenny 7 Jun 27, 2022
Beautiful animated placeholders for showing loading of data

KALoader Create breautiful animated placeholders for showing loading of data. You can change colors like you want. Swift 4 compatible. Usage To add an

Kirill Avery 105 May 2, 2022
Material, a UI/UX framework for creating beautiful iOS applications

Material Welcome to Material, a UI/UX framework for creating beautiful applications. Material's animation system has been completely reworked to take

Cosmicmind 12k Jan 2, 2023
Custom Beautiful UIView For Handling IDs in iOS

IDView Custom Beautiful UIView For Handling IDs in iOS Setup Set the placeholder images for the front and back faces. override func viewDidLoad()

Omar Labib 6 Aug 21, 2021
A beautiful radar view to show nearby items (users, restaurants, ...) with ripple animation, fully customizable

HGRippleRadarView Example To run the example project, clone the repo, and run pod install from the Example directory first. This project is inspired b

Hamza Ghazouani 352 Dec 4, 2022
Safari Web Extension to customize your search engine.

Safari Web Extension to customize your search engine. Search queries made from the Safari address bar are appended to the custom search engine URL. No

Marvin Häuser 3 Nov 16, 2022
UIPheonix is a super easy, flexible, dynamic and highly scalable UI framework + concept for building reusable component/control-driven apps for macOS, iOS and tvOS

UIPheonix is a super easy, flexible, dynamic and highly scalable UI framework + concept for building reusable component/control-driven apps for macOS, iOS and tvOS

Mohsan Khan 29 Sep 9, 2022
Progress and Activity Indicators for iOS apps

Progress Indicators and Activity Views for iOS Apps Features Storyboard compatible, configure apprearance with the property inspector. fully animated,

Alexander Kasimir 101 Nov 13, 2022
Custom emojis are a fun way to bring more life and customizability to your apps.

Custom emojis are a fun way to bring more life and customizability to your apps. They're available in some of the most popular apps, such as Slack, Di

Stream 244 Dec 11, 2022
Oovium's AetherView and other basic UI elements necessary for embedding Oovium in other apps

Oovium's AetherView and other basic UI elements necessary for embedding Oovium in other apps

Joe Charlier 0 Aug 24, 2022
A simple, customizable view for efficiently collecting country information in iOS apps.

CountryPickerView CountryPickerView is a simple, customizable view for selecting countries in iOS apps. You can clone/download the repository and run

Kizito Nwose 459 Dec 27, 2022
Work in progress gallery of controls available to Catalyst apps using Optimized for Mac

Catalyst Controls Gallery Very simple work-in-progress demonstration of many common controls available to Mac Catalyst as of macOS 11. Provided moreso

Steven Troughton-Smith 163 Sep 18, 2022
Create macOS apps with Swift packages instead of Xcode projects

Swift Bundler A Swift Package Manager wrapper that allows the creation of MacOS apps with Swift packages instead of Xcode projects. My motivation is t

null 182 Dec 25, 2022
It provides UI components such as popover, popup, dialog supporting iOS apps

Overview LCUIComponents is an on-going project, which supports creating transient views appearing above other content onscreen when a control is selec

Linh Chu 7 Apr 8, 2020
Fetch the star wars api from all the planets and list and show details using Swift UI and Combine

Star Wars Planets Fetch the star wars planet data by using stat war api, list and show details using SwiftUI and Combine frameworks ?? Swift UI Framew

null 1 Aug 10, 2022
A custom stretchable header view for UIScrollView or any its subclasses with UIActivityIndicatorView and iPhone X safe area support for content reloading. Built for iOS 10 and later.

Arale A custom stretchable header view for UIScrollView or any its subclasses with UIActivityIndicatorView support for reloading your content. Built f

Putra Z. 43 Feb 4, 2022
🏞 A simple iOS photo and video browser with optional grid view, captions and selections written in Swift5.0

Introduction ?? MediaBrowser can display one or more images or videos by providing either UIImage objects, PHAsset objects, or URLs to library assets,

Kyle Yi 631 Dec 29, 2022
MZFormSheetPresentationController provides an alternative to the native iOS UIModalPresentationFormSheet, adding support for iPhone and additional opportunities to setup UIPresentationController size and feel form sheet.

MZFormSheetPresentationController MZFormSheetPresentationController provides an alternative to the native iOS UIModalPresentationFormSheet, adding sup

Michał Zaborowski 979 Nov 17, 2022