Questions tagged [ios]

iOS is the mobile operating system running on the Apple iPhone, iPod touch, and iPad. Use this tag [ios] for questions related to programming on the iOS platform. Use the related tags [objective-c] and [swift] for issues specific to those programming languages.

ios
Filter by
Sorted by
Tagged with
28 votes
5 answers
11k views

AVAssetExportSession export fails non-deterministically with error: "Operation Stopped, NSLocalizedFailureReason=The video could not be composed."

We add subtitles to a video recorded by the user, but the export by our AVAssetExportSession object fails non-deterministically: sometimes it works, and sometimes it doesn't. It's unclear even how to ...
4 votes
1 answer
8k views

When and How properly deactivate your audio session?

I'm a little bit lost with AVFoundation and you are my last hope ! I am writing a workout app in which I sometimes play short prompts, for instance : "You pedal for 10 minutes" or "Good !" Apple ...
0 votes
1 answer
249 views

What happens to the other NSManagedObjects on a context when context.reset() is called?

I have a scenario where an Entity has many relationships with other entities. I did some changes in the NSManagedObject of the entity and discarded those changes. Right now I'm calling ...
1 vote
2 answers
472 views

What's the main difference between property observers and property wrappers?

What's the main difference between property observers and property wrappers? They seem to be very similar in that they manage how the properties are stored. The only thing I can think of is that you ...
0 votes
3 answers
1k views

Sort NSSortDescriptor by Month of date. Swift

I'm displaying a list of birthdays. I want to sort them in a way that starts with January and Ends with December and the second NSSortDescriptor being day. I want to display a list with the closest ...
1 vote
1 answer
335 views

How to display UILabel one line at a time in Swift

I have a UILabel in a tableView cell that I would like to animate line by line. The string has line breaks with \n and lines.count returns 7 as expected but no line is being added to the label at all ...
2 votes
2 answers
61 views

Why do the results of my search only show up once I begin typing?

I'm implementing a search mechanism into my App, but I have encountered a problem. I can search well, and all the members of my array show up, but this only happens once I have typed something. When ...
-2 votes
1 answer
420 views

Var in extension class show error "Extensions must not contain stored properties"

Since I have many vars and I would like put in new file. When I move var to new file in extension, I got error "Extensions must not contain stored properties". How can I solve it? What is best way to "...
0 votes
1 answer
3k views

Ionic Capacitor can no longer produce a buildable iOS project, CompileAssetCatalog error

Having intractable build issues with Ionic 6.5.0 / Capacitor 2.2.0 I made the app not long ago, but today it won't build. After much fruitless updating/cleaning/building I deleted the ios directory ...
1 vote
1 answer
1k views

Refreshing an Access Token p2/OAuth2 iOS

I'm using p2/OAuth2 with Alamofire v4 as explained in documentation here let sessionManager = SessionManager() let retrier = OAuth2RetryHandler(oauth2: <# your OAuth2 instance #>) ...
3 votes
0 answers
496 views

Detect ios wkwebview resource load failure

