Other Functions

The following functions are available globally.

  • Use the default PTAnalyticsManager to log the given exception.

    See more

    Declaration

    Objective-C

    extern void PTLogException(NSException *_Nonnull exception,
                               NSDictionary<id, id> *_Nullable extraData)

    Swift

    func PTLogException(_ exception: NSException, _ extraData: [AnyHashable : Any]?)

    Parameters

    exception

    the exception to log

    extraData

    extra information to pass along with the exception

  • Converts a CGLineCap enumeration value to the corresponding PTLineCap value.

    See more

    Declaration

    Objective-C

    extern PTLineCap PTLineCapFromCGLineCap(CGLineCap lineCap)

    Swift

    func PTLineCapFromCGLineCap(_ lineCap: CGLineCap) -> PTLineCap

    Parameters

    lineCap

    The value to be converted

    Return Value

    the corresponding PTLineCap value

  • Converts a CGLineJoin enumeration value to the corresponding PTLineJoin value.

    See more

    Declaration

    Objective-C

    extern PTLineJoin PTLineJoinFromCGLineJoin(CGLineJoin lineJoin)

    Swift

    func PTLineJoinFromCGLineJoin(_ lineJoin: CGLineJoin) -> PTLineJoin

    Parameters

    lineJoin

    The value to be converted

    Return Value

    the corresponding PTLineJoin value

  • Returns a localized version of a string, using the Tools bundle.

    See more

    Declaration

    Objective-C

    extern NSString *_Nonnull PTLocalizedString(NSString *_Nonnull key,
                                                NSString *_Nullable comment)

    Swift

    func PTLocalizedString(_ key: String, _ comment: String?) -> String
  • Returns a localized version of a string from the specified table, using the Tools bundle.

    See more

    Declaration

    Objective-C

    extern NSString *_Nonnull PTLocalizedStringFromTable(
        NSString *_Nonnull key, NSString *_Nullable table,
        NSString *_Nullable comment)

    Swift

    func PTLocalizedString(key: String, table: String?, comment: String?) -> String
  • Returns the corresponding non-continuous page presentation mode for the given mode. If the mode is already non-continuous then the input mode is returned.

    See more

    Declaration

    Objective-C

    extern TrnPagePresentationMode
    PTPagePresentationModeGetBaseMode(TrnPagePresentationMode mode)

    Swift

    func PTPagePresentationModeGetBaseMode(_ mode: TrnPagePresentationMode) -> TrnPagePresentationMode

    Parameters

    mode

    the page presentation mode

    Return Value

    the corresponding non-continuous page presentation mode

  • Returns whether the given page presentation mode is continuous.

    See more

    Declaration

    Objective-C

    extern BOOL PTPagePresentationModeIsContinuous(TrnPagePresentationMode mode)

    Swift

    func PTPagePresentationModeIsContinuous(_ mode: TrnPagePresentationMode) -> Bool

    Parameters

    mode

    the page presentation mode

    Return Value

    YES if the page presentation mode is continuous, NO otherwise

  • This function is used to toggle the continuous aspect of a page presentation mode. For the specified page presentation mode, a corresponding mode will be returned with the continuous aspect added or removed according to the continuous parameter.

    See more

    Declaration

    Objective-C

    extern TrnPagePresentationMode
    PTPagePresentationModeGetEffectiveMode(TrnPagePresentationMode mode,
                                           BOOL continuous)

    Swift

    func PTPagePresentationModeGetEffectiveMode(_ mode: TrnPagePresentationMode, _ continuous: Bool) -> TrnPagePresentationMode

    Parameters

    mode

    the page presentation mode

    continuous

    YES if the resulting page presentation mode should be continuous, NO otherwise

    Return Value

    the corresponding page presentation mode with the continuous aspect added or removed according to the continuous parameter.