SBSDKResourcesManager
@interface SBSDKResourcesManager : NSObject
A class that manages installation and removal of resources, required by some features. It also manages installation of custom resources that extend some features functionality.
-
Installs required resource from the application’s bundle. If the resource is missing, this method will terminate the app with a descriptive message. This method will be called by a feature that depend on a given resource automatically, thus no need to call it explicitly.
Declaration
Objective-C
+ (BOOL)installRequiredResourcesOfTypeIfNeeded:(SBSDKResourceType)type forceInstall:(BOOL)force;
Swift
class func installRequiredResources(ofTypeIfNeeded type: SBSDKResourceType, forceInstall force: Bool) -> Bool
Parameters
type
The type of required resource to be installed.
force
A boolean flag that forces to override the previously installed resources.
Return Value
A boolean value, the success of the operation.
-
Removes resources of a given type. For type OCR it will also uninstall custom OCR languages.
Declaration
Objective-C
+ (void)resetResourceOfType:(SBSDKResourceType)type;
Swift
class func resetResource(of type: SBSDKResourceType)
Parameters
type
The type of required resource to be removed.
-
Checks whether
ScanbotSDKOCRData.bundle
is available in the application’s bundle. If yes, callinginstallRequiredResourcesOfTypeIfNeeded:forceInstall:
will copy default OCR resources provided in it, as well as required ones.Declaration
Objective-C
+ (BOOL)canInstallDefaultOCRResources;
Swift
class func canInstallDefaultOCRResources() -> Bool
Return Value
A boolean value that indicates the possibility of installing default OCR resources.
-
Provides an URL of the folder, where custom OCR languages data can be copied.
Declaration
Objective-C
+ (nullable NSURL *)customOCRLanguagesDataURL;
Swift
class func customOCRLanguagesDataURL() -> URL?
Return Value
An URL of the folder, where custom OCR languages data can be copied to.
-
Returns a list of all installed two-letter ISO 639-1 language codes.
Declaration
Objective-C
+ (nonnull NSArray<NSString *> *)installedLanguages;
Swift
class func installedLanguages() -> [String]
Return Value
NSArray of NSString objects, each being a two-letter ISO 639-1 language code.