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 country

    Declaration

    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 values

    Declaration

    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 and MBSupportedCountry type Needed because MBSupportedCountry.countryCode var in MBSupportedCountry can’t be exposed to objc

    Declaration

    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