How to import Zbar Framework in Swift Project
Here is the solution
following link helped me
https://stackoverflow.com/a/24005242/4059179
But after that I had NSEnumeration Problem so here second problem solution
func imagePickerController(picker: UIImagePickerController,
didFinishPickingMediaWithInfo info: [NSObject : AnyObject]){
var results: NSFastEnumeration = info[ZBarReaderControllerResults] as NSFastEnumeration
}
Don't forget to extend
extension ZBarSymbolSet: SequenceType { public func generate() -> NSFastGenerator { return NSFastGenerator(self) }
}
Using zbar sdk and converting to swift 3, will it work?
The only changes should be the protocol part, you may refer to this post.
How to import Zbar Framework in Swift Project
extension ZBarSymbolSet: Sequence {
public func makeIterator() -> NSFastEnumerationIterator {
return NSFastEnumerationIterator(self)
}
}
func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : Any]) {
// ADD: get the decode results
let results: NSFastEnumeration = info[ZBarReaderControllerResults] as! NSFastEnumeration
var symbolFound : ZBarSymbol?
for symbol in results as! ZBarSymbolSet {
symbolFound = symbol as? ZBarSymbol
break
}
let resultString = symbolFound!.data
print(resultString)
}
Swift Import Obj-C Framework
You need to add libstdc++.dylib
to the Linked Frameworks and Libraries in the General tab for your project.
Using an Obj-C sub-project in a Swift application
I followed the HockeyApp tutorial that can be found here:
http://support.hockeyapp.net/kb/client-integration-ios-mac-os-x/integrate-hockeyapp-for-ios-as-a-subproject
In the end, I was on the right tracks but messed up the Header Search Paths:
- Add subproject xcodeproj to the workspace
- On the main project :
Link binary with library
, and add the subproject product library (Bonus points : add it as a target dependency too) - Update
Header Search Paths
(notUser Header Search Paths
) accordingly - Import your
Library.h
in the main projectBridging-Header.h
file
Related Topics
Swift Corebluetooth Reading a Float Array from Ble
Swift- Mkmapkit View Only One City
Passing Core Data Objects from UItableviewcell to Another View Controller
Weird Behaviour in Swiftui+Combine When Class -> Struct
Uibutton State Changing While Scrolling The Tableview with Multiple Sections - Swift
Comparing Time Without Date Swift3
Preparing for Swift 4 - Unsafemutablepointer Migration to Unsafemutablebufferpointer
How Does Swift's Int Literal to Float Inference Work
Swift Xml Rss Reader... Make It Async
Expose an Interface of a Class Loaded from a Framework at Runtime
How to Keep Updating Cloud Kit Record in Swift
.Childadded Observer Doesn't Get Called If The Function Is Not Called Explicitly. Swift 4
Loading Many UIimages from Disk Blocks Main Thread
Why I Can't Convert String to Date in Swift
Got Error: Return an Empty String to Bool
How to Get User Nearby My Location in Geofire,Firebase