MBCountry
@objc
public class MBCountry : NSObject, MBLocalizable
Class containing country code for countries and country providers
-
Country code that matches the values found in
NSLocale.isoCountryCode
Declaration
Swift
@objc public let countryCode: String
-
MBCountryProvider
instance represents all the documents that are supported for this countryDeclaration
Swift
@objc public let countryProvider: MBCountryProvider
-
Localized country name based on the country code value
Declaration
Swift
@objc public var localized: String { get }
-
Initializes the country using the current device region code.
Declaration
Swift
@objc public convenience override init()
-
Initialize country using one of the
MBSupportedCountry
enum valuesDeclaration
Swift
@objc public convenience init(supportedCountry: MBSupportedCountry)
Parameters
supportedCountry
supported country
-
Initialize country using a country code
Declaration
Swift
@objc public convenience init(countryCode: String)
Parameters
countryCode
countryCode
-
Intialize country using a country code and country document provider
Declaration
Swift
@objc public required init(countryCode: String, countryProvider: MBCountryProvider)
Parameters
countryCode
country code
countryProvider
country document provider
-
Used to compare
MBCountry
type andMBSupportedCountry
type Needed becauseMBSupportedCountry.countryCode
var inMBSupportedCountry
can’t be exposed to objcDeclaration
Swift
@objc public func isEqual(toSupportedCountry supportedCountry: MBSupportedCountry) -> Bool
Parameters
supportedCountry
MBSupportedCountry
Return Value
true if countryCodes match otherwise false
-
Returns all countries provided by
NSLocale.isoCountryCodes
Declaration
Swift
@objc public class func getAllCountries() -> [MBCountry]
Return Value
all countries defined in NSLocale.isoCountryCodes