Posts

Post not yet marked as solved
3 Replies
1.8k 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
1 Replies
329 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
235 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
0 Replies
861 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 not yet marked as solved
4 Replies
2.2k 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
1.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
4 Replies
2.0k 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 marked as solved
1 Replies
1k 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
.
Post not yet marked as solved
4 Replies
5.9k Views
I'm using Xcode 10.1 under macOS 10.13.6. I created a new project from the iOS Master-Detail template. Without changing anything in the new project, I build and run against the new iPad Pro 11" simulator. Same for the new iPad Pro 12.9" 3rd gen.The app is not quite full screen. The status bar is above the top of the app, not in the top of the navbar as expected. The bottom of the app doesn't go all the way to the bottom of the screen. It stops just above that thin bar near the bottom of the screen.This same app run on any of the iPhone X series simulators is completely full screen as expected.What extra steps are required to make an app appear in complete full screen on an iPad Pro 11"? Again, I'm using an unmodified new project from the Master-Detail template.The next issue is setting UIRequiresFullScreen to YES. Doing this results in vertical black bars down the left and right sides of the iPad Pro 11" screen when turned to landscape and smaller horizontal black bars at the top and bottom sides when in portrait. In other words, the app is letterboxed. Why? The letterboxing is also on the new 12.9" iPad but not as large.What extra steps are required to allow an app that requires full screen to actually be full screen and not letterboxed?Perhaps the answer to both of these issues is the same.
Posted
by RickMaddy.
Last updated
.
Post not yet marked as solved
3 Replies
693 Views
Summary:I have had this problem for the last several versions of Xcode. I have a very large iOS app that uses many different frameworks. When I use Xcode to debug my iOS app from my iMac, after just a few seconds of the debugger being connected to my running iOS app, I lose my network connection on my iMac.So far my only solution is to quit Xcode and put my iMac to sleep. After waking the iMac up again, the network connection is restored.Details:My iMac is connected to my local network via ethernet. I am not using Wi-Fi (which is turned off).My iMac is currently running macOS 10.12.6 but the problem has been around with several previous versions. I am currently using Xcode 9 but the problem existed all through Xcode 8 and maybe even Xcode 7 (I forget exactly when it started). I'm not positive but this problem may have started when I added a lot of CloudKit features to my app a while back.Question:1. How do I file a bug report on this? I can't reproduce this problem with any other app, even small test apps using CloudKit. I don't know what useful details I can put in the bug report that would allow Apple to find and fix the problem. I can't send them the complete source code to my iOS app. Are there any specific logs or diagnostic information I can look at?2. Is there a way to restore my network connection without quitting Xcode and putting my iMac to sleep? It's really annoying not being able to do research over the Internet while trying to debug a coding issue.
Posted
by RickMaddy.
Last updated
.