Other Functions
The following functions are available globally.
-
Returns the extended annotation type for the given name.
Declaration
Objective-C
extern PTExtendedAnnotType PTExtendedAnnotTypeFromName(PTExtendedAnnotName _Nullable name)
Swift
func PTExtendedAnnotTypeFromName(_ name: PTExtendedAnnotName?) -> PTExtendedAnnotType
Parameters
name
the annotation type name
Return Value
the corresponding extended annotation type, or
PTExtendedAnnotTypeUnknown
if the name is not known -
Returns the annotation name for the given extended annotation type.
Declaration
Objective-C
extern PTExtendedAnnotName _Nullable PTExtendedAnnotNameFromType( PTExtendedAnnotType type)
Swift
func PTExtendedAnnotNameFromType(_ type: PTExtendedAnnotType) -> PTExtendedAnnotName?
Parameters
type
the extended annotation type
Return Value
the corresponding annotation name, or
nil
if the annotation type is not known -
Returns a localized display name for the given extended annotation type.
Declaration
Objective-C
extern NSString *_Nullable PTLocalizedAnnotationNameFromType( PTExtendedAnnotType type)
Swift
func PTLocalizedAnnotationNameFromType(_ type: PTExtendedAnnotType) -> String?
Parameters
type
the extended annotation type
Return Value
the localized display name, or
nil
if the annotation type is not known
-
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
otherwiseReturn 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