Posts

Post not yet marked as solved
1 Replies
201 Views
I have created a custom input field by conforming to UITextInput. It is setup to use UITextInteraction. Everything works very well. If the user taps on the custom field, the cursor (provided by UITextInteraction) appears. The user can type, select, move the cursor, etc. But I'm stumped trying to get the cursor to appear automatically. With a normal UITextField or UITextView you simply call becomeFirstResponder(). But doing that with my custom UITextInput does not result in the cursor appearing. It only appears if the user taps on the custom field. I don't know what I'm missing. I don't see any API in UITextInteraction that can be called to say "activate the cursor layer". Does anyone know what steps are required with a custom UITextInput using UITextInteraction to activate the cursor programmatically without the user needing to tap on the custom field?
Posted
by RickMaddy.
Last updated
.
Post not yet marked as solved
1 Replies
323 Views
Is there any way for a 3rd party macOS app to receive some sort of notification for a change to the Text Size accessibility setting in the Settings app? I have not been able to find any API for this. Several Apple apps (Mail, Notes, and others) update text size based on the setting. I'd like to do the same in my own macOS app.
Posted
by RickMaddy.
Last updated
.
Post not yet marked as solved
3 Replies
633 Views
Background: I've had an app in the iOS app store for many years. Quite recently I published a Mac version of the app. The Mac version uses the same bundle id and the app is setup in App Store Connect to be the same app. It's my understanding that with this setup, if a user purchases the iOS version, they don't need to pay for the macOS version (or vice versa). The iOS app started out as a paid app and was later transitioned to a free app with in-app purchases. The new macOS version also supports the same IAPs. If it makes a difference, the macOS version is built from the iOS code base using Mac Catalyst. The app uses old StoreKit1 on-device receipt validation. Issue: I have a longtime user of the iOS app that has recently installed the macOS version. Their attempt to restore purchases in the macOS version is not resulting in anything being restored. The user originally purchased the old iOS version before it had any in-app purchases. I log diagnostic info in the app and the user sent me those logs. One of the things I show in the log is information from the receipt. The on-device receipt validation my app does is indicating it is a valid receipt. The problem is that the receipt states the original version of the app corresponds to the new macOS build. i would expect the receipt to show the version originally purchased years ago on iOS. Question: What is supposed to happen in a case like this? When the macOS version of the app requests (and gets) an updated receipt, is the receipt supposed to show the original version as the first macOS version of the app or is it supposed to show the first downloaded version, regardless of OS? What is the correct logic for restoring purchases if the macOS receipt has no indication of the user ever having used the iOS version for years?
Posted
by RickMaddy.
Last updated
.
Post marked as solved
1 Replies
876 Views
I have a brand new macOS app (built with Mac Catalyst and based on a long existing iOS app) I've submitted to App Store Connect for review. It was rejected due to my Contacts purpose string not being deemed sufficient (despite being the same one the iOS version of the app has been using for years). Anyway, I made a change to the privacy string and submitted a new build. The new build was rejected and a screenshot showed the About screen with the new build number as well as the privacy string from the original build, not the new build. So I verified that my archive did in fact have an Info.plist with the updated privacy string. So I resubmitted that build again for review and it was rejected again for the same reason. Despite the reviewer claiming, at my request, that a fresh install of the latest build was used. So I changed the privacy string again and submitted a 3rd new build, again verifying the archive that I was sending through the Xcode Organizer did have the updated (now 3rd) privacy string. And again the app has been rejected. Despite 2 new builds, the reviewers are still seeing the original privacy string. Does anyone have any ideas on how to get this resolved?
Posted
by RickMaddy.
Last updated
.
Post marked as solved
3 Replies
831 Views
While working on the Mac Catalyst version of my iOS app, I noticed something interesting. I have a UITextView with the allowsEditingTextAttributes property enabled. When running the app on a Mac, the context menu that appears when right-clicking inside the UITextField includes the menu item "Import from iPhone or iPad". That brings up a menu with 3 options each for my iPhone and iPad that I happen to connected to my Mac recently. There options include "Take Photo", "Scan Documents", and "Add Sketch". I created a brand new iOS app project and simply added a UITextView to the main view controller. After setting allowsEditingTextAttributes to true, it shows the same behavior. Some questions: Is this documented anywhere? I'm guessing this is related to Continuity Camera in some way. But there's no mention of this anywhere that I've seen so far. How can I prevent this menu from appearing? Nothing related to these menus comes through the canPerformAction(_:withSender:) method. And nothing related to these menus is part of the menu item array sent to the UITextViewDelegate textView(_:editMenuForTextIn:suggestedActions:) method. I need to remove this menu in my app because while I support some text attributes (bold, italic, underline), I do not want to allow pictures to be added. Does anything else in iOS under Mac Catalyst automatically get similar support? If so, what?
Posted
by RickMaddy.
Last updated
.
Post marked as solved
5 Replies
3.3k Views
My own iOS app is using AVFoundation to do barcode scanning. Under Mac Catalyst I'm getting an error. Turns out the Apple provided AVCam demo app has the exact same issue.Both the Swift and Objective-C versions of the AVCam demo app fail but the Objective-C version gives a better error so I'll refer to that in the rest of the question.In the AVCamCameraViewController, the configureSession method fails on the line:AVCaptureDeviceInput* videoDeviceInput = [AVCaptureDeviceInput deviceInputWithDevice:videoDevice error:&error];The error is:Could not create video device input: Error Domain=AVFoundationErrorDomain Code=-11814 "Cannot Record" UserInfo={NSLocalizedDescription=Cannot Record, NSLocalizedRecoverySuggestion=Try recording again.}It turns out that none of the three attempts to call [AVCaptureDevice defaultDeviceWithDeviceType:... are succeeding.This is the same error I get in my own app though I only attempt to call [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo]; which is also returning nil.Permission was granted for the app to access the camera.There is nothing related to this issue in the release notes for macOS 10.15. I am running the GM version of 10.15 with Xcode 11.1 on a 2018 15" Macbook Pro.How do we successfully get a video capture device under Mac Catalyst?
Posted
by RickMaddy.
Last updated
.
Post not yet marked as solved
2 Replies
2.4k Views
In my iPad app running under macOS Catalyst I would like to modify the context menu that appears when you right-click on a UITextViiew but I can't figure out how.I have overridden the buildMenuWithBulder:/buildMenu(with:) method from UIResponder in my view controller and app delegate but none are called when right-clicking on a UITextView.I have been able to disable a couple of the menu options by subclassing UITextView and overriding the canPerformAction:withSender:/canPerformAction(_:withSender:) and targetForAction:withSender:/target(_:withSender:) methods but I can't remove/disable most of the menu.I also overrode the validateCommand:/validate(_:) method in my UITextView subclass and that was only called for a small subset of the menus I wish to remove/disable.The Menus sample app only shows how to modify the app's main menu and how to add a context menu to a view controller but there is no info on how to modify the context menu of a control such as UITextView.Does anyone know how to do this?Specifically I want to remove the Show Fonts and Show Colors menus under Font and I wish to remove the whole Substitutions menu. The allowsEditingTextAttributes property of the text view is enabled which is what makes the Font portion of the menu appear. I want to keep the Bold/Italic/Underline toggles.
Posted
by RickMaddy.
Last updated
.
Post marked as solved
1 Replies
2.2k Views
I have an Intel Mac running macOS Monterey 12.6. I'm running Xcode 14.2. I created a new iOS project. I deleted the "Mac (Designed for iPad)" destination and added the "Mac (Mac Catalyst)" destination. Unlike the iOS minimum deployment target, oddly there is no place to set the macOS minimum deployment target. I had to go to the target's Build Settings and change it there. I then chose "My Mac (Mac Catalyst)" as the build target and built the project. So far, so good. I then tried to run the app. I get a dialog with the following message: Could not launch “SampleApp” The app is incompatible with the current version of macOS. Please check the app's deployment target. Clicking on the Details button gives lots of info. Some things I see are: ... "device_osBuild" = "12.6 (21G115)"; ... "sdk_canonicalName" = "macosx13.1"; "sdk_osVersion" = "13.1"; But I'm not running macOS 13.1. I have macOS 12.6. Oddly there's no mention of the deployment target being set to 12.4 (which I set in the target's Build Settings). If I go to Xcode -> Preferences -> Platforms, I see "macOS 13.1" listed as built-in. Tapping on the + button there is no option for macOS. So my question is how do I support running a Mac Catalyst app on an Intel Mac running macOS 12.6 while using Xcode 14.2? Can it be done? What steps do I need to take? I've reloaded the project. I've restarted Xcode. I've done a clean build. Nothing changes.
Posted
by RickMaddy.
Last updated
.
Post not yet marked as solved
4 Replies
5.5k Views
Working on the Mac Catalyst version of an iPad app. I don't know if this is a bug, intended behavior, or a setting I am missing. But how do you change (or what value is used) the app name shown in the main menu and the About box? For example, let's say my app's "Bundle name" in Info.plist is "MyCoolApp" and the "Bundle display name" is "My Cool App". When the app is run on iOS, I see "My Cool App" under the icon on the home screen. Perfect. But on the Mac, the app's main menu shows "MyCoolApp". Tapping on that menu includes the "About MyCoolApp" menu. The About box also shows "MyCoolApp" under the app icon. Other standard default menus also reference "MyCoolApp". I want all of those to show "My Cool App", not "MyCoolApp". What needs to be changed to get the "Bundle display name" to be used?
Posted
by RickMaddy.
Last updated
.
Post not yet marked as solved
0 Replies
725 Views
As best as I can tell, the only messages sent to a MEMessageActionHandler for processing are those going to the Inbox. I'm trying to write a Mail extension that processes incoming messages, most importantly those that go straight to the Junk folder, but none of those messages go to the extension. Is there some setting I may be missing or can a MEMessageActionHandler only process emails going to the Inbox?
Posted
by RickMaddy.
Last updated
.
Post not yet marked as solved
1 Replies
785 Views
Just watched the Targeting Content with Multiple Windows video. My app uses UIApplicationShortcutItem and UIApplication.shortcutItems.So I thought it would be useful to set the targetContentIdentifier property of each shortcut item so when the user selects one of the shortcuts, they can be brought to the mose appropriate scene in the app.But UIApplicationShortcurItem targetContentIdentifer is a read-only property. Is this is mistake?The documentation for UISceneActiviationConditions states (emphesis mine):Many different objects contain a targetContentIdentifier property, including NSUserActivity, UNNotificationContent, and UIApplicationShortcutItem. When creating those objects, fill that property with a value that uniquely describes the event and matches your scenes' predicates.Kind of hard to do when the property is read-only.Am I missing something or is this an API bug?
Posted
by RickMaddy.
Last updated
.
Post not yet marked as solved
0 Replies
612 Views
For the stock Camera app there is a Grid setting. Is there any way to get a UIImagePickerController with a source type of Camera to honor that Grid setting? Or would this need to be an enhancement request for Apple?
Posted
by RickMaddy.
Last updated
.
Post not yet marked as solved
4 Replies
3.3k Views
Create a simple empty sample project. Enable Mac Catalyst. Build and run on your Mac. Now close the one window and note that the program actually terminates and the debugger session ends. Perfect.Unfortunately my actual app doesn't terminate when the one and only app window is closed. If I close the window the program keeps running. The window is gone but it doesn't terminate. Clicking on the pause icon in the debugger and looking at the thread stacktraces doesn't show anything of my own code running.If I pause the app every once in a while and look at the threads, while none seem to show anything really happening, new threads are being created and finshed. But these transient threads rarely show more than a single stack entry with things like "start_wqthread" or "__workq_kernreturn".I even went so far as commenting out everything possible in the app delegate and scene delegate such that my app didn't run any code except creating an empty window with no root view controller and it still won't terminate when the (empty) window is closed. Of course the app still has a whole bunch of frameworks and pods linked in.So I'm looking for ideas on what could possibly make an iOS app running under Mac Catalyst fail to terminate when the last window is closed.I tried to look at the memory graph but Xcode just gives an error (Unable to acquire required taks port). But I get that with any Mac Catalyst app.I'm stuck and this failure to terminate is causing problems.Thanks for any ideas.
Posted
by RickMaddy.
Last updated
.
Post marked as solved
1 Replies
2.6k Views
I'm opening multiple scenes in the Mac Catalyst version of my iPad app. The problem is that all of the windows simply show my app name in each window title. This makes it confusing looking at the list of windows in the Window menu. Plus I want to specific information to appear in the window title beside the app name.UIWindowScene has a promising Mac Catalyst-only property named titleBar of type UITitleBar. Sounds promising but it has nothing related to setting any kind of title. Strange.There's nothing I can find in the UIScene or UIWindow classes or anything related to scenes.Is there any way to set a window's title in a Mac Catalyst app?
Posted
by RickMaddy.
Last updated
.
Post marked as solved
1 Replies
1.7k Views
I know that the `UISceneDelegate scene(_:openURLContexts:)` delegate method is meant as the `UIScene` equivalent of the `UIApplicationDelegate application(_:open:options:)` delegate method. But an app can have multiple active scenes while only one will have this delegate called at a time and it always seems to be the "first" scene.Is there any condition or action that will result in a specific scene (and not just the "first" one) having its `openURLContexts` delegate called or did this turn out to be a flawed design? What am I missing?Let me clarify the situation with an example.You have an app that supports multiple scenes in iPadOS. The user is actively using two side-by-side scenes for your app. There may even be some disconnected scenes in the background. Either way, assume there are multiple scenes.Let's also say that your app can open files of certain types. The user switches from your app to the Files app or just about any app that lets you share a file. In the other app you select a file and choose to open it with your (multi-scene) app.At this point your app is put back in the foreground and the `openURLContexts` delegate is called on just one of the currently active scenes in your app.The same issue arises if your app supports a custom URL scheme and your app is launched (or brought back to the foreground) via its custom URL scheme.So what's the point of this being done on the scene delegate? There are multiple scenes. Only one has this delegate called. Depending on the needs of your app, you probably only want to handle this file in one specific scene but it may not be the scene whose delegate was called. You need to write code to go through the existing scenes and determine which one should actually handle the file, regardless of the scene that was called.Given this, wouldn't it have been better to just call the `UIApplicationDelegate` to handle the open URL request? Or, as stated in my original question in the second paragraph, are there conditions that call the delegate on a specific scene?
Posted
by RickMaddy.
Last updated
.