Post

Replies

Boosts

Views

Created

How to print double-sided pages using UIPrintInteractionController(AirPrint) in Swift
I'm using UIPrintInteractionController(AirPrint) to print documents in my swift application. I was able to print the documents using my application, but all of them are printing in one-sided. Now i want to add a double-sided printing as an option to my application. After some research i found that it can be implement by adding info.duplex = UIPrintInfo.Duplex.longEdge to printInfo. I tried it using the below code. private var printController = UIPrintInteractionController.shared let info = UIPrintInfo.printInfo() info.duplex = UIPrintInfo.Duplex.longEdge <<<<<< info.jobName = "XXXPrint" info.orientation = .portrait printController.printInfo = info printController.print(to: printer, completionHandler: { [self] controller, completed, error in if(error != nil){ print("successfully") }else{ print("Printing error: \(error.localizedDescription)") } } But whether i set it in the code and run my application it is printing the pages by one-sided. So if some one can guide me to double-sided printing workable solution highly appreciated!!
0
0
1.2k
Jul ’23
Connecting to Wi-Fi programmatically in iOS version(16) with Swift
I want to connect to Wi-Fi programmatically using swift in my iPad application and I want to create according to bellow flow. Enter the network name programmatically Set the programmatically "WAP2-Enterprise" for security. Set username/password. A certificate popup will appear, so tap "Trust". "Turn on the following information." otherwise off. Automatic connection Restrict IP address tracking Set the programmatically IPV4 address below. Configure ID: Manual IP address: 192.XXX.XXX.XXX For tablets, ○○: 1 to 20 Subnet mask: 255.255.255.0 Router: 192.XXX.XXX.XXX Configure DNS server(Set the programmatically) Manual Add server: 8.8.8.8 HTTP proxy(Set the programmatically) Configure proxy: off if anyone you can guide me to proper way much a appreciated!!!
8
0
4.1k
Jun ’23
Which errors can be handled by the UIPrintInteractionController.CompletionHandler
I would like to know what errors can be handled by the UIPrintInteractionController.CompletionHandler.According to the UIKit documentation, four constants were defined for UIPrintError.Code, but that is very rough and I don't know which error codes are returned at specific times. When I print from my iPad using AirPrint, can I get detailed errors such as out of ink, paper jam, or insufficient paper? Also, is there another way to get and handle print errors other than using the UIPrintInteractionController.CompletionHandler?
0
0
1.1k
Mar ’23
Wkwebview SSL Auhtentication with .p12 certificate
I have deployed a angular site with nginx server in GKE and set the SSL authentication. I installed the client certificate using Mobileiron Cloud MDM in my ipad. Then i was able to access and validate the certificate using Safari . But when i trying to do the same thing using my application WkWebView it always giving me the "400 Bad Request" error. After some search i realize that we cannot acces the certificates which installed in the Apple Key chain and it they can be only access by applications Safari or apple Mail app. As a solution for this problem then i set the client certifcate inside App Bundle and was able to do the authentication by importing it using "SecPKCS12Import" and do the authentication. let securityError = SecPKCS12Import(data as NSData,                       [ kSecImportExportPassphrase as String : password ] as CFDictionary,                       &_items); Now WKwebView is loading only if authentication is correct. But for this methos i need to upload the client certificate to my App Bundle. So i would like to know, is there a way to do the SSL authentication in WKWebview without bundeling the client certificate to app bundle. I would like a way that i can deploy it in a remote way like Mobileiron Cloud MDM(i already have the subscription so there is no probles accesing all Mobileriron services.) and access that certifcate to authenticate in the WKWebview url loading.
0
0
1k
Feb ’23
NW7/Codabar type Barcode Reading Using AVFoundation in iOS 16
We are using AVFoundation to create a Barcode/Qrcode reader.In there we created a Qr/Barcode detection square area to show in the middle of the ipad/iphone screen with red color boarder and we were able to read below types Barcode/Qrcode in ios 15.4 within that detection area. Below are the barcode types that we read. private let supportedCodeTypes = [ AVMetadataObject.ObjectType.codabar, AVMetadataObject.ObjectType.qr, AVMetadataObject.ObjectType.upce, AVMetadataObject.ObjectType.code39Mod43, AVMetadataObject.ObjectType.code39, AVMetadataObject.ObjectType.code93, AVMetadataObject.ObjectType.code128, AVMetadataObject.ObjectType.ean8, AVMetadataObject.ObjectType.ean13, AVMetadataObject.ObjectType.aztec, AVMetadataObject.ObjectType.pdf417, AVMetadataObject.ObjectType.itf14, AVMetadataObject.ObjectType.dataMatrix, AVMetadataObject.ObjectType.interleaved2of5] But when we update our source to iOS 16, only "AVMetadataObject.ObjectType.codabar" type barcode cannot read inside the detection area. All other barcode can be detect and read inside detection area. if we expand detection area to full screen "AVMetadataObject.ObjectType.codabar" can be readed. So is there a specific reason for this scenario or is it a problem comes with iOS 16?
0
0
1.3k
Dec ’22