SCSArticleViewControllerDelegate Protocol Reference

Conforms to NSObject
Declared in SCSArticleViewControllerDelegate.h

Overview

Delegate protocol used to interact with article view controllers.

– articleController:categoryDidChange:

Message sent to the delegate when the selected category is changed.

- (void)articleController:(SCSArticleViewController *)controller categoryDidChange:(SCSCategory *)newCategory

Parameters

controller

The article view controller.

newCategory

The new category.

Declared In

SCSArticleViewControllerDelegate.h

– articleController:willShowArticle:

Informs the delegate when an article will be shown.

- (void)articleController:(SCSArticleViewController *)controller willShowArticle:(nullable SCSArticle *)article

Parameters

controller

The article view controller.

article

The article to be displayed, or nil if no article is selected.

Discussion

This message is sent immediately upon setting a new article.

Declared In

SCSArticleViewControllerDelegate.h

– articleController:didShowArticle:

Informs the delegate when an article has finished being shown.

- (void)articleController:(SCSArticleViewController *)controller didShowArticle:(nullable SCSArticle *)article

Parameters

controller

The article view controller.

article

The article being shown, or nil if no article is selected.

Discussion

This is sent when the article has finished loading and is displayed on the screen. If the view controller isn’t initially presented in the view hierarchy when the article is initially set, this message may be delayed until the controller is eventually presented and the article is loaded.

Declared In

SCSArticleViewControllerDelegate.h

– articleController:heightForHeaderView:

The target height for the given header view.

- (CGFloat)articleController:(SCSArticleViewController *)controller heightForHeaderView:(UIView *)headerView

Parameters

controller

The article view controller.

headerView

The header view to be displayed.

Return Value

Positive float value for the desired target header view height.

Discussion

If this method isn’t implemented, the height for the article header will be determined automatically. If a header view isn’t to be used for this article, this method is never called.

Declared In

SCSArticleViewControllerDelegate.h

– articleController:headerViewForArticle:

Header view to display above the article.

- (nullable __kindof UIView *)articleController:(SCSArticleViewController *)controller headerViewForArticle:(SCSArticle *)article

Parameters

controller

The article view controller.

article

The article being displayed.

Return Value

UIView instance to be used within the header, or nil.

Discussion

If this method isn’t implemented, a default header view will be used if an image is available for this article. If you do not wish for a header to be displayed, you can return nil from this method to opt out of displaying a header.

Auto Layout rules will be applied when adding this view to the hierarchy.

Declared In

SCSArticleViewControllerDelegate.h

– articleController:additionalCSSForArticle:

Asks the delegate for additional CSS for the given article.

- (nullable NSString *)articleController:(SCSArticleViewController *)controller additionalCSSForArticle:(SCSArticle *)article

Parameters

controller

The article view controller.

article

The article being viewed.

Return Value

Valid CSS for rendering the article, or nil if no custom CSS should be used.

Discussion

This can be used to control the additional styling used for an article on a per-article basis. This goes above and beyond the generic CSS available in SCAppearanceConfiguration.globalArticleCSS.

For more information on the HTML format the CSS may want control over, see the documentation in SCSArticleViewController for more details.

See Also

  • SCAppearanceConfiguration.globalArticleCSS

Declared In

SCSArticleViewControllerDelegate.h

– articleController:additionalJavascriptForArticle:

Asks the delegate for additional javascript for the given article.

- (nullable NSString *)articleController:(SCSArticleViewController *)controller additionalJavascriptForArticle:(SCSArticle *)article

Parameters

controller

The article view controller.

article

The article being viewed.

Return Value

Valid Javascript for customizing the article, or nil if no custom CSS should be used.

Discussion

This can be used to control the additional javascript used for an article on a per-article basis. This goes above and beyond the generic Javascript available in SCAppearanceConfiguration.globalArticleJavascript.

See Also

  • SCAppearanceConfiguration.globalArticleJavascript

Declared In

SCSArticleViewControllerDelegate.h