PTDocumentTabItem
@interface PTDocumentTabItem : NSObject <NSSecureCoding, NSCopying>
A PTDocumentTabItem represents a document in a tabbed user interface, where the
document is displayed in a PTDocumentBaseViewController subclass.
-
Initializes a newly created
PTDocumentTabIteminstance with the specified document source URL.Declaration
Objective-C
- (nonnull instancetype)initWithSourceURL:(nonnull NSURL *)sourceURL;Swift
convenience init(sourceURL: URL)Return Value
an initialized
PTDocumentTabIteminstance -
Initializes a newly created
PTDocumentTabIteminstance.Declaration
Objective-C
- (nonnull instancetype)init;Swift
init()Return Value
an initialized
PTDocumentTabIteminstance -
Initializes a newly create
PTDocumentTabItemwith an existing instance.Declaration
Objective-C
- (nonnull instancetype)initWithDocumentTabItem: (nonnull PTDocumentTabItem *)item;Swift
init(documentTabItem item: PTDocumentTabItem)Parameters
itemthe existing
PTDocumentTabIteminstance to copyReturn Value
an initialized
PTDocumentTabIteminstance -
Returns an object initialized from data in a given unarchiver.
Declaration
Objective-C
- (nullable instancetype)initWithCoder:(nonnull NSCoder *)coder;Swift
init?(coder: NSCoder)Parameters
coderAn unarchiver object
Return Value
self, initialized using the data in decoder, ornilif the object could not be initialized -
The original source URL of the document.
For non-file URLs (eg. HTTP(S) scheme URLs) or documents that require conversion before being displayed, this property will be different from the
documentURLproperty.Declaration
Objective-C
@property (nonatomic, strong, nullable) NSURL *sourceURL;Swift
var sourceURL: URL? { get set } -
The file URL of the document displayed in the
viewController.For non-file URLs (eg. HTTP(S) scheme URLs) or documents that require conversion before being displayed, this URL will be different from the
sourceURLproperty.Declaration
Objective-C
@property (nonatomic, strong, nullable) NSURL *documentURL;Swift
var documentURL: URL? { get set } -
The title to be displayed for this tab. When this property is
nil, the last path component of thedocumentURLorsourceURLis used for the title of this tab.The default value of this property is
nil.Declaration
Objective-C
@property (nonatomic, copy, nullable) NSString *displayName;Swift
var displayName: String? { get set } -
The time and date that this tab was last accessed.
The default value of this property is
NSDate.distantPastuntil the tab item is accessed for the first time.Declaration
Objective-C
@property (nonatomic, strong) NSDate *_Nonnull lastAccessedDate;Swift
var lastAccessedDate: Date { get set } -
Undocumented
Declaration
Objective-C
@property (nonatomic, weak, nullable) __kindof PTDocumentBaseViewController *viewControllerSwift
weak var viewController: PTDocumentBaseViewController? { get set }
-
The view to be displayed above any tabbed user interface when this tab item is selected.
The default value of this property is
nil.Declaration
Objective-C
@property (nonatomic, strong, nullable) UIView *headerView;Swift
var headerView: UIView? { get set } -
Sets the view to be displayed above any tabbed user interface when this tab item is selected, optionally animating the change.
Declaration
Objective-C
- (void)setHeaderView:(nullable UIView *)headerView animated:(BOOL)animated;Swift
func setHeaderView(_ headerView: UIView?, animated: Bool)Parameters
headerViewthe view to be displayed
animatedYESif the change should be animated,NOotherwise
PTDocumentTabItem Class Reference