Compare commits
14 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 7b2e6f85f7 | |||
| b40544c0ea | |||
| b4a733f096 | |||
| 0eb5111605 | |||
| 1597c88721 | |||
| fd87cc857a | |||
| 776b5738d6 | |||
| 2960e987b0 | |||
| 4408c2dab3 | |||
| ba7bb956a4 | |||
| eabd1307c8 | |||
| 0daff70461 | |||
| c024e356bf | |||
| e044a46c0e |
@@ -31,3 +31,7 @@ DerivedData
|
||||
# Carthage/Checkouts
|
||||
|
||||
Carthage/Build
|
||||
|
||||
# SPM
|
||||
.swiftpm
|
||||
.build/
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
language: objective-c
|
||||
osx_image: xcode8.3
|
||||
osx_image: xcode10.2
|
||||
|
||||
env:
|
||||
- "DESTINATION='platform=iOS Simulator,name=iPhone 7' ACTION=test"
|
||||
- "DESTINATION='platform=OS X' ACTION=test"
|
||||
- "DESTINATION='platform=tvOS Simulator,name=Apple TV 1080p' ACTION=test"
|
||||
- "DESTINATION='OS=12.2,platform=iOS Simulator,name=iPhone 8' ACTION=test"
|
||||
- "DESTINATION='platform=macOS' ACTION=test"
|
||||
- "DESTINATION='OS=12.2,platform=tvOS Simulator,name=Apple TV' ACTION=test"
|
||||
|
||||
script:
|
||||
- set -o pipefail && xcodebuild -project Sources/Swift/FlagKit.xcodeproj -scheme FlagKit -destination "$DESTINATION" $ACTION | xcpretty
|
||||
- set -o pipefail && xcodebuild -project Sources/FlagKit.xcodeproj -scheme FlagKit -destination "$DESTINATION" $ACTION | xcpretty
|
||||
|
||||
@@ -78,11 +78,11 @@ This set currently includes the 255 flags below:
|
||||
| <img src='PNG/FR@2x.png?raw=true' width='21' height='15'> | FR | France
|
||||
| <img src='PNG/GA@2x.png?raw=true' width='21' height='15'> | GA | Gabon
|
||||
| <img src='PNG/GB@2x.png?raw=true' width='21' height='15'> | GB | United Kingdom
|
||||
| <img src='PNG/GB-ENG@2x.png?raw=true' width='21' height='15'> | GB-ENG | United Kingdom
|
||||
| <img src='PNG/GB-NIR@2x.png?raw=true' width='21' height='15'> | GB-NIR | United Kingdom
|
||||
| <img src='PNG/GB-SCT@2x.png?raw=true' width='21' height='15'> | GB-SCT | United Kingdom
|
||||
| <img src='PNG/GB-WLS@2x.png?raw=true' width='21' height='15'> | GB-WLS | United Kingdom
|
||||
| <img src='PNG/GB-ZET@2x.png?raw=true' width='21' height='15'> | GB-ZET | United Kingdom
|
||||
| <img src='PNG/GB-ENG@2x.png?raw=true' width='21' height='15'> | GB-ENG | England
|
||||
| <img src='PNG/GB-NIR@2x.png?raw=true' width='21' height='15'> | GB-NIR | Northern Ireland
|
||||
| <img src='PNG/GB-SCT@2x.png?raw=true' width='21' height='15'> | GB-SCT | Scotland
|
||||
| <img src='PNG/GB-WLS@2x.png?raw=true' width='21' height='15'> | GB-WLS | Wales
|
||||
| <img src='PNG/GB-ZET@2x.png?raw=true' width='21' height='15'> | GB-ZET | Shetland
|
||||
| <img src='PNG/GD@2x.png?raw=true' width='21' height='15'> | GD | Grenada
|
||||
| <img src='PNG/GE@2x.png?raw=true' width='21' height='15'> | GE | Georgia
|
||||
| <img src='PNG/GF@2x.png?raw=true' width='21' height='15'> | GF | French Guiana
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
Pod::Spec.new do |s|
|
||||
s.name = "FlagKit"
|
||||
s.version = "2.0.1"
|
||||
s.version = "2.3"
|
||||
s.summary = "Beautiful flag icons for usage in apps and on the web."
|
||||
s.swift_versions = ['5.0', '5.1', '5.2', '5.3']
|
||||
|
||||
s.homepage = "https://github.com/madebybowtie/FlagKit"
|
||||
s.license = { :type => "MIT", :file => "LICENSE" }
|
||||
@@ -14,6 +15,6 @@ Pod::Spec.new do |s|
|
||||
s.tvos.deployment_target = "10.0"
|
||||
|
||||
s.source = { :git => "https://github.com/madebybowtie/FlagKit.git", :tag => "v#{s.version}" }
|
||||
s.source_files = "Sources/Swift/FlagKit/*.swift"
|
||||
s.resource = "Assets/FlagKit.xcassets"
|
||||
s.source_files = "Sources/FlagKit/*.swift"
|
||||
s.resource = "Sources/FlagKit/FlagKit.xcassets"
|
||||
end
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
// swift-tools-version:5.3
|
||||
// The swift-tools-version declares the minimum version of Swift required to build this package.
|
||||
|
||||
import PackageDescription
|
||||
|
||||
let package = Package(
|
||||
name: "FlagKit",
|
||||
platforms: [
|
||||
.iOS(.v12),
|
||||
.tvOS(.v12),
|
||||
.macOS(.v10_12)
|
||||
],
|
||||
products: [
|
||||
.library(name: "FlagKit", targets: ["FlagKit"]),
|
||||
],
|
||||
dependencies: [],
|
||||
targets: [
|
||||
.target(
|
||||
name: "FlagKit",
|
||||
dependencies: [],
|
||||
exclude: [
|
||||
"Info.plist",
|
||||
"FlagKitFramework.xcconfig"
|
||||
]
|
||||
),
|
||||
.testTarget(
|
||||
name: "FlagKitTests",
|
||||
dependencies: ["FlagKit"],
|
||||
exclude: [
|
||||
"Info.plist",
|
||||
"FlagKitTests.xcconfig",
|
||||
"ObjectiveCTests.m"
|
||||
]
|
||||
)
|
||||
]
|
||||
)
|
||||
@@ -22,6 +22,13 @@ Beautiful flag icons for usage in apps and on the web. All flags are provided as
|
||||
|
||||
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`:
|
||||
|
||||
|
||||
@@ -67,7 +67,7 @@
|
||||
3A49DD841F2F63F90007E46E /* FlagKit.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FlagKit.h; sourceTree = "<group>"; };
|
||||
3A49DD851F2F63F90007E46E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
3A49DD8A1F2F64BC0007E46E /* FlagKitFramework.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = FlagKitFramework.xcconfig; sourceTree = "<group>"; };
|
||||
3A49DD8D1F2F665E0007E46E /* FlagKit.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = FlagKit.xcassets; path = ../../../Assets/FlagKit.xcassets; sourceTree = "<group>"; };
|
||||
3A49DD8D1F2F665E0007E46E /* FlagKit.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = FlagKit.xcassets; sourceTree = "<group>"; };
|
||||
3A49DD8F1F2F6B760007E46E /* UIImage.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UIImage.swift; sourceTree = "<group>"; };
|
||||
3A49DD921F2F6C1F0007E46E /* FlagKit.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FlagKit.swift; sourceTree = "<group>"; };
|
||||
3A49DD941F2F6F010007E46E /* NSImage.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NSImage.swift; sourceTree = "<group>"; };
|
||||
@@ -260,28 +260,29 @@
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastSwiftUpdateCheck = 0830;
|
||||
LastUpgradeCheck = 0830;
|
||||
LastUpgradeCheck = 1240;
|
||||
ORGANIZATIONNAME = Bowtie;
|
||||
TargetAttributes = {
|
||||
3A49DD801F2F63F90007E46E = {
|
||||
CreatedOnToolsVersion = 8.3.2;
|
||||
LastSwiftMigration = 0830;
|
||||
LastSwiftMigration = 1020;
|
||||
ProvisioningStyle = Automatic;
|
||||
};
|
||||
3A59879C1F306C260097DB64 = {
|
||||
CreatedOnToolsVersion = 8.3.2;
|
||||
LastSwiftMigration = 0830;
|
||||
LastSwiftMigration = 1020;
|
||||
ProvisioningStyle = Automatic;
|
||||
};
|
||||
3AF78CE01F31CE0400BD3D10 = {
|
||||
CreatedOnToolsVersion = 8.3.2;
|
||||
LastSwiftMigration = 1020;
|
||||
ProvisioningStyle = Automatic;
|
||||
};
|
||||
};
|
||||
};
|
||||
buildConfigurationList = 3A49DD5E1F2F62D10007E46E /* Build configuration list for PBXProject "FlagKit" */;
|
||||
compatibilityVersion = "Xcode 3.2";
|
||||
developmentRegion = English;
|
||||
developmentRegion = en;
|
||||
hasScannedForEncodings = 0;
|
||||
knownRegions = (
|
||||
en,
|
||||
@@ -393,12 +394,68 @@
|
||||
3A49DD5F1F2F62D10007E46E /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
|
||||
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_COMMA = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
|
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
ENABLE_TESTABILITY = YES;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
3A49DD601F2F62D10007E46E /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
|
||||
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_COMMA = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
|
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
@@ -453,9 +510,10 @@
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
INFOPLIST_FILE = FlagKit/Info.plist;
|
||||
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks";
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.10;
|
||||
MARKETING_VERSION = 2.3;
|
||||
MTL_ENABLE_DEBUG_INFO = YES;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.madebybowtie.FlagKit;
|
||||
@@ -464,8 +522,8 @@
|
||||
SKIP_INSTALL = YES;
|
||||
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||
SWIFT_VERSION = 3.0;
|
||||
TVOS_DEPLOYMENT_TARGET = 10.0;
|
||||
SWIFT_VERSION = 5.0;
|
||||
TVOS_DEPLOYMENT_TARGET = 12.0;
|
||||
VERSIONING_SYSTEM = "apple-generic";
|
||||
VERSION_INFO_PREFIX = "";
|
||||
};
|
||||
@@ -516,17 +574,18 @@
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
INFOPLIST_FILE = FlagKit/Info.plist;
|
||||
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks";
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.10;
|
||||
MARKETING_VERSION = 2.3;
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.madebybowtie.FlagKit;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SDKROOT = macosx;
|
||||
SKIP_INSTALL = YES;
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
|
||||
SWIFT_VERSION = 3.0;
|
||||
TVOS_DEPLOYMENT_TARGET = 10.0;
|
||||
SWIFT_VERSION = 5.0;
|
||||
TVOS_DEPLOYMENT_TARGET = 12.0;
|
||||
VERSIONING_SYSTEM = "apple-generic";
|
||||
VERSION_INFO_PREFIX = "";
|
||||
};
|
||||
@@ -585,7 +644,7 @@
|
||||
SDKROOT = macosx;
|
||||
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||
SWIFT_VERSION = 3.0;
|
||||
SWIFT_VERSION = 5.0;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
@@ -634,7 +693,7 @@
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SDKROOT = macosx;
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
|
||||
SWIFT_VERSION = 3.0;
|
||||
SWIFT_VERSION = 5.0;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
@@ -683,7 +742,7 @@
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
INFOPLIST_FILE = "FlagKitDemo-iOS/Info.plist";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||
MTL_ENABLE_DEBUG_INFO = YES;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
@@ -692,7 +751,7 @@
|
||||
SDKROOT = iphoneos;
|
||||
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||
SWIFT_VERSION = 3.0;
|
||||
SWIFT_VERSION = 5.0;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
@@ -735,14 +794,14 @@
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
INFOPLIST_FILE = "FlagKitDemo-iOS/Info.plist";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "com.madebybowtie.FlagKitDemo-iOS";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SDKROOT = iphoneos;
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
|
||||
SWIFT_VERSION = 3.0;
|
||||
SWIFT_VERSION = 5.0;
|
||||
VALIDATE_PRODUCT = YES;
|
||||
};
|
||||
name = Release;
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>IDEDidComputeMac32BitWarning</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0830"
|
||||
LastUpgradeVersion = "1240"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
@@ -41,6 +41,15 @@
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "3A49DD801F2F63F90007E46E"
|
||||
BuildableName = "FlagKit.framework"
|
||||
BlueprintName = "FlagKit"
|
||||
ReferencedContainer = "container:FlagKit.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
<Testables>
|
||||
<TestableReference
|
||||
skipped = "NO">
|
||||
@@ -53,17 +62,6 @@
|
||||
</BuildableReference>
|
||||
</TestableReference>
|
||||
</Testables>
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "3A49DD801F2F63F90007E46E"
|
||||
BuildableName = "FlagKit.framework"
|
||||
BlueprintName = "FlagKit"
|
||||
ReferencedContainer = "container:FlagKit.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</TestAction>
|
||||
<LaunchAction
|
||||
buildConfiguration = "Debug"
|
||||
@@ -84,8 +82,6 @@
|
||||
ReferencedContainer = "container:FlagKit.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</LaunchAction>
|
||||
<ProfileAction
|
||||
buildConfiguration = "Release"
|
||||
@@ -15,18 +15,18 @@ public class Flag: NSObject {
|
||||
/**
|
||||
Country code of the flag
|
||||
*/
|
||||
public let countryCode: String
|
||||
@objc public let countryCode: String
|
||||
|
||||
#if os(iOS) || os(tvOS)
|
||||
/**
|
||||
Original unstyled flag image
|
||||
*/
|
||||
public let originalImage: UIImage
|
||||
@objc public let originalImage: UIImage
|
||||
|
||||
/**
|
||||
Returns a flag if the country code is supported, otherwise it returns nil
|
||||
*/
|
||||
public init?(countryCode: String) {
|
||||
@objc public init?(countryCode: String) {
|
||||
guard let image = UIImage(named: countryCode, in: FlagKit.assetBundle, compatibleWith: nil) else {
|
||||
return nil
|
||||
}
|
||||
@@ -39,7 +39,7 @@ public class Flag: NSObject {
|
||||
Returns a styled flag according to the provided style
|
||||
- parameter style: Desired flag style
|
||||
*/
|
||||
public func image(style: FlagStyle) -> UIImage {
|
||||
@objc public func image(style: FlagStyle) -> UIImage {
|
||||
return originalImage.rendereredImage(size: style.size, action: { (context) in
|
||||
switch style {
|
||||
case .none:
|
||||
@@ -60,12 +60,12 @@ public class Flag: NSObject {
|
||||
/**
|
||||
Original unstyled flag image
|
||||
*/
|
||||
public let originalImage: NSImage
|
||||
@objc public let originalImage: NSImage
|
||||
|
||||
/**
|
||||
Returns a flag if the country code is supported, otherwise it returns nil
|
||||
*/
|
||||
public init?(countryCode: String) {
|
||||
@objc public init?(countryCode: String) {
|
||||
guard let image = FlagKit.assetBundle.image(forResource: countryCode) else {
|
||||
return nil
|
||||
}
|
||||
@@ -7,7 +7,11 @@ import Foundation
|
||||
public class FlagKit {
|
||||
public static var assetBundle: Bundle {
|
||||
get {
|
||||
#if SWIFT_PACKAGE
|
||||
return Bundle.module
|
||||
#else
|
||||
return Bundle(for: FlagKit.self)
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 489 B After Width: | Height: | Size: 489 B |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.8 KiB |
|
Before Width: | Height: | Size: 393 B After Width: | Height: | Size: 393 B |
|
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 514 B After Width: | Height: | Size: 514 B |
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 2.7 KiB |
|
Before Width: | Height: | Size: 710 B After Width: | Height: | Size: 710 B |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.2 KiB |
|
Before Width: | Height: | Size: 721 B After Width: | Height: | Size: 721 B |
|
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 4.0 KiB |
|
Before Width: | Height: | Size: 587 B After Width: | Height: | Size: 587 B |
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.8 KiB |
|
Before Width: | Height: | Size: 372 B After Width: | Height: | Size: 372 B |
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.5 KiB |
|
Before Width: | Height: | Size: 488 B After Width: | Height: | Size: 488 B |
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.6 KiB |
|
Before Width: | Height: | Size: 378 B After Width: | Height: | Size: 378 B |
|
Before Width: | Height: | Size: 1020 B After Width: | Height: | Size: 1020 B |
|
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 762 B After Width: | Height: | Size: 762 B |
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 3.5 KiB |
|
Before Width: | Height: | Size: 258 B After Width: | Height: | Size: 258 B |
|
Before Width: | Height: | Size: 693 B After Width: | Height: | Size: 693 B |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 746 B After Width: | Height: | Size: 746 B |
|
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 3.9 KiB |
|
Before Width: | Height: | Size: 512 B After Width: | Height: | Size: 512 B |
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.6 KiB |
|
Before Width: | Height: | Size: 496 B After Width: | Height: | Size: 496 B |
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.5 KiB |
|
Before Width: | Height: | Size: 464 B After Width: | Height: | Size: 464 B |
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.8 KiB |
|
Before Width: | Height: | Size: 680 B After Width: | Height: | Size: 680 B |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.2 KiB |
|
Before Width: | Height: | Size: 554 B After Width: | Height: | Size: 554 B |
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 2.9 KiB |
|
Before Width: | Height: | Size: 552 B After Width: | Height: | Size: 552 B |
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.8 KiB |
|
Before Width: | Height: | Size: 387 B After Width: | Height: | Size: 387 B |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 495 B After Width: | Height: | Size: 495 B |
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.5 KiB |
|
Before Width: | Height: | Size: 351 B After Width: | Height: | Size: 351 B |
|
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
|
Before Width: | Height: | Size: 436 B After Width: | Height: | Size: 436 B |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |