SBSDKUIBarcodeImageStorage
@interface SBSDKUIBarcodeImageStorage : NSObject
A class to store and remove barcode images from SBSDKUIBarcodeScannerViewController
.
-
If file format is set to JPEG, this property holds the compression quality of the stored images. Values must be between 0 (high compression, small file size, bad quality) and 100 (no compression, huge file size, good image quality). Read-only. Defaults to 80.
Declaration
Objective-C
@property (nonatomic, readonly) NSInteger writingJpegImageCompressionQuality;
Swift
var writingJpegImageCompressionQuality: Int { get }
-
File format of the stored images. Read-only. Defaults to JPEG.
Declaration
Objective-C
@property (nonatomic, readonly) SBSDKImageFileFormat writingImageFileFormat;
Swift
var writingImageFileFormat: SBSDKImageFileFormat { get }
-
The default instance of this class. *
Declaration
Objective-C
+ (nonnull SBSDKUIBarcodeImageStorage *)defaultStorage;
Swift
class func `default`() -> SBSDKUIBarcodeImageStorage
-
Set default storage. If not used, default storage will be created with default parameters.
Declaration
Objective-C
+ (void)setDefaultStorage:(nonnull SBSDKUIBarcodeImageStorage *)storage;
Swift
class func setDefault(_ storage: SBSDKUIBarcodeImageStorage)
-
Not available. Use ‘defaultStorage’.
Declaration
Objective-C
- (nonnull instancetype)init;
-
Not available. Use ‘defaultStorage’.
Declaration
Objective-C
+ (nonnull instancetype)new;
-
Initializes storage with given image file format and default JPEG compression quality using the default storage location.
Declaration
Objective-C
- (nonnull instancetype)initWithImageFileFormat:(SBSDKImageFileFormat)format;
Swift
init(imageFileFormat format: SBSDKImageFileFormat)
Parameters
format
image file format.
Return Value
An instance of storage.
-
Initializes storage with JPEG image file format and given JPEG compression quality using the default storage location.
Declaration
Objective-C
- (nonnull instancetype)initWithJPEGFileFormatAndCompressionQuality: (NSInteger)jpegImageCompressionQuality;
Swift
init(jpegFileFormatAndCompressionQuality jpegImageCompressionQuality: Int)
Parameters
jpegImageCompressionQuality
JPEG compression quality.
Return Value
An instance of storage.
-
Initializes storage with given image file format and default JPEG compression quality.
Declaration
Objective-C
- (nonnull instancetype) initWithImageFileFormat:(SBSDKImageFileFormat)format location:(nullable SBSDKStorageLocation *)location;
Swift
init(imageFileFormat format: SBSDKImageFileFormat, location: SBSDKStorageLocation?)
Parameters
format
image file format.
location
The storage location where image files are saved to. If nil, the default location is chosen.
Return Value
An instance of storage.
-
Initializes storage with JPEG image file format and given JPEG compression quality.
Declaration
Objective-C
- (nonnull instancetype) initWithJPEGFileFormatAndCompressionQuality: (NSInteger)jpegImageCompressionQuality location: (nullable SBSDKStorageLocation *) location;
Swift
init(jpegFileFormatAndCompressionQuality jpegImageCompressionQuality: Int, location: SBSDKStorageLocation?)
Parameters
jpegImageCompressionQuality
JPEG compression quality.
location
The storage location where image files are saved to. If nil, the default location is chosen.
Return Value
An instance of storage.
-
Clears the receiver. Removes all stored images files from disk.
Declaration
Objective-C
- (void)removeAll;
Swift
func removeAll()
-
Returns all available image URLs in the storage
Declaration
Objective-C
- (nonnull NSArray<NSURL *> *)allImageURLs;
Swift
func allImageURLs() -> [URL]