Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 1    Views: 81

mikoz
I hate code!
Profile
Posts: 51
Reg: Nov 14, 2010
Australia
3,610
09/11/14 06:23 PM (9 years ago)

IOS7 AVFoundation barcode scanner into BT app with storyboard

I'm updating an app to use the NEW IOS7 AvFoundation code for scanning barcodes and have a few issues using a storyboard. Here is a working example of what i am trying to implement. https://github.com/jpwidmer/iOS7-BarcodeScanner I am working with that shoehorned into a BT_screen_blank plugin as so; .h #import <Foundation/Foundation.h> #import <UIKit/UIKit.h> #import "BT_viewController.h" #import <UIKit/UIKit.h> #import "SettingsViewController.h" @interface BT_screen_blank : BT_viewController <UIAlertViewDelegate, SettingsDelegate> @property (strong, nonatomic) NSMutableArray * allowedBarcodeTypes; @end .m #import <UIKit/UIKit.h> #import <Foundation/Foundation.h> #import "JSON.h" #import "BT_application.h" #import "BT_strings.h" #import "BT_viewUtilities.h" #import "derivanv2_appDelegate.h" #import "BT_item.h" #import "BT_debugger.h" #import "BT_screen_blank.h" #import "SettingsViewController.h" #import "Barcode.h" #import <AVFoundation/AVFoundation.h> @interface BT_screen_blank () @property (strong, nonatomic) NSMutableArray * foundBarcodes; @property (weak, nonatomic) IBOutlet UIView *previewView; @property (strong, nonatomic) SettingsViewController * settingsVC; @end etc... If you were to look at the storyboard you would notice that the scanner screen is embedded in a nav controller. But although I get 0 errors, I also only get a blank white screen when loaded on the device. As i think that the Storyboard Nav Controller is not being called. Just trying to get my head around this... Implementing it without the storyboard and segues is straightforward and scans barcodes just fine, although I am at a loss as to how to push views with the detection String.
 
ATRAIN53
Code is Art
Profile
Posts: 1755
Reg: Nov 17, 2011
Chicago
26,450
like
09/12/14 09:51 AM (9 years ago)
BT doesn't use storyboards by default. They will work in projects if you write the code to call them, but the navigation structure in BT is all handled in code, not storyboards. Sounds like you've got that figured out and using the blank screen plugin to create your new screen/view. Well done and how I would do it. Now if you want to push another view from that new screen, you have to do it manually something like this: MYViewController *controller = [[MYViewController alloc] init]; [self presentViewController:controller animated:YES completion:nil]; If you try to push it as a navigation controller, it can wreak havoc with the BT navigation structure and you might find yourself trapped in a screen with no way to get back to the BT Navigation "heirarchy". (and that is a great github, have looked at it myself before)
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.