SBSDKUIDocument
@interface SBSDKUIDocument : NSObject <NSCopying>
A thread-safe, mutable container for scanned pages of type ‘SBSDKUIPage’.
-
The number of pages the receiver contains.
Declaration
Objective-C
- (NSInteger)numberOfPages;
Swift
func numberOfPages() -> Int
-
Returns the page object at the given index. No boundary checks.
Declaration
Objective-C
- (SBSDKUIPage *_Nullable)pageAtIndex:(NSInteger)index;
Swift
func page(at index: Int) -> SBSDKUIPage?
Parameters
index
The valid index of the page.
Return Value
The found page object.
-
Returns the page object with the given page file ID or nil, if the receiver does not contain a page with the given ID.
Declaration
Objective-C
- (SBSDKUIPage *_Nullable)pageWithPageFileID:(nonnull NSUUID *)uuid;
Swift
func page(withPageFileID uuid: UUID) -> SBSDKUIPage?
Parameters
uuid
The unique ID of a page.
Return Value
The found page object or nil.
-
Returns the index of the page object with the given page file ID or NSNotFound, if the receiver does not contain a page with the given ID.
Declaration
Objective-C
- (NSInteger)indexOfPageWithPageFileID:(nonnull NSUUID *)uuid;
Swift
func indexOfPage(withPageFileID uuid: UUID) -> Int
Parameters
uuid
The unique ID of a page.
Return Value
The found page object or nil.
-
Appends a page to the receiver.
Declaration
Objective-C
- (BOOL)addPage:(nonnull SBSDKUIPage *)page;
Swift
func add(_ page: SBSDKUIPage) -> Bool
Parameters
page
The page object to be added.
Return Value
YES, if the page was successfully added, NO otherwise or if the receiver already contains a page with the same ID.
-
Inserts a page into the receiver at the given position. No boundary checks.
Declaration
Objective-C
- (BOOL)insertPage:(nonnull SBSDKUIPage *)page atIndex:(NSInteger)index;
Swift
func insert(_ page: SBSDKUIPage, at index: Int) -> Bool
Parameters
page
The page object to be inserted.
index
The valid index where the page is being inserted.
Return Value
YES, if the page was successfully inserted, NO otherwise or if the receiver already contains a page with the same ID.
-
Removes the page at the given index from the receiver. No boundary checks.
Declaration
Objective-C
- (void)removePageAtIndex:(NSInteger)index;
Swift
func removePage(at index: Int)
Parameters
index
The valid index of the page to be removed.
-
Replaces the page at the given index with the given page. No boundary checks.
Declaration
Objective-C
- (BOOL)replacePageAtIndex:(NSInteger)index withPage:(nonnull SBSDKUIPage *)page;
Swift
func replacePage(at index: Int, with page: SBSDKUIPage) -> Bool
Parameters
index
The valid index of the page to be replaced.
page
The page that should be inserted.
Return Value
YES, if the page was successfully replaced, NO otherwise or if the receiver already contains a page with the same ID.