SCSCategoryViewControllerDelegate
@protocol SCSCategoryViewControllerDelegate <NSObject>
Delegate protocol to allow the receiver to interact with, and control the experience of, a category view controller.
-
Informs the delegate when a category is assigned and it begins to load.
Declaration
Objective-C
- (void)categoryController:(nonnull SCSCategoryViewController *)controller willLoadCategory:(nonnull SCSCategory *)category;Swift
optional func categoryController(_ controller: SCSCategoryViewController, willLoad category: SCSCategory)Parameters
controllerThe SCSCategoryViewController instance.
categoryThe category that was assigned to the controller.
-
Informs the delegate when a category is assigned and it completes loading.
Declaration
Objective-C
- (void)categoryController:(nonnull SCSCategoryViewController *)controller didLoadCategory:(nonnull SCSCategory *)category;Swift
optional func categoryController(_ controller: SCSCategoryViewController, didLoad category: SCSCategory)Parameters
controllerThe SCSCategoryViewController instance.
categoryThe category that was assigned to the controller.
-
Informs the delegate when a category is selected.
Declaration
Objective-C
- (BOOL)categoryController:(nonnull SCSCategoryViewController *)controller childCategorySelected:(nonnull SCSCategory *)category;Swift
optional func categoryController(_ controller: SCSCategoryViewController, childCategorySelected category: SCSCategory) -> BoolParameters
controllerThe SCSCategoryViewController instance.
categoryThe category that was selected.
Return Value
YESif the built-in default action should be performed, otherwiseNOif no action should be performed. -
Informs the delegate when an article is selected.
Declaration
Objective-C
- (BOOL)categoryController:(nonnull SCSCategoryViewController *)controller articleSelected:(nonnull SCSArticle *)article;Swift
optional func categoryController(_ controller: SCSCategoryViewController, articleSelected article: SCSArticle) -> BoolParameters
controllerThe SCSCategoryViewController instance.
articleThe article that was selected.
Return Value
YESif the built-in default action should be performed, otherwiseNOif no action should be performed. -
Informs the delegate when the
Show More Articles
row is tapped.This is only supported on controllers that have child categories, and whose display mode is
SCSCategoryDisplayModeArticlesAndCategories.Declaration
Objective-C
- (BOOL)categoryController:(nonnull SCSCategoryViewController *)controller showMoreArticlesSelectedForCategory:(nonnull SCSCategory *)category;Swift
optional func categoryController(_ controller: SCSCategoryViewController, showMoreArticlesSelectedFor category: SCSCategory) -> BoolParameters
controllerThe SCSCategoryViewController instance.
categoryThe category being shown.
Return Value
YESif the built-in default action should be performed, otherwiseNOif no action should be performed. -
Allows the delegate to customize the header view used for the indicated type.
If
nilis returned, then no header will be used for that section.If you want to use the default header view, don’t implement this method.
The
SCSCategoryHeaderTypeChildCategoriesheader type is only requested of the delegate when the selected category has child categories, and when the display mode isSCSCategoryDisplayModeArticlesAndCategories.Declaration
Objective-C
- (nullable __kindof UIView *) categoryController:(nonnull SCSCategoryViewController *)controller headerViewForType:(SCSCategoryHeaderType)headerType forCategory:(nonnull SCSCategory *)category;Swift
optional func categoryController(_ controller: SCSCategoryViewController, headerViewFor headerType: SCSCategoryHeaderType, for category: SCSCategory) -> UIView?Parameters
controllerThe SCSCategoryViewController instance.
headerTypeThe type of header view being requested.
categoryThe category being shown.
Return Value
A UIView to show in the header section of the given type, or
nilif no header should be shown. -
Allows the delegate to customize the height of the header view used for the indicated type.
If you want to use the default height, don’t implement this method.
Declaration
Objective-C
- (CGFloat)categoryController:(nonnull SCSCategoryViewController *)controller heightForHeaderType:(SCSCategoryHeaderType)headerType forCategory:(nonnull SCSCategory *)category;Swift
optional func categoryController(_ controller: SCSCategoryViewController, heightFor headerType: SCSCategoryHeaderType, for category: SCSCategory) -> CGFloatParameters
controllerThe SCSCategoryViewController instance.
headerTypeThe type of header view being requested.
categoryThe category being shown.
Return Value
The desired height of the header.
Install in Dash
SCSCategoryViewControllerDelegate Protocol Reference