I have a url which loads an html file, which in turn loads one more resource (a javascript file) via its script tag. I am loading this url in WKWebView on iOS. If internet is good, then webView(_ ...
2 votes
0 answers
239 views

Acessing iphone with python

I was wondering if there is a tool out there, which I can use to control my iPhone with python, e.g. take screenshots and process them with my laptop and mimic touchscreen input and so on. While ...
10 votes
1 answer
19k views

xcode ios project taking long time to compile and run?

My application is taking very long time around 10 minutes to compile and run on simulator. The application was running fine initially however after adding SUP static library it is taking very long ...
4 votes
1 answer
3k views

Why is Stripe Element not working on iphone but working fine on Android and Desktop?

I'm using an integration of Stripe Element to capture payments and create charges in my phonegapp app. Everything is tested and hosted on HTTPS. On desktop and Android devices I'm able to pay and ...
2 votes
1 answer
103 views

Using CloudKit in a Swift application, is it possible to add the queryable index to the recordName system field in the production infrastructure?

I am trying to add to the recordName of my CKRecords, the queryable index. Unfortunately, I succeed to do so only in the development environment, not for the production. Is it necessary to have the ...
1 vote
1 answer
961 views

How to access the subscriptions from the given publisher? (combine kit)

Is there any way to get the subscriptions by accessing the publisher? In the below example, I created a publisher, and had it subscribed by two subscribers and had the publisher send a value. Here ...
2 votes
1 answer
2k views

getInitialLink is not working but onLink is working in react-native-firebase v6

I am using the following code in App.js - componentDidMount firebase .dynamicLinks() .getInitialLink() .then(link => { if (link) { if (link.url.includes('/s/...
0 votes
1 answer
869 views

Getting errors: framework not found FirebaseCore

I keep getting the following error ld: framework not found FirebaseCore clang: error: linker command failed with exit code 1 (use -v to see invocation) here is the pod file platform :ios, '11.4' ...
0 votes
1 answer
620 views

Attaching advertising payload for iOS without pairing

Anyone know how can a short String or byte array could be transmitted via BLE on iOS without having to pair? According to my research the only 2 keys allowed for startAdvertise method are ...
1 vote
4 answers
3k views

How to pushasync from detailpage in masterdetailpage?

From the detailpage's view I try to push a new page on and I get this error: ** System.InvalidOperationException: Page must not already have a parent. I keep trying different things but nothing ...
0 votes
1 answer
401 views

Didn't receive Notification Center Observer Swift

Here I created a customView: UIView and implemented UITextField didBegin and didEnd notificationObservers When set object as nil. I'm get triggered notificationObserved(_:) But When I pass a (object:...
2 votes
4 answers
2k views

Map annotation display all the same image/pins for all points

I have a conditional statement to add map annotation icons/pins in the method below. The problem I'm having is that the map is being populated with all the same icon. It should detect the cat id and ...
0 votes
1 answer
714 views

Swift: Properly initialize SIMD3 and call it from struct

I am trying call the defined struct so I am able to change its value when a button is pressed. I am having trouble with calling SIMD3 inside a struct. Currently I have, struct CaptureData { var ...
4 votes
1 answer
2k views

Push Notifications no longer working since iOS 13 for Xamarin app

Since the public release of iOS 13 push notifications appear to no longer work for my Xamarin.Forms iOS project. I currently use Azure Notification Hub to send test notifications and previously, my ...
72 votes
6 answers
39k views

Shortcut to generate an NSRange for entire length of NSString?

Is there a short way to say "entire string" rather than typing out: NSMakeRange(0, myString.length)] It seems silly that the longest part of this kind of code is the least important (because I ...
0 votes
2 answers
4k views

What is the SetViewController in IOS

What is the SetViewController in IOS which case developer preferred? what is difference between setViewController and PushViewController in IOS? Please help me Thanks.
0 votes
1 answer
241 views

After installing Firebase with CocoaPod, I can no longer build

I'm trying to build Javascript source code as an iOS app using Cordova. I have introduced firebase with CocoaPods, and I am very troubled because I can not build. this is wannings Ignoring file /...
0 votes
3 answers
488 views

Pass Array from View Controller To View Controller Returns Empty Array

This type of question has been asked and answered, but my specific situation returns an empty array. I first create an array in View Controller 1 (VC1). VC1 includes a collection view. I try to add a ...
0 votes
1 answer
2k views

ReferenceError: Can't find variable: document when importing loadStripe from '@stripe.stripe-js'

While developing an app in React Native intgerating with Stripe, I keep getting a warning [ReferenceError: Can't find variable: document]. I can't get the cause for the error. The only possiblity ...
1 vote
0 answers
188 views

Test flight shows app pop-up without terminating the app (beginBackgroundTask issue)

Some of the tester are getting App crashed pop-up while the app is perfectly working in the foreground. I have implemented crashlytics, but no crash log there. If I ask testers to submit feedback, ...
0 votes
1 answer
268 views

Auto resize custom text field for multiple lines label

I've a custom text field in which I'm adding an error label below text field. I want to resize this custom text field so that it expands with multiple line error label and doesn't overlap with other ...
3 votes
3 answers
3k views

How to connect to MongoDB from iOS (Swift)

I have developed an iOS application using RealmSwift. This works fine so far. Now, as I'm getting closer to publishing into App Store, I wanted to set up some cloud configuration to be able to connect ...
0 votes
1 answer
659 views

How to achieve the parallax effect using UIPointerInteraction for Collection View Cells

I am trying to achieve a parallax effect that is similar to that of tvOS. When a user points to a cell (via a mouse or trackpad in iPadOS), I want the cursor to take the form of the cell. I read and ...
6 votes
2 answers
3k views

iOS: is calling methods of UIApplication in thread other than the main thread safe?

Some say that one must use UIApplication in main thread, but I don't see this documented in Apple's doc. So can someone please tell me if it is safe to use UIApplication in a separate thread? If it is ...
9 votes
8 answers
22k views

Swift replace first character in string

A very simple question, how do I replace the first character of a string. I'm probably doing something totally wrong, but I simply can't get it to work. I have tried this: var query = url.query!....
4 votes
5 answers
20k views

Safari on IOS generates "ReferenceError: Ca ni n't find variable:"

The following code is working correctly for all browsers including Safari on Mac, with the exception of Safari on the iPhone. I have a timer Object that could potentially be running that is defined ...
2 votes
0 answers
59 views

Modules not found when trying to use a new Configuration in a project with multiple Frameworks

I have multiple frameworks for different modules of my application: I'm trying to create multiple targets, each one using a different configuration (development, stage, production). But if I use ...
32 votes
6 answers
28k views

AutoLayout, Unable to simultaneously satisfy constraints

Just started learning iOS AutoLayout, Interface builder very straight forward, but when I try to archive the same thing on the code [self.view addConstraints:[NSLayoutConstraint ...
1 vote
1 answer
6k views

Linking.openURL(url) is not working on iOS (Trying to open Whatsapp)

For some reason, the linking feature to open a whatsapp contact is not working on iOS (it works perfect on Android), i followed the guide on this url for the setup https://reactnative.dev/docs/linking ...
1 vote
1 answer
2k views

Invalid dynamic link when using firebase in iOS

I am working on implementing firebase dynamic links to handle deep link in an app. I followed the documentation here but it doesn't work. The steps I did to configure dynamic links (after ...
6 votes
7 answers
14k views

Open whatsapp on iOS with new phone number pre-filled

I know there is scheme to communicate with whatsapp like: NSURL *whatsappURL = [NSURL URLWithString:@"whatsapp://send?text=Hello%2C%20World!"]; if ([[UIApplication sharedApplication] canOpenURL: ...
1 vote
1 answer
564 views

Xcode skips tests when module stability is enabled

I'm building a dynamic library that has BUILD_LIBRARY_FOR_DISTRIBUTION turned on for module stability. I have a class which is a basic property wrapper that uses generics that is public. When I add ...
2 votes
1 answer
7k views

Xcode ios: Streaming of video file while recording

Can anybody suggest how I can upload video file while recording. As I am recording video using AVFoundation this will save video to some file eg. record.mov . Now my query is how I can upload this ...
1 vote
2 answers
4k views

How to use a custom font in an entire IOS app the right way

I have made a lot of investigation in this topic, but yet, I haven't found a way to set a custom font for an entire IOS app easily. I need to change the whole font for a very large app and I already ...
1 vote
3 answers
7k views

How to integrate Paytm payment gateway in Swift

I have checked all the tutorial and also did a lot of R & D on gateway integration. But didn't find a way to integrate paytm payment gateway. func paymentConfiguration() { var orderDict = [...
0 votes
1 answer
492 views

What is the most optimized way of changing alpha of blended images in CoreImage in Swift

I want to blend two images with darkenBlendMode and using Slider to manipulate alpha of first and second image. Unfortunately my method is laggy on iPhone 6S. I know that problem is in calling "...
1 vote
0 answers
122 views

Move view when keyboard appears

On the screen, I have several test fields for registration. So that the keyboard does not overlap the fields, I change the constraint. But there was a problem. These fields rise on large screens where ...
1 vote
1 answer
2k views

Add highlight/background to only text using Swift

I want to highlight or add a background only on a text on a label that is not center-aligned. I already tried Attributed Strings (https://stackoverflow.com/a/38069772/676822) and using regex but didn'...
0 votes
0 answers
50 views

viewDidAppear runs after segue VC dismissed but not when VC presented by code is dismissed

I have a main VC that navigates to two other VCs in different ways. VC1 by a segue and VC2 using the code below. Both are dismissed in the same same way. VC2 presented using: viewController *...
7 votes
2 answers
9k views

How to make dependent multilevel DropDown in flutter?

I am trying to make dependent multilevel dropdown first contains states list and second contains cities list, all the data fetched from API. Initially, I load state dropdown, when I select the state ...