Zbar not working after changing setSymbology - ios

I want Zbar to capture images as well as scan QR code with the single Zbar reader without dismissing it from the current ViewController.
For that I was using
[reader.scanner setSymbology:ZBAR_QRCODE config: ZBAR_CFG_ENABLE to:1];
to enable when the slider changes to the QR code mode and
[reader.scanner setSymbology:ZBAR_QRCODE config: ZBAR_CFG_ENABLE to:0];
to disable the QR code mode when the slider is set to certain value.
It is not working properly by changing like that. If the QR code is enabled initially, the zbar reader scans well the QR code.
But I wanna show just an image picker initially, so I put on the above code that disables the QR code mode and would change the symbology as needed. By changing the symbology, the QR code is not working. Can someone please help me fixing this showing me what went wrong?
Im working on the latest release with iOS 6.0. Thanks in advance.

You would have probably solved the problem by now. The problem is hard to imagine though but one of either solution will solve it:
Use ZBarReaderController instead of the ZBar ReaderViewController so you have control when the barcode gets captured. (The symbology support is set once before you initialise
the controller I do not believe you can change symbology support dynamically, also since you only disabled QR Codes - it will continue to support the other 20 or so barcode formats.
If you want to pick images from the camera roll you need to do it outside the Z bar reader controller but you should still be able to decode the resulting image using Z-Bar - it should be easy to figure out in the sample app.

Related

Nativescript Mediafilepicker customizing DKImagePickerController UI

I'm currently using Nativescript-Mediafilepicker plugin to handle image selection and also capturing image from camera in iOS. In ns mediafilepicker docs , i can see that it is using DKImagePickerController native libraries to handle the image selection and In the DKImagePickerController docs, i can see there is an option to customize the UI (CustomUIDelegate).
Is there any possible way to do the same with Nativescript? I wish to customize the camera icon in the image picker gallery. In the DKImagePickerController CustomUIDelegate doc, i can see it is using DKAssetGroupDetailBaseCell to achieve the customization. How can i do this in Nativescript Angular?
Short answer: you cannot do it easily.
Long Answer
You need to override methods since the plugin you are referring to does not expose APIs to modify the icon.
I have tried modifying it myself and I found out modifying the original plugin source code. I can give you hints on what you would have to do based on the understanding I have put in during the last few hours.
Create your custom MediaPicker
class MyMediaPicker extends Mediafilepicker {
...
}
Extend and copy the original openImagePicker method.
As you can see in the original source code, you have access to the picker, but you need to create a custom iOS delegate that handles the task of getting the UIImage for the camera.... This last task is painful, since the DK plugin guy created a custom class to refer to the Camera Cell that you now have to modify as well.
Once you modify (1) the picker plugin method, (2) the internal DK picker delegate, and (3) created a custom CameraCell. You should be able to modify that camera icon.
Here are some useful links:
https://github.com/jibon57/nativescript-mediafilepicker
https://github.com/zhangao0086/DKImagePickerController/blob/e61f49bda664e41dafd3c06174ae0cd1eccda236/Sources/DKImagePickerController/DKImagePickerController.swift
https://github.com/zhangao0086/DKImagePickerController/blob/e61f49bda664e41dafd3c06174ae0cd1eccda236/Sources/DKImagePickerController/Resource/DKImagePickerControllerResource.swift

AudioKit shouldOptimizeForRealtimePlot causing plot to go blank

I've got an iOS project set up in Xcode utilizing AudioKit to display a realtime plot of a chosen onboard microphone on the iOS device.
I am currently attempting to set the flag for an AKNodeOutputPlot where shouldOptimizeForRealtimePlot = true, but I've found that if I even add that line of code, whether it's set to true or false, to the project (in the ViewController the plot in which the plot is displayed, OR as a key-value in IB), the plot no longer displays.
If I remove the line of code, my plot resumes functionality as normal.
Has anyone else run into this?
My plot is setup mostly in IB, I pretty much just use the VC to set the input node and pause/resume the plot, but if you'd like to see any extra code, or a screenshot of my setup in IB, I'm happy to oblige.
Thank you for your assistance.

Get all elements in the view of iphone app using xcode

I am trying to take screenshot of every screen during iphone app automation on a simulator. Along with the screenshot I also want to extract all strings in the that particular view before taking a screenshot using xcode. Is there a way to do that? Purpose is to send these screenshots and strings for validation to another tool.
This can be done using Web Driver Agent(WDA) provided by facebook. It does provide all the functionalities you need for your app.
Here is link to github repo for it:
https://github.com/facebook/WebDriverAgent
Please have a look at it. It might help you achieving your goal.
If you are using the XCUITest framework for your automation, you can use XCUIScreen.main.screenshot() to get a screenshot of the current state.
To fetch all text currently on screen you can use XCUIApplication().descendants(matching: .textField) or .buttons or .any or whatever you expect to be on the screen, and extract the text from the element
let descendants = XCUIApplication().descendants(matching: .textField)
foreach descendant in descendants { descendant.label /*do something*/ }
You need to set an Accessibility Identifier on the view elements for this to work.

How to Apply Custom Filter to Camera & Photo View in Img.ly iOS SDK? XCode 8.1 Swift 3.0.1

XCode 8.1 Swift 3.0.1
I've been playing with img.ly iOS SDK for the last few days and I'm really excited about it, especially, the full blown customization that they've offered.
Unfortunately, I'm facing a few issues which I seem to can't get my head around it.
I wanted to limit the filter effects for the user to use only 5 of them. I can make it work by using this code:
However, when I select a filter effect, the image won't apply that effect to the Camera view, like the picture below:
I've tried to hook up the filterToolControllerBuilder to the CameraViewController like below:
And I called the filterSelectedClosure to get the identifier, and I can get it. as the filter is selected like the image below:
Questions are in the picture.
How to apply the filter identifier to the photo?
How to get the filter identifier when filter in Camera View is selected?
How to apply that selected filter identifier to the live Camera preview?
It seems like this is the first question related to Img.ly iOS SDK.
Please assist. Thanks.
I used to use this framework... let try to follow my code .
builder.configureAdjustToolController({ (options) in
options.allowedAdjustTools = [.brightness]
options.adjustToolButtonConfigurationClosure = { cell , action in
cell.imageView.image = cell.imageView.image?.withRenderingMode(.alwaysTemplate)
cell.imageView.tintColor = UIColor.white
}
})

Implement Camera in Custom page in Cordova iOS

In Cordova and Meteor.js, is it possible to implement the Camera function into our own custom page, getting it to look similar to the following in iOS:
I don't know about Meteor.js but I can tell you about cordova-plugins.
Yes you can do it by using mbppower/CordovaCameraPreview plugin that allows camera interaction from HTML code. To create your custom camera what you should do is, start camera on your HTML page. You have to draw rectangle for "Camera Preview Box" with required height-width dimensions and starting point(x,y) as parameters in below code snippet.You can also make it Tap enabled and Drag-able.
cordova.plugins.camerapreview.startCamera({x: 100, y: 100, width: 200, height:200}, "front", tapEnabled, dragEnabled, toBack);
Now its on your HTML page only, so you can add Capture button, Browse picture button, Flash or anything you want. It will be like your custom camera only. A big thanks to its author, he has done a great job..
Added more stuff:
you can also use donaldp24/CanvasCameraPlugin Plugin for your application, its supported in both android and iOS. For iOS its working, but in android isn't working properly for me.
UPDATE:10th Oct 2017 It used to work well during that time but, donaldp24/CanvasCamera is no longer maintained and currently fails build with the latest Cordova version.

Resources