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
Media view which subclasses UIImageView, and can display & load images, videos, GIFs, and audio and from the web, and has functionality to minimize from fullscreen, as well as show GIF previews for videos.

I've built out the Swift version of this library! Screenshots Description ABMediaView can display images, videos, as well as now GIFs and Audio! It su

Andrew Boryk 80 Dec 20, 2022
A beautiful and flexible text field control implementation of "Float Label Pattern". Written in Swift.

SkyFloatingLabelTextField SkyFloatingLabelTextField is a beautiful, flexible and customizable implementation of the space saving "Float Label Pattern"

Skyscanner 4k Jan 3, 2023
An extremely high-performance, lightweight, and energy-efficient pure Swift async web image loader with memory and disk caching for iOS and  Watch.

KFSwiftImageLoader KFSwiftImageLoader is an extremely high-performance, lightweight, and energy-efficient pure Swift async web image loader with memor

Kiavash Faisali 343 Oct 29, 2022
Kingfisher is a powerful, pure-Swift library for downloading and caching images from the web

Kingfisher is a powerful, pure-Swift library for downloading and caching images from the web. It provides you a chance to use a pure-Swift way to work

Wei Wang 20.9k Dec 30, 2022
A smart and easy-to-use image masking and cutout SDK for mobile apps.

TinyCrayon SDK for iOS A smart and easy-to-use image masking and cutout SDK for mobile apps. TinyCrayon SDK provides tools for adding image cutout and

null 1.8k Dec 30, 2022
Generate random user Avatars for apps.

Avatar Generate random user Avatars for apps. Works for iOS 9.3+ Installation Simply install using Cocoapods, add 'pod Avatar' to your podfile Simple

William Vabrinskas 24 Nov 3, 2022
APNGKit is a high performance framework for loading and displaying APNG images in iOS and macOS.

APNGKit is a high performance framework for loading and displaying APNG images in iOS and macOS. It's built on top of a modified version of libpng wit

Wei Wang 2.1k Dec 30, 2022
FMPhotoPicker is a modern, simple and zero-dependency photo picker with an elegant and customizable image editor

FMPhotoPicker is a modern, simple and zero-dependency photo picker with an elegant and customizable image editor Quick demo Batch select/deselect Smoo

Cong Nguyen 648 Dec 27, 2022
✂️ Detect and crop faces, barcodes and texts in image with iOS 11 Vision api.

ImageDetect ImageDetect is a library developed on Swift. With ImageDetect you can easily detect and crop faces, texts or barcodes in your image with i

Arthur Sahakyan 299 Dec 17, 2022
🍁🥓 Lightweight and fast Swift library for image downloading, caching and transformations

MapleBacon Introduction MapleBacon is a lightweight and fast Swift library for downloading and caching images. Example The folder Example contains a s

Jan Gorman 335 Nov 1, 2022
Scan the MRZ code of a passport and extract the firstname, lastname, passport number, nationality, date of birth, expiration date and personal numer.

PassportScanner Works with 2 and 3 line identity documents. What is this With PassportScanner you can use your camera to scan the MRZ code of a passpo

Edwin Vermeer 441 Dec 24, 2022
Image viewer (or Lightbox) with support for local and remote videos and images

Table of Contents Features Focus Browse Rotation Zoom tvOS Setup Installation License Author Features Focus Select an image to enter into lightbox mod

Nes 534 Jan 3, 2023
Backport of SwiftUI.AsyncImage to iOS 14, macOS 11, tvOS 14 and watchOS 7 and earlier.

SBPAsyncImage Backport of SwiftUI.AsyncImage to iOS 14, macOS 11, tvOS 14 and watchOS 7 and earlier. AsyncImage is a view that asynchronously loads an

Yutaro Muta 48 Dec 16, 2022
Lightweight and customisable async image loading in SwiftUI. Supports on-disk storage, placeholders and more!

Asyncrounously download and display images in Swift UI. Supports progress indicators, placeholders and image transitions. RemoteImageView Asyncrounous

Callum Trounce 192 Dec 7, 2022
Jogendra 113 Nov 28, 2022
Photo Browser / Viewer inspired by Facebook's and Tweetbot's with ARC support, swipe-to-dismiss, image progress and more

IDMPhotoBrowser IDMPhotoBrowser is a new implementation based on MWPhotoBrowser. We've added both user experience and technical features inspired by F

Thiago Peres 2.7k Dec 21, 2022
A simple iOS photo and video browser with grid view, captions and selections.

MWPhotoBrowser A simple iOS photo and video browser with optional grid view, captions and selections. MWPhotoBrowser can display one or more images or

Michael Waterfall 8.8k Dec 27, 2022
Twitter Image Pipeline is a robust and performant image loading and caching framework for iOS clients

Twitter Image Pipeline (a.k.a. TIP) Background The Twitter Image Pipeline is a streamlined framework for fetching and storing images in an application

Twitter 1.8k Dec 17, 2022
A simple mesh viewer for MacOS based on Swift and Metal and using Assimp for loading meshes

Metal Mesh Viewer A simple triangle mesh viewer for MacOS This application is a simple (triangle) mesh viewer that should be capable of rendering even

J. Andreas Bærentzen 0 Dec 13, 2021