PSPDFContainerViewController
Objective-C
@interface PSPDFContainerViewController
: PSPDFBaseViewController <PSPDFStyleable, PSPDFOverridable>
Swift
class ContainerViewController : PDFBaseViewController, Styleable, Overridable
Similar to UITabBarController
but using a segmented control at the top to switch between child view controllers.
-
Convenience initializer.
Note
Controllers contained in thePSPDFContainerViewController
must not change theirnavigationItem
‘s bar button items.Declaration
Objective-C
- (nonnull instancetype) initWithControllers: (nullable NSArray<__kindof UIViewController *> *)controllers titles:(nullable NSArray<NSString *> *)titles;
Swift
init(controllers: [UIViewController]?, titles: [String]?)
-
The container controller delegate, notifies when the index changes.
Declaration
Objective-C
@property (nonatomic, weak) id<PSPDFContainerViewControllerDelegate> _Nullable delegate;
Swift
@IBOutlet weak var delegate: ContainerViewControllerDelegate? { get set }
-
Add view controller to the list.
Note
Uses the default controller title. Controller should not change it’s navigationItem’s bar button items.Declaration
Objective-C
- (void)addViewController:(nonnull UIViewController *)controller;
Swift
func addViewController(_ controller: UIViewController)
-
Remove view controller from the list.
Declaration
Objective-C
- (void)removeViewController:(nonnull UIViewController *)controller;
Swift
func removeViewController(_ controller: UIViewController)
-
All added view controllers.
Declaration
Objective-C
@property (nonatomic, copy, readonly) NSArray<__kindof UIViewController *> *_Nonnull viewControllers;
Swift
var viewControllers: [UIViewController] { get }
-
The currently visible view controller index.
Declaration
Objective-C
@property (nonatomic) NSUInteger visibleViewControllerIndex;
Swift
var visibleViewControllerIndex: UInt { get set }
-
Set the currently visible view controller index.
Declaration
Objective-C
- (void)setVisibleViewControllerIndex:(NSUInteger)visibleViewControllerIndex animated:(BOOL)animated;
Swift
func setVisibleViewControllerIndex(_ visibleViewControllerIndex: UInt, animated: Bool)
-
Set to YES if you want to animate controller changes. Defaults to YES.
Declaration
Objective-C
@property (nonatomic) BOOL shouldAnimateChanges;
Swift
var shouldAnimateChanges: Bool { get set }
-
Visible view controller title will be stored in NSUserDefaults under this key. Container controller will automatically restore the last visible controller when presented. Make sure this is set before view loads.
Declaration
Objective-C
@property (nonatomic, nullable) NSString *lastVisibleViewControllerTitleKey;
Swift
var lastVisibleViewControllerTitleKey: String? { get set }
-
Segmented control used to switch between the child view controllers. nonnull once view is loaded.
Declaration
Objective-C
@property (nonatomic, readonly, nullable) UISegmentedControl *filterSegment;
Swift
var filterSegment: UISegmentedControl? { get }