Posts

Post not yet marked as solved
1 Replies
772 Views
I remember getting a message while running my iOS app on an iOS device that said I have to turn Developer mode on in my iOS device and I found the setting and turned on developer mode. I'm looking for that setting again so I can turn it off on iPhone I use, so that my app can check if Developer mode is on, and if it's not on, certain features are disabled, particularly one that deletes data on the device. That is intended to delete test data. I don't want actual data on my iPhone to be deleted. I need this precaution. When I looked at Developer Settings in Settings app on my iPhone 8 using iOS 15.6.1, there doesn't seem to be any way of turning off developer mode. Is there something I can check on my device that I can use to let my app know that I don't want certain features to be available on my app for that specific device?
Posted Last updated
.
Post not yet marked as solved
0 Replies
554 Views
What App Extensions and Entitlements or any other settings or anything else do I need to do in order to allow my app to use CloudKit sharing to share CKShare.url with other users of my app so that one user can share with another user by sending the URL to my app in addition to other apps such as Messages and Mail?
Posted Last updated
.
Post not yet marked as solved
0 Replies
589 Views
I am using a Share Extension that shares a simple text, thus NSExtensionActivationSupportsText is in my Info.plist. How would I configure UIActivityViewController to enable my app to share test with other uses of my app? Which classses would I need to use? I actually need to pass a URL, more specifically a URL generated by CloudKit framework to use CKShare and UICloudSharingController, but for now I need to learn how to simply share test information.
Posted Last updated
.
Post not yet marked as solved
0 Replies
459 Views
It looks like the Share Extension allows other "host" apps to share content with my "containing" app. How do I share content from my app with other apps using the standard iOS share sheet? I have found information on how to use UISheetPresentationController and UIActivityViewController. What is Apple's designated standard API to share content from my iOS app? I would think their designated way would show all the the apps that the share sheet can share with. Is UIActivityViewController the way that is most intended by Apple to do this?
Posted Last updated
.
Post not yet marked as solved
1 Replies
560 Views
How do I check to see if a CKDatabaseSubscription has already been "saved" in CloudKit for a specific user? The Apple sample CloudKitShare actually has code to create database subscriptions each time the app is launched. If it is already there, the code ignores it.
Posted Last updated
.
Post not yet marked as solved
1 Replies
626 Views
CKDatabase save(_:completionHandler:) has a box that says the following below. Yet when I run the method, the completionHandler runs after the print statement after the call to the save method. I noticed the declaration of the method to be run synchronously has an escaping completionHandler. If the method is run synchronously, doesn't using an escaping completionHandler defeat the purpose of executing the method synchronously, or is the documentation wrong and the method is actually run asynchronously both ways? Concurrency Note You can call this method from synchronous code using a completion handler, as shown on this page, or you can call it as an asynchronous method that has the following declaration: func save(_ record: CKRecord) async throws -> CKRecord For information about concurrency and asynchronous code in Swift, see Calling Objective-C APIs Asynchronously. Here is my essential code with the nonessentials taken out: print("*** 1 before self.privateCloudKitDatabase.save(record)") self.privateCloudKitDatabase.save(record) {       recordReturned, errorReturned in       print("*** 2 closure self.privateCloudKitDatabase.save(record)")     } print("*** 3 after self.privateCloudKitDatabase.save(record)") Here's the debug window: *** 1 before self.privateCloudKitDatabase.save(record) *** 3 after self.privateCloudKitDatabase.save(record) . . . (other print statements) *** 2 closure self.privateCloudKitDatabase.save(record)
Posted Last updated
.
Post not yet marked as solved
1 Replies
970 Views
I'm getting a runtime error in Playground that tells me to run an lldb command. I am not able to type anything in the debug area of Playground as I can in Xcode. How do I use lldb with Playground. Specifically, the error I'm getting is: error: Execution was interrupted, reason: shared-library-event. The process has been left at the point where it was interrupted, use "thread return "-x"" to return to the state before expression evaluation. I'm able to see some of the "stack trace", I think is what it is, when I click on the icon of an eye on the right side of the code editor in Playground, but it only shows a small portion it.
Posted Last updated
.
Post not yet marked as solved
1 Replies
499 Views
I am using Playground, and I am able to set breakpoints in a file in the Source folder, but code execution doesn't stop at the breakpoints. I know the code runs to those points, because there are print statements that print into the debug area that are placed between those breakpoints. What should I do? Is there a setting that would fix this?
Posted Last updated
.
Post not yet marked as solved
3 Replies
1.1k Views
0 How would I update a table view row as as a text field text changes? It is difficult to create a string from the arguments in textField(:shouldChangeCharactersIn:replacementString:) so that the string I create would be equal to the string value of the text property of the text field after the textField(:shouldChangeCharactersIn:replacementString:) occurs. Is there a way to use the UITextInput protocol of UITextField? I haven't found anything on stackoverflow about using the UITextInput protocol of UITextField except a question in 2012 using Objective-C that asks why he's getting a crash.
Posted Last updated
.
Post not yet marked as solved
1 Replies
796 Views
What is the most effective approach to to creating a type of "wizard" interface that takes the user through a process step-by-step, and allows the user to take the steps in any order as he goes along? For instance, the user could start out by selecting from three options: select contacts, select addresses, or selecting a message to send. When he selects one of those options, say select contacts, he sees the interface to allow him to perform that selection, and he sees the other two options to select at any time, which would be select addresses and select message. Say he then selects the option to select a message, he then sees an interface to selecta message and he also sees the other two options. And this continues indefinitely until he selects to send the message. I think the usual view controllers and segues would work for this. Would I need only one subclass of UINavigationController and three subclasses of UIViewControllers? Could this lead to any problems? Is it possible to do this with view controllers and segues? Is there a better way? I do use Swift, but this question doesn't require that I use only Swift, as you can see.
Posted Last updated
.
Post not yet marked as solved
1 Replies
826 Views
The documentation for DispatchQueue.AutoreleaseFrequency.workItem says , "The queue configures an autorelease pool before the execution of a block, and releases the objects in that pool after the block finishes executing." Does this mean that the dispatch queue releases each work item or each code in ()->Void after each one finishes executing? When it says, "releases the objects in that pool er the block finishes executing", it makes it sound like there is only one block executing and then the entire pool is released. I'm making sure I verify that I understand this correctly.
Posted Last updated
.
Post not yet marked as solved
0 Replies
1.3k Views
Why am I not seeing the message instance property of MFMessageComposeViewController? When I type the following, I get a code-time error message in Xcode that says "Value of type 'MFMessageComposeViewController' has no member 'message'" messageComposeViewController.message // error message: "Value of type 'MFMessageComposeViewController' has no member 'message'" There is nothing that explains this in the official Apple documentation: Documentation/Message UI/MFMessageComposeViewController/message
Posted Last updated
.
Post not yet marked as solved
0 Replies
568 Views
I'm curious why I don't see posts about Xcode crashing. Since I updated both macOS Monterey 12.6 and Xcode 14, Xcode repeatedly crashes, becoming more frequently, even within 20 seconds between the last two crashes. Am I the only one getting these crashes?
Posted Last updated
.