SCSCategory


@interface SCSCategory : NSObject

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.

  • Unique name for this category.

    Declaration

    Objective-C

    @property (readonly, copy, nonatomic) NSString *_Nonnull name;

    Swift

    var name: String { get }
  • Label, or display name, for this category.

    Declaration

    Objective-C

    @property (readonly, copy, nonatomic) NSString *_Nonnull label;

    Swift

    var label: String { get }
  • url

    API URL for this category.

    Declaration

    Objective-C

    @property (readonly, copy, nonatomic) NSString *_Nonnull url;

    Swift

    var url: String { get }
  • Array of immediate child categories below this one. If this category is a leaf category, this array will be empty.

    Declaration

    Objective-C

    @property (readonly, strong, nonatomic)
        NSArray<SCSCategory *> *_Nonnull childCategories;

    Swift

    var childCategories: [Category] { get }
  • Reference to this category’s immediate parent. For root-level categories, this value is nil.

    Declaration

    Objective-C

    @property (readonly, nonatomic, nullable) SCSCategory *parentCategory;

    Swift

    weak var parent: Category? { get }
  • The category group that this category resides within.

    Declaration

    Objective-C

    @property (readonly, nonatomic, nullable) SCSCategoryGroup *categoryGroup;

    Swift

    weak var categoryGroup: SCSCategoryGroup? { get }
  • The knowledge manager this category belongs to. If this value becomes nil, the article instance should be considered invalid and should be removed or released.

    Declaration

    Objective-C

    @property (readonly, nonatomic) SCSKnowledgeManager *_Nullable manager;

    Swift

    weak var manager: SCSKnowledgeManager? { get }
  • Returns a category at or below this category that matches the specified name.

    Declaration

    Objective-C

    - (nullable SCSCategory *)categoryWithName:(nonnull NSString *)name;

    Swift

    func withName(_ name: String) -> Category?

    Parameters

    name

    Category name.

    Return Value

    SCSCategory instance matching the specified category name, or nil if no child category is found.