3

I'm currently trying to implement this GitHub: https://github.com/yeahdongcn/RSBarcodes_Swift I have followed the instructions like so:

  • Add RSBarcodes_Swift as a submodule by opening the Terminal, cd-ing into your top-level project directory, and entering the command git submodule add https://github.com/yeahdongcn/RSBarcodes_Swift.git

    Added with no errors

  • Open the RSBarcodes_Swift folder, and drag RSBarcodes.xcodeproj into the file navigator of your app project.

    I'm assuming he meant project navigator here, which I did

  • In Xcode, navigate to the target configuration window by clicking on the blue project icon, and selecting the application target under the "Targets" heading in the sidebar. Ensure that the deployment target of RSBarcodes.framework matches that of the application target.

    Yup, It is set to 7.1

  • In the tab bar at the top of that window, open the "Build Phases" panel. Expand the "Target Dependencies" group, and add RSBarcodes.framework.

    Coudn't add 'RSBarcodes.framework' as it only gave me the option for 'RSBarcodes' Which I added as assumed the .framework was added wrongly

  • Click on the + button at the top left of the panel and select "New Copy Files Phase". Rename this new phase to "Copy Frameworks", set the "Destination" to "Frameworks", and add RSBarcodes.framework.

    Added, No Problems

The next set of instructions are:

Place an UIViewController in storyboard and set RSCodeReaderViewController based class as its custom class and it almost there, focus mark layer and corners layer is already there working for you. There are to handlers, one for the single tap on the screen along with the focus mark and the other is detected objects handler, which all detected will come to you. Set them up in viewDidLoad() or some place more suitable:

override func viewDidLoad() {
super.viewDidLoad()

self.focusMarkLayer.strokeColor = UIColor.redColor().CGColor

self.cornersLayer.strokeColor = UIColor.yellowColor().CGColor

self.tapHandler = { point in
    println(point)
}

self.barcodesHandler = { barcodes in
    for barcode in barcodes {
        println(barcode)
    }
}
}

I have followed those, the only thing that I did differently was add a UIButton to the main ViewController and add performSegueWithIdentifier to show the RSCodeReaderViewController as it was inaccessible

I have uploaded the project here: http://www.filedropper.com/barcodetestreader if you would like to see it. Could someone please tell me what is going on or if you encounter any errors?

ahsteele
  • 26,243
  • 28
  • 134
  • 248
DannieCoderBoi
  • 728
  • 2
  • 12
  • 31

2 Answers2

1

Don't make this:

Yup, It is set to 7.1

It's OK! :

Coudn't add 'RSBarcodes.framework' as it only gave me the option for 'RSBarcodes' Which I added as assumed the .framework was added wrongly. Your must add RSBarcodes ! Without .frameworks!

Do this and it will work:

In the tab bar at the top of that window, open the "Build Phases" panel. Expand the "Link Binary With Libraries" group, and add RSBarcodes.framework.

Good luck:)

Dmitry
  • 2,963
  • 2
  • 21
  • 39
0

For now, you can use CocoaPods() or Carthage to install RSBarcodes_Swift.

CocoaPods:

pod 'RSBarcodes_Swift', '~> 0.0.5'

in your Podfile.

Carthage:

github "yeahdongcn/RSBarcodes_Swift" >= 0.0.5

in your Cartfile.

R0CKSTAR
  • 118
  • 7