Other Functions

The following functions are available globally.

  • Use the default PTAnalyticsManager to log the given exception.

    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

  • 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.

    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.

    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.

    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.

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

    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 PTTools.toolsBundle bundle.

    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