Skip to content

Commit

Permalink
finalizing extensibility
Browse files Browse the repository at this point in the history
  • Loading branch information
xremix committed Jun 27, 2017
1 parent ba65cb2 commit ee0f1bc
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion SwiftGS1Barcode.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'SwiftGS1Barcode'
s.version = '0.3.2'
s.version = '0.3.3'
s.summary = 'A GS1 Barcode Library and Parser for Swift'

s.description = <<-DESC
Expand Down
28 changes: 14 additions & 14 deletions SwiftGS1Barcode/GS1ApplicationIdentifier.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,41 +8,41 @@

import UIKit

enum GS1ApplicationIdentifierType: String{
public enum GS1ApplicationIdentifierType: String{
case Date
case String
case Int
var description: String{
return self.rawValue
}
public init(){self.init()}
}

public class GS1ApplicationIdentifier: NSObject{
var identifier: String
var maxLength: Int
var dynamicLength: Bool = false
public var identifier: String
public var maxLength: Int
public var dynamicLength: Bool = false

var type: GS1ApplicationIdentifierType?
public var type: GS1ApplicationIdentifierType?

var originalValue: String?
var dateValue: NSDate?
var intValue: Int?
public var originalValue: String?
public var dateValue: NSDate?
public var intValue: Int?
public var stringValue: String?

var stringValue: String?

init(_ identifier: String, length: Int){
public init(_ identifier: String, length: Int){
self.identifier = identifier
self.maxLength = length
}
convenience init(_ identifier: String, length: Int, type: GS1ApplicationIdentifierType){
public convenience init(_ identifier: String, length: Int, type: GS1ApplicationIdentifierType){
self.init(identifier, length: length)
self.type = type
}
convenience init(_ identifier: String, length: Int, type: GS1ApplicationIdentifierType, dynamicLength: Bool){
public convenience init(_ identifier: String, length: Int, type: GS1ApplicationIdentifierType, dynamicLength: Bool){
self.init(identifier, length: length, type: type)
self.dynamicLength = dynamicLength
}
convenience init(dateIdentifier identifier: String){
public convenience init(dateIdentifier identifier: String){
self.init(identifier, length: 6, type: .Date)
}
}
6 changes: 3 additions & 3 deletions SwiftGS1Barcode/GS1Barcode.swift
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,11 @@ public class GS1Barcode: NSObject, Barcode {
}

// Validating if the barcode got parsed correctly
func validate() -> Bool {
public func validate() -> Bool {
return lastParseSuccessfull && raw != "" && raw != nil
}

func parseNode(node: inout GS1ApplicationIdentifier, data: inout String)->Bool{
private func parseNode(node: inout GS1ApplicationIdentifier, data: inout String)->Bool{
if(data.startsWith(node.identifier)){
node = GS1BarcodeParser.parseGS1ApplicationIdentifier(node: node, data: data)
// Fixes issue where two nodes have the same identifier
Expand All @@ -84,7 +84,7 @@ public class GS1Barcode: NSObject, Barcode {
return false
}

func parse() ->Bool{
public func parse() ->Bool{
self.lastParseSuccessfull = false
var data = raw

Expand Down
2 changes: 1 addition & 1 deletion SwiftGS1Barcode/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>0.3.2</string>
<string>0.3.3</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSPrincipalClass</key>
Expand Down

0 comments on commit ee0f1bc

Please sign in to comment.