PTTabbedDocumentViewControllerDelegate
@protocol PTTabbedDocumentViewControllerDelegate <NSObject>
The methods declared by the PTTabbedDocumentViewControllerDelegate protocol allow the adopting delegate
to respond to messages from the PTTabbedDocumentViewController
class.
-
This method is called when the tabbed document view controller is opening the document at the specified URL and needs to create a new document view controller for the tab. The delegate must create and return a new instance of a
PTDocumentBaseViewController
subclass.If this method is not implemented by the delegate, an instance of the class specified by the
PTTabbedDocumentViewController.viewControllerClass
will be created.Declaration
Objective-C
- (nonnull __kindof PTDocumentBaseViewController *) tabbedDocumentViewController: (nonnull PTTabbedDocumentViewController *) tabbedDocumentViewController createViewControllerForDocumentAtURL:(nonnull NSURL *)url;
Swift
optional func tabbedDocumentViewController(_ tabbedDocumentViewController: PTTabbedDocumentViewController, createViewControllerForDocumentAt url: URL) -> PTDocumentBaseViewController
-
Informs the delegate that a document view controller will be added. This provides an opportunity to perform any setup on the view controller before it is presented to the user.
Declaration
Objective-C
- (void) tabbedDocumentViewController: (nonnull PTTabbedDocumentViewController *)tabbedDocumentViewController willAddDocumentViewController: (nonnull __kindof PTDocumentBaseViewController *)documentViewController;
Swift
optional func tabbedDocumentViewController(_ tabbedDocumentViewController: PTTabbedDocumentViewController, willAddDocumentViewController documentViewController: PTDocumentBaseViewController)
-
Informs the delegate that a tab will be removed from the tabbed document view controller.
Declaration
Objective-C
- (void)tabbedDocumentViewController:(nonnull PTTabbedDocumentViewController *) tabbedDocumentViewController willRemoveTabAtIndex:(NSUInteger)index;
Swift
optional func tabbedDocumentViewController(_ tabbedDocumentViewController: PTTabbedDocumentViewController, willRemoveTabAt index: UInt)
-
Informs the delegate that a tab has been removed.
Declaration
Objective-C
- (void)tabbedDocumentViewController:(nonnull PTTabbedDocumentViewController *) tabbedDocumentViewController didRemoveTab:(nonnull PTDocumentTabItem *)tab atIndex:(NSUInteger)index;
Swift
optional func tabbedDocumentViewController(_ tabbedDocumentViewController: PTTabbedDocumentViewController, didRemoveTab tab: PTDocumentTabItem, at index: UInt)
Parameters
tabbedDocumentViewController
The tabbed document view controller.
tab
The tab object that was removed.
index
The index of the tab.
-
This method allows the delegate to decide if the tab bar should be hidden for the given trait collection.
If this method is not implemented, the tab bar will be hidden for compact horizontal size classes.
Declaration
Objective-C
- (BOOL)tabbedDocumentViewController:(nonnull PTTabbedDocumentViewController *) tabbedDocumentViewController shouldHideTabBarForTraitCollection: (nonnull UITraitCollection *)traitCollection;
Swift
optional func tabbedDocumentViewController(_ tabbedDocumentViewController: PTTabbedDocumentViewController, shouldHideTabBarFor traitCollection: UITraitCollection) -> Bool