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
PTDocumentTabItem
instance with the specified document source URL.Declaration
Objective-C
- (nonnull instancetype)initWithSourceURL:(nonnull NSURL *)sourceURL;
Swift
convenience init(sourceURL: URL)
Return Value
an initialized
PTDocumentTabItem
instance -
Initializes a newly created
PTDocumentTabItem
instance.Declaration
Objective-C
- (nonnull instancetype)init;
Swift
init()
Return Value
an initialized
PTDocumentTabItem
instance -
Initializes a newly create
PTDocumentTabItem
with an existing instance.Declaration
Objective-C
- (nonnull instancetype)initWithDocumentTabItem: (nonnull PTDocumentTabItem *)item;
Swift
init(documentTabItem item: PTDocumentTabItem)
Parameters
item
the existing
PTDocumentTabItem
instance to copyReturn Value
an initialized
PTDocumentTabItem
instance -
Returns an object initialized from data in a given unarchiver.
Declaration
Objective-C
- (nullable instancetype)initWithCoder:(nonnull NSCoder *)coder;
Swift
init?(coder: NSCoder)
Parameters
coder
An unarchiver object
Return Value
self
, initialized using the data in decoder, ornil
if 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
documentURL
property.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
sourceURL
property.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 thedocumentURL
orsourceURL
is 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.distantPast
until 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 *viewController
Swift
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
headerView
the view to be displayed
animated
YES
if the change should be animated,NO
otherwise