Capable
public struct Capable
This class defines the main interface of the Capable framework.
-
The
statusMap
property returns a dictionary of all features, that the Capable instance has been initialized with along with their current statuses. This object is compatible with most analytic SDKs such as Fabric Answers, Firebase Analytics, AppCenter Analytics, or HockeyApp. While most features can only have a status set to enabled or disabled, the.largerText
feature offers the font scale set by the user.Declaration
Swift
public var statusMap: [String : String] { get }
-
Initializes the framework instance with a specified set of features. If no feature was provided, this defaults to all features available on the current platform.
Declaration
Swift
public init(withFeatures features: [CapableFeature] = CapableFeature.allValues())
Parameters
features
An optional array containing the features of interest. This will default to all features available on the current platform.
-
Provides information regarding the current status of a provided feature.
Declaration
Swift
public func isFeatureEnabled(feature: CapableFeature) -> Bool
Parameters
feature
The feature of interest.
Return Value
true
if the given feature has been enabled, otherwisefalse
.