Knowledge

This is a list of classes related to Knowledge. The entry point into this feature is through the SCKnowledgeInterface class. Refer to that class to get started.

  • A SCSKnowledgeManager object is used to interact with knowledge data such as category groups, categories, and articles.

    The knowledge manager abstracts the storage, network retrieval, and queries for interacting with data in an efficient fashion. You can use this object to fetch categories and articles from your org. Once fetched, you can use this object to get cached content. See the SCSArticleQuery class for an explanation on how to query for content.

    The knowledge manager caches data for offline use, allowing categories and articles to be used even when no network is available. To stay informed about important changes in the underlying data model, any changes to the underlying categories will be advertised through the use of the following notifications:

    The object of the notification will be the SCSKnowledgeManager instance itself, while the category in question is stored in the notification’s userInfo dictionary under the SCSKnowledgeManagerCategoryKey key.

    See more

    Declaration

    Objective-C

    
    @interface SCSKnowledgeManager : NSObject

    Swift

    class KnowledgeManager : NSObject
  • View controller capable of displaying the contents of an article. When used in conjunction with a navigation controller, the title property of the view will automatically be set to the title of the article, or nil if no article is assigned.

    Article content is automatically rendered into content capable of being displayed within this view controller. The articles data is laid out as HTML and rendered within a WKWebView instance.

    HTML content is rendered using a structure like the following:

    <html>
     <head>
       <meta name="viewport" content="initial-scale=1"/>
       <link rel="stylesheet" href="/style.css" type="text/css" media="all"/>
       <link rel="stylesheet" href="/article/{{article.id}}/style.css" type="text/css" media="all"/>
     </head>
     <body>
       <header>
         {{article.title}}
       </header>
       <main>
         <field name="{{field.name}}" type="{{field.type}}">
           <field-title>{{field.title}}</field-title>
           <field-value>{{field.value}}</field-value>
         </field>
         ...
       </main>
       <script src="/script.js"></script>
       <script src="/article/{{article.id}}/script.js"></script>
     </body>
    

    Smart link tags (anchors referencing other articles within Salesforce) will be decorated with a smart-link CSS class, which can be used to style those links differently as needed.

    Each article field is separated into its own block which can be independently formatted, hidden, or otherwise styled using custom CSS. The default global CSS is automatically populated based on the fonts and colors defined in SCAppearanceConfiguration. Furthermore, if any custom styles need to be changed, SCAppearanceConfiguration.globalArticleCSS property can be used to add default syles that are applied to all articles. Likewise, the SCAppearanceConfiguration.globalArticleJavascript property can be used to supply common javascript to be injected to all articles when they’re loaded.

    The -[SCSArticleViewControllerDelegate articleController:additionalCSSForArticle:] and -[SCSArticleViewControllerDelegate articleController:additionalJavascriptForArticle:] delegate methods can be used to provide more granular per-article control over both CSS and javascript.

    See more

    Declaration

    Objective-C

    @interface SCSArticleViewController : UIViewController

    Swift

    class SCSArticleViewController : UIViewController
  • Delegate protocol used to interact with article view controllers.

    See more

    Declaration

    Objective-C

    @protocol SCSArticleViewControllerDelegate <NSObject>

    Swift

    protocol SCSArticleViewControllerDelegate : NSObjectProtocol
  • An SCSArticleQuery object manages the criteria to apply when fetching and searching knowledge articles. This query object stores the type of search, the search parameters, and any filters or constraints to apply when searching.

    This class is immutable. To create a mutable query object, see SCSMutableArticleQuery.

    See more

    Declaration

    Objective-C

    
    @interface SCSArticleQuery : NSObject <NSCopying, NSMutableCopying>

    Swift

    class ArticleQuery : NSObject, NSCopying, NSMutableCopying
  • An SCSMutableArticleQuery object is the mutable version of SCSArticleQuery. It manages the criteria to apply when fetching and searching knowledge articles. This query object stores the type of search, the search parameters, and any filters or constraints to apply when searching.

    Use this object with -[SCSKnowledgeManager fetchArticlesWithQuery:completion:] to download articles that match your query. To access already downloaded articles matching your query, call -[SCSKnowledgeManager articlesMatchingQuery:completion:].

    See more

    Declaration

    Objective-C

    
    @interface SCSMutableArticleQuery : SCSArticleQuery

    Swift

    class MutableArticleQuery : ArticleQuery
  • This class is intended to efficiently manage the results of an article query to return an indexed list of articles to the caller.

    You configure an instance of this controller with a specific query, and the fetches and pagination will automatically be handled for you. Any changes to the set of articles will be communicated through the use of the SCSArticleQueryResultsControllerDelegate, allowing UI state to be updated as needed.

    See more

    Declaration

    Objective-C

    @interface SCSArticleQueryResultsController : NSObject

    Swift

    class SCSArticleQueryResultsController : NSObject
  • Delegate protocol for interacting with a SCSArticleQueryResultsController.

    See more

    Declaration

    Objective-C

    @protocol SCSArticleQueryResultsControllerDelegate <NSObject>

    Swift

    protocol SCSArticleQueryResultsControllerDelegate : NSObjectProtocol
  • A SCSCategory represents an individual data category within a data category group. Categories form a tree hierarchy, where an individual category has one parent category (with the exception of a root-level category, which does not have a parent), and it may have multiple child categories.

    Refer to SCSCategoryGroup for a representation of a data category group.

    See more

    Declaration

    Objective-C

    
    @interface SCSCategory : NSObject

    Swift

    class Category : NSObject
  • Undocumented

    See more

    Declaration

    Objective-C

    NS_ENUM(NSInteger, SCSCategoryDisplayMode) {
        SCSCategoryDisplayModeArticlesOnly,
        SCSCategoryDisplayModeArticlesAndCategories
    }

    Swift

    enum SCSCategoryDisplayMode : Int
  • Undocumented

    See more

    Declaration

    Objective-C

    NS_ENUM(NSInteger, SCSCategoryHeaderType) {
        SCSCategoryHeaderTypeArticles = 1,
        SCSCategoryHeaderTypeChildCategories,
    }

    Swift

    enum SCSCategoryHeaderType : Int
  • View controller capable of showing the contents of a category, whether it be child categories, articles, or both. It can be controlled through assigning a containing category to the category property, and implementing the SCSCategoryViewControllerDelegate methods.

    See more

    Declaration

    Objective-C

    @interface SCSCategoryViewController : UIViewController

    Swift

    class SCSCategoryViewController : UIViewController
  • Delegate protocol to allow the receiver to interact with, and control the experience of, a category view controller.

    See more

    Declaration

    Objective-C

    @protocol SCSCategoryViewControllerDelegate <NSObject>

    Swift

    protocol SCSCategoryViewControllerDelegate : NSObjectProtocol
  • A SCSCategoryGroup represents a data category group. A category group contains a hierarchical tree of data categories.

    Refer to SCSCategory for a representation of data categories.

    See more

    Declaration

    Objective-C

    
    @interface SCSCategoryGroup : NSObject

    Swift

    class CategoryGroup : NSObject
  • View controller that implements the built-in Support Home experience. This class is not meant to be used when using SCServiceInterface.

    See more

    Declaration

    Objective-C

    @interface SCSKnowledgeHomeViewController : UIViewController

    Swift

    class SCSKnowledgeHomeViewController : UIViewController
  • Delegate protocol for events related to the SCSKnowledgeHomeViewController.

    See more

    Declaration

    Objective-C

    @protocol SCSKnowledgeHomeViewControllerDelegate <NSObject>

    Swift

    protocol SCSKnowledgeHomeViewControllerDelegate : NSObjectProtocol