Post

Replies

Boosts

Views

Activity

iCloud Drive folder file creation
Hi, Ever since I bought the developer account im not able to get straight forward support for this, please help how to get help on api's and working of it from forum..I have just now started to use the forum and started providing comments to other users, but meanwhile how to get help faster as a paid developer account holder ? I at least want to enjoy using apple code to start with. please help. I want to create a file in icloud folder using filemanager,  i used the following code, FileManager.default.url(forUbiquityContainerIdentifier: nil)?.appendingPathComponent("Documents").appendingPathComponent("String.txt") do {      print("about to write")      &#9;&#9;try testText.write(to: filemanUrl!, atomically: true, encoding: String.Encoding.utf8)      &#9;&#9;print("after write")    } catch {      print(error.localizedDescription)    } but it is writing to a folder in  /Users/<myname>/Library/Developer/CoreSimulator/Devices/A3A4FF34-0942-4B9A-84F3-F4F6F48D4608/data/Library/Mobile Documents/iCloud~clouddrive/Documents
0
0
678
Jan ’21
certain QR codes are not readable?
I have done code for reading QR code but it sometimes does not read certain types of QR code. IOS and google chrome is able to read codes no matter how they are, how to get the same kind of functionality... output.setMetadataObjectsDelegate(self, queue: DispatchQueue.main)  output.metadataObjectTypes = [ &#9; AVMetadataObject.ObjectType.qr,&#9;&#9;&#9; &#9; AVMetadataObject.ObjectType.dataMatrix ] code that I used for reading QR code as follows class ViewController: UIViewController, AVCaptureMetadataOutputObjectsDelegate {     var video = AVCaptureVideoPreviewLayer()               override func viewDidLoad() {         super.viewDidLoad()         // Do any additional setup after loading the view.                  //create session         let session = AVCaptureSession()                  //Define capture device         let captureDevice = AVCaptureDevice.default(for: AVMediaType.video)                  do         {             let input = try AVCaptureDeviceInput(device: captureDevice!)             session.addInput(input)         }         catch         {             print("ERROR")         }                  let output = AVCaptureMetadataOutput()         session.addOutput(output)                  output.setMetadataObjectsDelegate(self, queue: DispatchQueue.main)                  output.metadataObjectTypes = [AVMetadataObject.ObjectType.qr, AVMetadataObject.ObjectType.dataMatrix]                  video = AVCaptureVideoPreviewLayer(session: session)         video.frame = view.layer.bounds         view.layer.addSublayer(video)                  session.startRunning()     }          func metadataOutput(_ output: AVCaptureMetadataOutput, didOutput metadataObjects: [AVMetadataObject], from connection: AVCaptureConnection) {                  if metadataObjects != nil && metadataObjects.count != nil {                          if let object = metadataObjects.first as? AVMetadataMachineReadableCodeObject { //            if let object = metadataObjects[0] as? AVMetadataMachineReadableCodeObject {                 if object.type == AVMetadataObject.ObjectType.qr {                     let alert = UIAlertController(title: "QR code", message: object.stringValue, preferredStyle: UIAlertController.Style.alert)                     alert.addAction(UIAlertAction(title: "Retake", style: UIAlertAction.Style.default, handler: nil))                     alert.addAction(UIAlertAction(title: "Copy", style: UIAlertAction.Style.default, handler: { (nil) in                         UIPasteboard.general.string = object.stringValue                     }))                                          self.present(alert, animated: true, completion: nil)                 }             }         }              } }
0
0
653
Oct ’20