FIRModelDownloadConditions.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #import <Foundation/Foundation.h>
  2. NS_ASSUME_NONNULL_BEGIN
  3. /** Configurations for model downloading conditions. */
  4. NS_SWIFT_NAME(ModelDownloadConditions)
  5. @interface FIRModelDownloadConditions : NSObject<NSCopying>
  6. /**
  7. * Indicates whether download requests should be made over a cellular network. The default is `YES`.
  8. */
  9. @property(nonatomic, readonly) BOOL allowsCellularAccess;
  10. /**
  11. * Indicates whether the model can be downloaded while the app is in the background. The default is
  12. * `NO`.
  13. */
  14. @property(nonatomic, readonly) BOOL allowsBackgroundDownloading;
  15. /**
  16. * Creates an instance of `ModelDownloadConditions` with the given conditions.
  17. *
  18. * @param allowsCellularAccess Whether download requests should be made over a cellular network.
  19. * @param allowsBackgroundDownloading Whether the model can be downloaded while the app is in the
  20. * background.
  21. * @return A new `ModelDownloadConditions` instance.
  22. */
  23. - (instancetype)initWithAllowsCellularAccess:(BOOL)allowsCellularAccess
  24. allowsBackgroundDownloading:(BOOL)allowsBackgroundDownloading
  25. NS_DESIGNATED_INITIALIZER;
  26. /**
  27. * Creates an instance of `ModelDownloadConditions` with the default conditions. The default values
  28. * are specified in the documentation for each instance property.
  29. *
  30. * @return A new `ModelDownloadConditions` instance.
  31. */
  32. - (instancetype)init;
  33. @end
  34. NS_ASSUME_NONNULL_END