ModelTagManager

@available(OSX 10.13, iOS 11.0, tvOS 11.0, watchOS 4.0, *)
@objc(ModelTagManager)
public class ModelTagManager : NSObject

Manages interacting with models using tags created in the webapp.

  • Tags applied to models to query for.

    Declaration

    Swift

    @objc
    public let tags: [String]
  • Declaration

    Swift

    @objc(initWithTags:sessionManager:)
    public init(tags: [String], sessionManager: SessionManager? = nil)
  • Gets managed models matching tags, pulling from data already queries from API.

    Does not query the API, only checks model data stored locally. To update tags with latest known data, use fetchModelsForTags.

    Declaration

    Swift

    @objc(getModelsForTagsWithWifiRequired:)
    public func getManagedModelsForTags(
      wifiRequiredForModelDownload: Bool = false
    ) -> [FritzManagedModel]

    Parameters

    wifiRequiredForModelDownload

    Optional value to require wifi when downloading models loaded from tags.

    Return Value

    List of FritzManagedModel matching tags.

  • Fetch FritzManagedModels from Fritz API that match tags. If the request fails for any reason, it will query local store and return existing models that match models.

    Declaration

    Swift

    @objc(fetchModelsForTagsWithWifiRequired:completionHandler:)
    public func fetchManagedModelsForTags(
      wifiRequiredForModelDownload: Bool = false,
      completionHandler: @escaping ([FritzManagedModel]?, Error?) -> Void
    )

    Parameters

    wifiRequiredForModelDownload

    Optional value to require wifi when downloading models loaded from tags.

    completionHandler

    Called after models for tags are loaded.