BTUIKViewUtil

Objective-C

@interface BTUIKViewUtil : NSObject

Swift

class BTUIKViewUtil : NSObject

@class Utilities used by other views to get localized strings, a BTUIKPaymentOptionType or artwork

BTUIKPaymentOptionType Utilities

  • Get a BTUIKPaymentOptionType from a string

    Declaration

    Objective-C

    + (BTUIKPaymentOptionType)paymentOptionTypeForPaymentInfoType:
        (NSString *)typeString;

    Swift

    class func paymentOptionType(forPaymentInfoType typeString: String!) -> BTUIKPaymentOptionType

    Parameters

    typeString

    string representing a payment option type (e.g Visa or PayPal)

    Return Value

    The BTUIKPaymentOptionType associated with the string if it can be found. Otherwise, BTUIKPaymentOptionTypeUnknown.

  • Get a BTUIKPaymentOptionType from a BTUIKCardType

    Declaration

    Objective-C

    + (BTUIKPaymentOptionType)paymentMethodTypeForCardType:
        (BTUIKCardType *)cardType;

    Swift

    class func paymentMethodType(for cardType: BTUIKCardType!) -> BTUIKPaymentOptionType

    Parameters

    cardType

    A BTUIKCardType that represents a card

    Return Value

    The BTUIKPaymentOptionType associated with the BTUIKCardType if it can be found. Otherwise, BTUIKPaymentOptionTypeUnknown.

  • Determine if the payment option is a credit card type.

    Declaration

    Objective-C

    + (BOOL)isPaymentOptionTypeACreditCard:
        (BTUIKPaymentOptionType)paymentOptionType;

    Swift

    class func isPaymentOptionTypeACreditCard(_ paymentOptionType: BTUIKPaymentOptionType) -> Bool

    Parameters

    paymentOptionType

    A BTUIKPaymentOptionType

    Return Value

    true if the payment option is a credit card type, false otherwise

  • Get a localized string for a payment option.

    Declaration

    Objective-C

    + (NSString *)nameForPaymentMethodType:
        (BTUIKPaymentOptionType)paymentMethodType;

    Swift

    class func name(forPaymentMethodType paymentMethodType: BTUIKPaymentOptionType) -> String!

    Parameters

    paymentMethodType

    BTUIKPaymentOptionType

    Return Value

    The localized string for the BTUIKPaymentOptionType if one can be found. Card will be returned in the case of BTUIKPaymentOptionTypeUnknown.

Helper Utilities

  • Cause the device to vibrate

    Declaration

    Objective-C

    + (void)vibrate;

    Swift

    class func vibrate()

Art Utilities

Right to Left Utilities

  • Declaration

    Objective-C

    + (BOOL)isLanguageLayoutDirectionRightToLeft;

    Swift

    class func isLanguageLayoutDirectionRightToLeft() -> Bool

    Return Value

    true if the language is right to left

  • Declaration

    Objective-C

    + (NSTextAlignment)naturalTextAlignment;

    Swift

    class func naturalTextAlignment() -> NSTextAlignment

    Return Value

    NSTextAlignmentRight if isLanguageLayoutDirectionRightToLeft is true. Ohterwise NSTextAlignmentLeft.

  • Declaration

    Objective-C

    + (NSTextAlignment)naturalTextAlignmentInverse;

    Swift

    class func naturalTextAlignmentInverse() -> NSTextAlignment

    Return Value

    NSTextAlignmentLeft if isLanguageLayoutDirectionRightToLeft is true. Ohterwise NSTextAlignmentRight.

Orientation Utilities

  • Declaration

    Objective-C

    + (BOOL)isOrientationLandscape;

    Swift

    class func isOrientationLandscape() -> Bool

    Return Value

    true if the device is in landscape

  • Declaration

    Objective-C

    + (CGFloat)statusBarHeight;

    Swift

    class func statusBarHeight() -> CGFloat

    Return Value

    height of the status bar