BCKCoding Protocol Reference
Conforms to | NSObject |
Declared in | BCKCode.h |
Tasks
Other Methods
-
codeCharacters
property required method -
+ barcodeStandard
required method -
+ barcodeDescription
required method -
+ canEncodeContent:error:
required method -
– captionTextForZone:withRenderOptions:
Creating Barcodes
Configuring barcodes
-
– horizontalQuietZoneWidth
-
– aspectRatio
-
– fixedHeight
-
– markerBarsCanOverlapBottomCaption
-
– allowsFillingOfEmptyQuietZones
-
– defaultCaptionFontName
-
– showCheckDigitsInCaption
Deprecated Methods
Properties
codeCharacters
The array of individual code characters the barcode comprises. When subclassing BCKCode this array of BCKCodeCharacter instances make up the bit string representation of the barcode content string. Defaults to nil
.
@property (nonatomic, readonly) NSArray *codeCharacters
Declared In
BCKCode.h
Class Methods
barcodeDescription
Human readable description of the barcode class. For example “EAN-8”. Defaults to nil
.
+ (NSString *)barcodeDescription
Declared In
BCKCode.h
barcodeStandard
The barcode class' standard. For example “International standard ISO/IEC 15420”. Defaults to nil
.
+ (NSString *)barcodeStandard
Declared In
BCKCode.h
canEncodeContent:error:
Checks if the content string is encodable by the BCKCode subclass. Defaults to NO
.
+ (BOOL)canEncodeContent:(NSString *)content error:(NSError **)error
Parameters
- content
The content string to be encoded by the BCKCode subclass. Any check digits will be generated by the subclass and should not be included in the content string.
- error
Optional output parameter providing an
NSError
in case the content string cannot be encoded by the BCKCode subclass.
Return Value
YES
if the content string is encodable, in which case the error object is set to nil. NO
if the contents can not be encoded, in which case the error object contains error information.
Declared In
BCKCode.h
Instance Methods
allowsFillingOfEmptyQuietZones
Whether the barcode allows for quite zones to be filled with angle brackets. If YES
, then quiet zones are filled if the BCKCodeDrawingFillEmptyQuietZonesOption is specified. Defaults to NO
.
- (BOOL)allowsFillingOfEmptyQuietZones
Declared In
BCKCode.h
aspectRatio
The aspect ratio between the length and width of the rendered barcode. Defaults to 1.
- (CGFloat)aspectRatio
Declared In
BCKCode.h
captionTextForZone:withRenderOptions:
The caption text to display in the given caption zone. If you return nil
then the digits are taken from
- (NSString *)captionTextForZone:(BCKCodeDrawingCaption)captionZone withRenderOptions:(NSDictionary *)options
Parameters
- captionZone
The BCKCodeDrawingCaption zone specifying the required text zone.
- options
The rendering options.
Return Value
The caption text to display in this zone, or nil
for no caption text.
Discussion
Note: Not implementing this method disables caption drawing altogether
Declared In
BCKCode.h
defaultCaptionFontName
The font used for text captions if no other font is specified via BCKCodeDrawingCaptionFontNameOption. Defaults to Helvetica.
- (NSString *)defaultCaptionFontName
Declared In
BCKCode.h
fixedHeight
The fixed height of the rendered barcode. Defaults to 0 to indicate there is no fixed height.
- (CGFloat)fixedHeight
Declared In
BCKCode.h
horizontalQuietZoneWidth
The width of the horizontal quiet zone (in bar units) on the left and right sides of the barcode. Defaults to 0 to indicate there are no horizontal quiet zones.
- (NSUInteger)horizontalQuietZoneWidth
Declared In
BCKCode.h
initWithContent:
Root initializer for sub-classes of the BCKCode class cluster. You should not call this on BCKCode directly, but always on concrete subclasses based on the kind of code you want to generate.
- (instancetype)initWithContent:(NSString *)content
Parameters
- content
The content string for the barcode.
Return Value
The requested BCKCode subclass. Returns nil
if the content string cannot be encoded using the requested BCKCode subclass.
Discussion
Warning: This method is deprecated, use - [BCKCode initWithContent:error:] instead.
Declared In
BCKCode.h
initWithContent:error:
Root initializer for subclasses of the BCKCode class cluster. You should not call this on BCKCode directly. Always use a concrete subclass depending on the kind of barcode you want to generate. The initializer copies the content string to the _content ivar. Subclasses only need to override this initializer if they add additional properties. This initialiser calls the subclass' canEncodeContent method to determine whether the content string can be encoded.
- (instancetype)initWithContent:(NSString *)content error:(NSError **)error
Parameters
- content
The content string to be encoded by the subclass.
- error
Optional output parameter to take an
NSError
in case the content cannot be encoded by this barcode class. Passnil
if not error information is not required.
Return Value
The requested BCKCode subclass. Returns nil
if the provided content cannot be encoded by the requested BCKCode subclass, the error object will then contain error details.
Declared In
BCKCode.h
markerBarsCanOverlapBottomCaption
Whether the subclass allows for marker bars to extend into the bottom caption region. If YES
, then the percentage of overlap can be specified with the BCKCodeDrawingMarkerBarsOverlapCaptionPercentOption. Defaults to NO
.
- (BOOL)markerBarsCanOverlapBottomCaption
Declared In
BCKCode.h
showCheckDigitsInCaption
Whether the barcode includes check digits in the caption printed below the barcode. By default any check digits that are NOT markers ARE included in the caption text. Subclasses can indicate support for excluding check digits from the caption by overriding this method and returning YES
. Defaults to NO
.
- (BOOL)showCheckDigitsInCaption
Declared In
BCKCode.h