iOS is the operating system for iPhone.

iOS Documentation

Posts under iOS tag

3,217 Posts
Sort by:
Post not yet marked as solved
9 Replies
1.8k Views
Hi, I was working on a feature based on dns packet parsing in the VPN solution of my app on iOS. I was using the dns_parse_packet api from dnsutils.h class, which was able to parse dns requests and reply packets from raw bytes quite efficiently. I had tested this flow on iOS 15.2 but after updating to iOS 15.5 this api does not seem to work anymore. Has this API been deprecated or is this a bug in iOS 15.5?
Posted
by apsakash.
Last updated
.
Post not yet marked as solved
1 Replies
30 Views
Getting memory leak when converting HTML string to AttributedString using below String extension Usage: self.lblHeader.attributedText = "<H1>Hello world</H1><h2><b>, abc</b><h2>".html2AttributedString String extension for converting HTML to attributed string extension String { var html2AttributedString: NSMutableAttributedString? { autoreleasepool { let htmlData = self.data(using: String.Encoding(rawValue: String.Encoding.utf16.rawValue)) let options = [ NSAttributedString.DocumentReadingOptionKey.documentType: NSAttributedString.DocumentType.html ] as [NSAttributedString.DocumentReadingOptionKey : Any] let attributedString = try? NSMutableAttributedString( data: htmlData ?? Data(), options: options, documentAttributes: nil) return attributedString } } } As I found a memory leak due to below the line: let options = [ NSAttributedString.DocumentReadingOptionKey.documentType: NSAttributedString.DocumentType.html ] as [NSAttributedString.DocumentReadingOptionKey : Any] is there any alternative solution? let me know.
Posted Last updated
.
Post not yet marked as solved
0 Replies
14 Views
My app has buttons to set mapView.preferredConfiguration = MKStandardMapConfiguration() // and then mapView.preferredConfiguration = MKImageryMapConfiguration() This works fine unless I zoom in with: self.mapView.region = MKCoordinateRegion(MKMapRect(origin: MKMapPoint(self.coordinate), size: MKMapSize(width: 1000.0, height: 1000.0))) Then I switch between configurations and quickly crash. iOS 16.4. Happens in the simulator or on device. Anyone else seen this?
Posted Last updated
.
Post not yet marked as solved
1 Replies
63 Views
Universal Links usual behaviour on iOS: Users can chose to open Universal Links related to a "xyz.com" domain in Safari by force touching the url. iOS remembers this choice and url's related to that domain will only open in Safari going forward. To change it, user has to force touch the url and choose open in "XYZ" app. Question Is there a way for the developers to know how the Universal link will behave on a user's device? Would it open the app or would it open in Safari?
Posted
by Anupreddy.
Last updated
.
Post not yet marked as solved
0 Replies
33 Views
I have a pretty simple swift code to open Files app and let the user browse to any folder and pick a file. func goToFilesApp() { var documentPicker: UIDocumentPickerViewController if #available(iOS 14, *) { let types: [UTType] = [UTType.text, UTType.vCard, UTType.zip, UTType.gzip] documentPicker = UIDocumentPickerViewController(forOpeningContentTypes: types) } else { let types = [String(kUTTypeText), String(kUTTypeVCard), "com.pkware.zip-archive", "org.gnu.gnu-zip-archive", "org.gnu.gnu-zip-tar-archive"] documentPicker = UIDocumentPickerViewController(documentTypes: types, in: .import) } documentPicker.delegate = self documentPicker.modalPresentationStyle = .formSheet if let view = self.view as? UIViewController { view.present(documentPicker, animated: true, completion: nil) } } and extension AnalyzeFilePresenter : UIDocumentPickerDelegate { func documentPicker(_ controller: UIDocumentPickerViewController, didPickDocumentsAt urls: [URL]) { if let firstUrl = urls.first { manageFilePicked(url: firstUrl) } } } This is working well, but users use this feature very often and under some circumstances the Files app is not remembering the last folder and the user has to browse to their last location (which is a bit annoying). With my iPhone X, ios 15.3.1 and iCloud unactive, this code remembers the last folder accessed. With my iPhone 13 Pro, iOS 16.2 and iCloud active, this code doesn't remember the last folder accessed and instead show a default folder. With this iPhone 13, if the user uses Files app (outside of my app) Files app indeed remembers the last folder, so I guess it's a problem of my app. What could I try? Because every SO answer I've read show this little piece of code I'm using.
Posted
by rferbesa.
Last updated
.
Post not yet marked as solved
2 Replies
143 Views
I am developing an iOS Home Screen widget for our app. The widget renders an image retrieved from the user's photo library in each of its timeline entries. Sometimes in the TimelineProvider.getTimeline(...) method execution stops while accessing the PHAssets. Retrieving the PHAssets from the photo library takes around 700-800ms. Adding logs the method reveals that execution just stops. The timeline's completion handler never gets called. Suspension of the method only happens while not debugging the method. I wonder if there is some kind of limit on how long getTimeline is allowed to execute or on how much data the process is allowed to haul around. Thanks in advance for any information you can provide.
Posted
by Zasdas.
Last updated
.
Post not yet marked as solved
0 Replies
27 Views
I am facing an issue while playing pubg on 14 pro max with guided access on or while screen recording. Whenever one of these feature is on, there is a lot of fps drops. It doesn't matter if I just started playing or if phone's temprature is high, but there's no 90 fps. With both these features off, I get 90 fps. Can someone help me with this issue?
Posted Last updated
.
Post not yet marked as solved
4 Replies
86 Views
Animation is glitching when I tap on search bar Below is the code struct CustomTabBar: View { @State var searchText = "" var data = [1,2,3,4,5,6,7,8,9,10] var body: some View { NavigationStack { ScrollView(.vertical) { ForEach(data, id: \.self) { d in box } } .navigationTitle("Search") .searchable(text: $searchText) } } var box: some View { Rectangle() .frame(width: 75, height: 50) .cornerRadius(10) } }
Posted Last updated
.
Post not yet marked as solved
1 Replies
741 Views
I've developed a ios safari web extension for my app and everything seemed to work fine in the simulator and on my device. However, I've noticed that in some cases when the user tries to give permission to the extension inside safari, the system displays an alert asking for permissions to all the sites saved in the user's keychain. It's really strange. I've not been able to always reproduce this behavior, sometimes it works normally and it asks for permission just for the domain where the user is on. The issue has become a real problem when I've discovered that when the user has a lot of saved passwords for sites in the keychain, the Safari freezes when asking for permission and becomes absolutely unusable, forcing the user to close it. Here is the manifest for my extension: { "manifest_version": 2, "content_security_policy": "script-src 'self' https://ssl.google-analytics.com; object-src 'self'", "background": { "scripts": [ "browser-polyfill.js", "background.js" ], "persistent": false }, "content_scripts": [{ "js": [ "browser-polyfill.js", "document-start.js" ], "matches": [ "http://*/*", "https://*/*" ], "run_at": "document_start" }, { "js": [ "browser-polyfill.js", "contentscript.js" ], "matches": [ "http://*/*", "https://*/*" ], "run_at": "document_idle" } ], "browser_action": { "default_icon": { "19": "assets/images/logos/16x16_logo.png", "38": "assets/images/logos/48x48_logo.png", "48": "assets/images/logos/48x48_logo.png", "64": "assets/images/logos/64x64_logo.png", "128": "assets/images/logos/128x128_logo.png", "256": "assets/images/logos/256x256_logo.png", "512": "assets/images/logos/512x512_logo.png" }, "default_popup": "popup.html" }, "icons": { "16": "assets/images/logos/16x16_logo.png", "48": "assets/images/logos/48x48_logo.png", "64": "assets/images/logos/64x64_logo.png", "128": "assets/images/logos/128x128_logo.png", "256": "assets/images/logos/256x256_logo.png", "512": "assets/images/logos/512x512_logo.png" }, "web_accessible_resources": [ "assets/*" ], "permissions": [ "<all_urls>", "cookies", "storage", "unlimitedStorage", "webNavigation", "notifications", "nativeMessaging" ] } Here is the screenshot of the safari asking for permission to the extension to access 653 different websites that are registered in the user's keychain:
Posted Last updated
.
Post not yet marked as solved
3 Replies
752 Views
Since updating to Xcode 14.3 every view controller in every storyboard is not updating its IBDesignable's with an error saying it can't find the right .app with the right architecture. This all worked fine in Xcode 14.2 I'm running on an M1 mac mini Error below: /Users/****/Documents/Projects/****/****/Modules/Onboarding/Base.lproj/Onboarding.storyboard Failed to render and update auto layout status for ****ViewController (3EC-3V-hGn): dlopen(****.app, 0x0001): tried: '/****' (no such file), '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot****.app' (no such file), '****.app' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64')) I've tried following a stackoverflow post that suggested changing "Build Active Architecture Only" to "No" for debug builds. When I rebuilt I got a prompt from Xcode saying the build failed, and it asked me to turn on Rosetta to try again. I didn't try this as it seemed like this is broken, given it works fine on 14.2
Posted
by simonmcl.
Last updated
.
Post not yet marked as solved
2 Replies
94 Views
Hi community: I'm trying to discover how the dnssec api works, but I cannot get a sample that works with it. Maybe I'm wrong with the requirements; if it is please, clarify it to me. So what I understood. All DNS zones (which respond to TLS listed here https://manage.whois.com/kb/answer/2998) have a way to say, hey I'm who I am. So without any extra configuration, we can use the new API. Is that right? So the code that I did, see the next code let urlSession = URLSession.init(configuration: .ephemeral) if #available(iOS 16.0, *) { urlSession.configuration.requiresDNSSECValidation = true } var request = URLRequest(url: URL(string: "https://www.apple.com")!) if #available(iOS 16.1, *) { request.requiresDNSSECValidation = true } cancellable = urlSession .dataTaskPublisher(for: request) .retryWithDelay(retries: 2, delay: 2, scheduler: DispatchQueue.global(qos: .background)) .sink(receiveCompletion: { result in if case let .failure(error) = result { print("Error \(error)") } }, receiveValue: { (data: Data, response: URLResponse) in print("It Works") Result: Task finished with error [-1001] Error Domain=NSURLErrorDomain Code=-1001, UserInfo={_kCFStreamErrorCodeKey=-2102, NSUnderlyingError=0x600003d86130 {Error Domain=kCFErrorDomainCFNetwork Code=-1001 "(null)" UserInfo={_kCFStreamErrorCodeKey=-2102, _kCFStreamErrorDomainKey=4}}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <040AB9E7-EFCB-4072-8357-E0149769BB9D>.<2>, _NSURLErrorRelatedURLSessionTaskErrorKey=(``` "LocalDataTask <040AB9E7-EFCB-4072-8357-E0149769BB9D>.<2>" ), NSErrorFailingURLStringKey=https://apple.com/, NSErrorFailingURLKey=https://apple.com/, _kCFStreamErrorDomainKey=4} The DNS I'm using is 8.8.8.8. Do you know any other DNS server that supports DNSSEC? If I remove requiresDNSSECValidation from request it works. Also, it's curious that even failing the receiveCompletion is never called. But if I use the dataTask` with completion it's called with the error. Thanks for the clarifications.
Posted
by JesusMG.
Last updated
.
Post not yet marked as solved
0 Replies
29 Views
Hi community. I was looking for a way to make word segmentation of a string without delimiters and spaces. Apple's Natural language framework does not provide this (I think is strange). I want to achieve something like this: Input: "makesenseofthis" Output: ["make", "sense", "of", "this"] Any third party to do it? Maybe is there any Apple API? Thanks in advance
Posted
by JesusMG.
Last updated
.
Post not yet marked as solved
2 Replies
719 Views
Since a recent iOS update somewhere between 16.2 and 16.4.1 a change was introduced that now leads to UICollectionViewController crashing in my app. The crashes are due to the data source being changed without properly updating the ViewController. However the change is made when the UICollectionView is not displayed which used to be allowed but now causes a crash. My scenario is this: UINavigationController UICollectionViewController UIImageViewController My data source is a list of images. When a CollectionView item is tapped the UIImageView will be pushed on top of the navigation stack to display this item. From there it is possible to delete the item which removes it from the data source of the CollectionViewController and leads to the crash. This used to be no problem as the CollectionView is lower on the navigation stack and not displayed at the time the alteration occurs. But this has changed in a recent iOS update. This issue occurs in iOS 16.4.1 and MacOS 13.3.1 (Apple Silicon). Here is the stack: Invalid batch updates detected: the number of sections and/or items returned by the data source before and/or after performing the batch updates are inconsistent with the updates. Data source before updates = { 1 section with item counts: [27386] } Data source after updates = { 1 section with item counts: [27385] } Updates = [ Delete item (0 - 27384), Insert item (0 - 27384) ]
Posted
by Tmmn.
Last updated
.
Post not yet marked as solved
3 Replies
192 Views
Hi All, I am facing with ****** issue, searched through many similar topics, but did not find solution, hope someone can help me! Common information: iOS VPN application min. deployment iOS 15.0 Xcode 14.2 Testing on iPhone with iOS 16.0.2 / 15.5 Problem description Application is builded, installed on iPhone and launched from XCode. After a new VPN configuration is added by application using NETunnelProviderManager. No errors are occurred during all this steps. However I can not enable VPN and in VPN settings I observe "Update required" message: "Application must be updated by the developer before VPN can be connected"
Posted
by Alex_Bu.
Last updated
.
Post not yet marked as solved
0 Replies
25 Views
I work in a fintech company that offers support to Apple Pay in our cards, i.e. our users have the option add their cards to Apple Pay using our app (in-app provisioning). Our company already got the proper In-App provisioning entitlements from Apple and the entire in-app provisioning process is working as expected. When an user taps on the button "Add to Apple Wallet" in our app to provision his card, we call the following code below: let config = PKAddPaymentPassRequestConfiguration() config.cardholderName = "\(firstName) \(lastName)" config.localizedDescription = "MyApp Card" config.primaryAccountSuffix = String(cardSuffix) config.paymentNetwork = .visa // Present the Apple Pay ViewController let controller = PKAddPaymentPassViewController(requestConfiguration: config, delegate: self) UIApplication.shared.delegate?.window??.rootViewController?.present(controller!, animated: true) If the user has an Apple Watch paired, he is greeted with a screen asking him to select on which device he wants to add the card: on his iPhone or on the Apple Watch (please see the screenshot attached). After the user selects the device, the provisioning process continues successfully as expected. However, if the user taps on the "Add to Apple Wallet" button and he already has the card added to one of the devices (the Apple Watch, for example), then the code above is called again, but he is once again greeted with the same screen asking him to select on which devices he wants to add the card, on his iPhone or on his Apple Watch, even though the card is already added on the Apple Watch. The way I understand it, since the card is already added on the Apple Watch, only iPhone should appear as a valid option to have the card added. Is there anything else that I need to do in the code above to make sure only the available devices (I mean, only the devices that don't have the card added on Apple Pay yet) are listed in the device selection? I have tried following code.. but not worked.. let config = PKAddPaymentPassRequestConfiguration() config.cardholderName = "\(firstName) \(lastName)" config.localizedDescription = "MyApp Card" config.primaryAccountSuffix = String(cardSuffix) config.paymentNetwork = .visa config.primaryAccountIdentifier = "some unique identifier"
Posted Last updated
.
Post not yet marked as solved
3 Replies
85 Views
Below resources says that I cannot. I don't see satellite count related API in Core Location framework document also. 1)This is not possible using any publicly available iOS API. (2012/11/8) https://stackoverflow.com/a/13309242/809671 2)There is no public available API that allows you to get this kind of detailed information about the GPS satellites. (2010/8/24) https://stackoverflow.com/questions/3555732/is-there-a-way-to-get-detailled-gps-satellites-info-on-iphone 3)Confirmed that your app does not have access to the private API used to suss that information. (2017) https://developer.apple.com/forums/thread/73220 4)Since ios does not provide the number of satellites, and since phone gap is designed as a subset of functionality that runs on all phoneplattform, the num satellites is not available. (2015/11/4) https://stackoverflow.com/questions/33516688/phonegap-cordova-get-number-of-gps-satellites 5)The Public SDK doesn't expose that. (2009/12/17) https://stackoverflow.com/questions/1919553/is-it-possible-to-get-gps-satellite-numbers-via-iphone-sdk 6)Can iOS 8 provide info on satellites? No. (2014/8/20) https://forums.macrumors.com/threads/can-ios-8-provide-info-on-satellites.1766861/ Above posts are little old so I want to double confirm. If an Apple developer can reply this then it would be better thanks.
Posted
by Roflbot.
Last updated
.
Post not yet marked as solved
2 Replies
65 Views
More and more routers are establishing Wi-Fi networks with a mixed frequency band of 2.4G and 5G, but most smart accessory (IoT devices) only support 2.4G Wi-Fi. Our business requires us to determine the current Wi-Fi frequency band information that iOS is connected to, and if it is 5G, provide a reminder to the user.
Posted
by yuyuyuguo.
Last updated
.
Post not yet marked as solved
1 Replies
58 Views
I am seeing an interesting behavior on iOS 16.4+ when I set NEVPNProtocol includeAllNetworks flag to TRUE as part of my tunnels's saved preferences. After my packet tunnel provider starts up and goes through the usual setup of adding routes, where let's say we just just add NEIPv4Route.default() to route everything and eventually setting via: setTunnelNetworkSettings. Any subsequent calls to cancelTunnelWithError will cause the phone to get into a state where the tunnel provider goes away but it appears that my routes did not properly clean up, essentially causing a device to get into a state where all network traffic is now dead. The only way to recover is to go into OS Settings -> VPN and change selected profile to some other one, or just remove ours and go through installation again. It appears to only be happening on iOS 16.4+ devices, any previous versions clean up just fine. Curious if anyone has seen such behavior? Thanks in advance.
Posted Last updated
.