So experimenting with UISplitViewController on Mac Catalyst. I have a triple split. The primary view controller is a sidebar. I have the default sidebar button showing in the toolbar and that collapsed/expands the sidebar fine. But when I drag to try to collapse the split (as is typical on macOS) the sidebar doesn't collapse. It clamps to the min. size. Is there anyway to enable this? I tried passing 0 to -setMinimumPrimaryColumnWidth: but that didn't work.
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
My UISplitViewController is configured like this:
A list (collection view) is used in the primary view controller (sidebar style).
When a selection is made in the primary view controller a table view displays data in the supplementary column.
When a selection is made in the supplementary view controller, a view controller with scrollable content is shown in the secondary view controller.
This is like the Mail app on Mac. So when I run the app I hit the tab key once and the list (collection view) in the primary column gets focus. I can navigate the list with the keyboard. This works as expected.
So now with a selection in the list, a table view is showing in the supplementary column. I hit the tab key again and the table view gets focus. This works as expected as I can navigate the table view from the keyboard with the arrow keys.
Now with a selection made in the table view, the scrollable view controller is showing in the secondary view controller column. I hit the tab key again and focus goes back to the list in the primary column. This is not the expected behavior. I'd expect hitting tab would move focus to the scroll view in the secondary column instead of jumping back to the primary column (as I should be able to scroll the scroll view in the secondary column with the up and down arrow keys). The user is then required to click on the secondary view controller in order to scroll it with the arrow keys. This breaks full keyboard navigation.
The behavior I'm after is actually the default behavior in the Mail app but I can't figure out how to get it to work in Mac Catalyst?
I have a UICollectionView in the list style. I have cells that use UIListContentConfiguration. All this is set up in the normal way:
UIListContentConfiguration *contentConfig = cell.defaultContentConfiguration;
contentConfig.text = @"Bla text";
cell.contentConfiguration = contentConfig;
But I can't figure out how to make the text selectable on Mac Catalyst with the mouse? On iOS this is okay (though selectable text would be nice there too) but on Mac users would really expect the text to be selectable in this area of my app's UI. Is there anyway to configure this?
On app launch I'm trying to specify a reasonable initial value for the window's frame.
Using the recommended API I create a UIWindowSceneGeometryPreferencesMac object and pass it to -requestGeometryUpdateWithPreferences:errorHandler: in -scene:willConnectToSession:options:
This method respects the value passed in as the size but does not seem to respect the requested origin. Initially I'm always placed at origin 0, 0 for the first window which doesn't look particularly good. I think I'd like to be inset on the x-axis a bit, or maybe even position the window in the center of the screen on app launch.
Is there anyway to get more control over the window frame on Mac Catalyst?
In the WWDC 2022 video "Bring your iOS App to the Mac" there is sample code which shows the recommended way to set the default window size for a new window. According to the presenter it is considered good practice to do this in -scene:willConnectToSession:options:
CGRect systemFrame = scene.effectiveGeometry.systemFrame;
CGRect newFrame = CGRectMake(systemFrame.origin.x,
systemFrame.origin.y,
defaultWindowSize.width,
defaultWindowSize.height);
UIWindowSceneGeometryPreferencesMac *geometryPrefs = [[UIWindowSceneGeometryPreferencesMac alloc]initWithSystemFrame:newFrame];
[scene requestGeometryUpdateWithPreferences:geometryPrefs errorHandler:^(NSError * _Nonnull error)
{
//Error
}];
So I have a button in my UI that opens a new window that uses this window scene delegate class. I have a laptop and external display connected. Now my app's window is on the external display and when I click the button the opens the new window, the new window opens on the laptop's main display (the display physically attached). This is wrong.
Setting the requestingScene property on UISceneActivationRequestOptions makes no difference, the new window still opens on the wrong display no matter what.
If I comment out the above code that sets the initial window size... the window opens on external display as expected (but now I've lost my window size).
Shortly after presenting a UIDocumentPickerViewController on Mac Catalyst the system throws this exception and I keep hitting my exception breakpoint:
NSView: valueForUndefinedKey this class is not key value coding-compliant for the key cell.
Appears to be related to the system using Touch Bar APIs (my app isn't currently using Touch Bar APIs directly but the NSOpenPanel created by UIDocumentPickerViewController is).
#2 0x0000000198de2828 in -[NSObject(NSKeyValueCoding) valueForUndefinedKey:] ()
#3 0x000000019884ef3c in -[NSObject(NSKeyValueCoding) valueForKey:] ()
#4 0x0000000200b75a68 in -[NSObject(UIAccessibilitySafeCategory) __axValueForKey:] ()
#5 0x0000000200b75960 in __57-[NSObject(UIAccessibilitySafeCategory) safeValueForKey:]_block_invoke ()
#6 0x0000000200b75f9c in -[NSObject(UIAccessibilitySafeCategory) _accessibilityPerformSafeValueKeyBlock:withKey:onClass:] ()
#7 0x0000000200b754d0 in -[NSObject(UIAccessibilitySafeCategory) safeValueForKey:] ()
#8 0x0000000222206b60 in -[NSTouchBarItemAccessibility__UIKit__AppKit _accessibilityPopulateAccessibiltiyInfoFromUIKit] ()
#9 0x0000000222206b1c in -[NSTouchBarItemAccessibility__UIKit__AppKit _itemViewMinSize:maxSize:preferredSize:stretchesContent:] ()
#10 0x000000019b3f70bc in -[NSCompressionGroupLayout item:minSize:maxSize:preferredSize:] ()
#11 0x000000019aff24f4 in -[NSTouchBarItemContainerView _updateMeasuredSizes] ()
#12 0x000000019aff2358 in -[NSTouchBarItemContainerView minSize] ()
#13 0x000000019accae98 in -[NSTouchBarLayout _aggregateWidthOfItems:sharesLeftEdge:sharesRightEdge:widthMeasurement:] ()
#14 0x000000019accb22c in -[NSTouchBarLayout _attributesOfItems:centerItems:givenSize:sharesLeftEdge:sharesRightEdge:xOrigin:] ()
#15 0x000000019acca930 in -[NSTouchBarLayout attributesOfItems:centerItems:givenSize:] ()
#16 0x000000019b52bbb0 in -[NSTouchBarView _positionSubviews] ()
#17 0x000000019b52ba6c in -[NSTouchBarView layout] ()
--
The exception does get caught (my app doesn't crash) but I hit the exception breakpoint over and over again while the NSOpenPanel is on screen which is annoying.
I have a UITabBarController on Mac Catalyst. Since the UITabBar isn't really nice on Mac, I set the UITabBar to hidden.
Then I create a Mac styled NSToolbar with selectable items and manually change the UITabBarController selection with the NSToolbar selection (like the UITabBar would do normally on iOS).
This works fine until I select view controller at index 7 or greater. Then all of a sudden an iOS styled UINavigationBar appears. UITabBarController is wrapping view controllers at index 7 or greater in the "More Navigation Controller" which is not desired or needed (the window width is wide enough to avoid clipping, and the UITabBar is not even visible).
I'm getting some new behavior I haven't seen before (on Venture 13.2.1) on UITableView.
Steps to reproduce:
A table view row is selected and I swipe to delete the selected row.
After about a half of a second the table view selects another row.
I'm not programmatically making a selection here after the swipe to delete. UIKit is doing it.
I set a breakpoint in -tableView:didSelectRowAtIndexPath: and it is related to the focus system:
#1 0x00000001b350b140 in -[UITableView _selectRowAtIndexPath:animated:scrollPosition:notifyDelegate:isCellMultiSelect:deselectPrevious:performCustomSelectionAction:] ()
#2 0x00000001b3512df8 in -[UITableView _didUpdateFocusInContext:withAnimationCoordinator:] ()
#3 0x0000000213b38988 in -[UITableViewAccessibility _didUpdateFocusInContext:withAnimationCoordinator:] ()
#4 0x00000001b2f54260 in __84-[UIFocusSystem _sendDidUpdateFocusNotificationsInContext:withAnimationCoordinator:]_block_invoke ()
#5 0x00000001b2f08944 in _UIFocusEnvironmentEnumerateAncestorEnvironments ()
#6 0x00000001b2f54480 in -[UIFocusSystem _sendNotificationsForFocusUpdateInContext:withAnimationCoordinator:usingBlock:] ()
#7 0x00000001b2f53ff0 in -[UIFocusSystem _sendDidUpdateFocusNotificationsInContext:withAnimationCoordinator:] ()
#8 0x00000001b2f53630 in -[UIFocusSystem _updateFocusWithContext:report:] ()
#9 0x00000001b2f5319c in -[UIFocusSystem updateFocusIfNeeded] ()
#10 0x00000001b2f561dc in __43-[UIFocusSystem _updateFocusUpdateThrottle]_block_invoke ()
#11 0x00000001b3725e70 in -[_UIAfterCACommitBlock run] ()
#12 0x00000001b37262cc in -[_UIAfterCACommitQueue flush] ()
#13 0x00000001b2851630 in _runAfterCACommitDeferredBlocks ()
#14 0x00000001b28513ac in _cleanUpAfterCAFlushAndRunDeferredBlocks ()
#15 0x00000001b28512c8 in _afterCACommitHandler ()
#16 0x00000001887b0db8 in CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION ()
#17 0x00000001887b0ca4 in __CFRunLoopDoObservers ()
This wasn't happening before. I'm not sure if it is related to the Ventura 13.2.1 update or if there is some minor tweak on my end that is causing this change in behavior though I'm not thrilling with UIKit making a selection without asking me about it.
I could live with the automatic row selection if the next row below the deleted row was automatically selected but sometimes it is not. Sometimes UITableView is auto selecting a row two cells back which doesn't make any sense to me.
So I copy a link to the pasteboard in Mac Catalyst. I can do this directly or by using system provided "Copy" in WKWebView from the WebUIDelegate method -webView:contextMenuForElement:willCommitWithAnimator: (which creates a "Copy Link action in the system provided "suggested actions").
So when I copy a link on Mac Catalyst like this:
[UIPasteboard generalPasteboard].URLs = @[urlToCopy];
And I try to paste it in Xcode (assuming I'd be pasting the URL string in this context) Xcode plays NSBeep and nothing is pasted. I have to paste the link in TextEdit in a Plain Text Document, select the text, copy it again and then paste it back in Xcode.
I'm having a pretty bad day here. Almost nothing is working.
In Xcode 15 Live Previews are available for UIKit view controllers and views. However I noticed they do not work if the deployment target is < 17.0.
If I try to make a live preview for a view controller like so:
#Preview {
let someVC = ViewController()
return someVC
}
It doesn't load.
The error is described below:
== PREVIEW UPDATE ERROR:
CompileDylibError: Failed to build ASwiftViewController.swift
Compiling failed: module 'SwiftUI' has no member named 'VStack'
If I raise the deployment target to iOS 17 it starts working.
I'm using AVAudioEngine to play AVAudioPCMBuffers. I'd like to synchronize some events with the playback. For example if the audio's frame position is >= some point && less than some point trigger some code.
So I'm looking at - (void)installTapOnBus:(AVAudioNodeBus)bus bufferSize:(AVAudioFrameCount)bufferSize format:(AVAudioFormat * __nullable)format block:(AVAudioNodeTapBlock)tapBlock;
Now I have frame positions calculated (predetermined before audio is scheduled I already made all necessary computations) . So I just need to fire code at certain points during playback:
[playerNode installTapOnBus:bus
bufferSize:bufferSize
format:format
block:^(AVAudioPCMBuffer * _Nonnull buffer, AVAudioTime * _Nonnull when) {
//Inspect current audio here and fire...
}];
[playerNode scheduleBuffer:fullbuffer
atTime:startTime
options:0
completionCallbackType:AVAudioPlayerNodeCompletionDataPlayedBack
completionHandler:^(AVAudioPlayerNodeCompletionCallbackType callbackType)
{
// some code is here, not important to this question.
}];
The problem I'm having is figuring out at what point in full buffer I'm at within the tap block. The tap block passes chunks (not the full audio buffer). I tried using the when parameter of the block to calculate the frame position relative to the entire audio but have be unsuccessful so far. I'm assuming the when parameter is relative to the buffer passed in the tap block (not my entire audio buffer I scheduled).
Not installing a tap and just using a timer before scheduling my fullBuffer has given me good results but I'd rather avoid using a timer if possible and use sample time.
Topic:
Media Technologies
SubTopic:
Audio
Tags:
AVAudioNode
AVAudioSession
AVAudioEngine
AVFoundation
I have a simple little Mac app that embeds a Python interpreter. I wrote this app almost ten years ago and completely forgot about it. Anyway I submitted an update to it with a new version of Python but it's being rejected by App review for the following reason:
Your app uses or references the following non-public or deprecated APIs:
Symbols:
• _Tcl_NewByteArrayObj
• _Tcl_ResetResult
• _Tcl_MutexLock
• _Tcl_GetBooleanFromObj
• _Tcl_SetObjResult
• _Tcl_CreateInterp
• _Tcl_ThreadQueueEvent
• _Tcl_UnsetVar2
• _Tcl_GetBignumFromObj
• _TclBN_mp_to_unsigned_bin_n
• _Tcl_ListObjLength
• _Tcl_ConditionWait
• _Tcl_GetDouble
• _Tcl_GetDouble
• _Tcl_DeleteFileHandler
• _Tcl_SetVar
• _Tcl_SetVar
• _Tcl_SetVar
• _Tcl_DoOneEvent
• _TclFreeObj
• _Tcl_Eval
• _Tcl_Eval
• _Tcl_Eval
• _Tcl_FindExecutable
• _Tcl_NewLongObj
• _Tcl_CreateTimerHandler
• _Tcl_Init
• _Tcl_ConditionFinalize
• _Tcl_GetByteArrayFromObj
• _Tcl_ListObjIndex
• _Tcl_ExprLong
• _Tcl_NewDoubleObj
• _Tcl_GetDoubleFromObj
• _Tcl_ExprString
• _TclBN_mp_read_radix
• _Tcl_DeleteTimerHandler
• _Tcl_CreateFileHandler
• _Tcl_GetVar
• _Tcl_GetVar
• _Tcl_CreateObjCommand
• _Tcl_SetVar2Ex
• _Tcl_GetStringFromObj
• _Tcl_NewStringObj
• _Tcl_GetObjType
• _Tcl_MutexUnlock
• _Tcl_DeleteCommand
• _TclBN_mp_init
• _Tcl_GetCurrentThread
• _Tcl_ExprDouble
• _Tcl_AddErrorInfo
• _Tcl_Free
• _Tcl_GetStringResult
• _Tcl_SetVar2
• _Tcl_SetVar2
• _Tcl_GetBoolean
• _Tcl_GetBoolean
• _Tcl_RecordAndEval
• _Tcl_EvalFile
• _Tcl_GetLongFromObj
• _TclBN_mp_clear
• _Tcl_ThreadAlert
• _Tcl_ExprBoolean
• _Tcl_DeleteInterp
• _TclBN_mp_unsigned_bin_size
• _Tcl_AttemptAlloc
• _Tcl_GetObjResult
• _Tcl_GetWideIntFromObj
• _Tcl_NewListObj
• _Tcl_ConditionNotify
• _Tcl_NewBooleanObj
• _Tcl_SplitList
• _Tcl_EvalObjv
• _Tcl_GetThreadData
• _Tcl_GetVar2Ex
• _Tcl_NewWideIntObj
• _Tcl_NewBignumObj
• _Tcl_ListObjGetElements
• _Tcl_GetString
• _Tcl_GetString
• _Tcl_GetString
The use of non-public or deprecated APIs is not permitted on the App Store, as they can lead to a poor user experience should these APIs change and are otherwise not supported on Apple platforms.
I read online that this is a sort of a widespread issue right now with apps that embed Python (would share links but then my post will have to be approved by a moderator). Anyone have a workaround?
Topic:
App Store Distribution & Marketing
SubTopic:
App Review
Tags:
Developer Tools
App Store
App Review
Entitlements
I have an XPC service that embeds Python. It executes a python script on behalf of the main app.
The app and xpc service are sandboxed. All seems to work just fine in the development environment but the script fails in the released version.
I disabled writing pycache by setting the PYTHONDONTWRITEBYTECODE environment variable because pycache tries to write inside my app bundle which fails (I believe I can redirect the pycache directory with PYTHONPYCACHEPREFIX and may experiment with that later).
Specifically this line fails in the release version only (not from Xcode):
PyObject *pModule = PyImport_Import(moduleNameHere);
if (pModuleOwnedRef == NULL)
{
// this is null in release mode only.
}
Any ideas what can be going wrong? Thanks in advance.
So with SKStoreReviewController now deprecated... I'm wondering what API is recommended for UIKit apps?
My app, which has been on the Mac App Store for many years, has an update being blocked by App review. The only change made is a bug fix (documented in the release notes).
First rejection:
Said I was using an entitlement I didn't need.
My response: I explained the feature that required the entitlement.
App goes back in review and gets rejected again for completely different reasons. They don't want me to write files in my App Sandbox container and instead write them in a more traditional user facing location (like in the Documents folder). They keep sending me a link to the "App Sandbox Design Guide" in the Documentation Archive (which appears to redirect to a different page?) and are quoting a section that is nowhere to be found in the link they send me (on the page I'm redirected to). I keep explaining to them that I cannot write outside my sandbox container and that this isn't my choice.
And they keep rejecting my app and sending me a broken link to the "App Sandbox design guide." It isn't my fault that I have to write to my sandboxed container by default or have a non-functioning app.
In any case, I don't understand why a bug fix update is being held up and I'm getting some vague instructions about possibly having to design some long winded explanation to the user in some ridiculously complicated onboarding process about choosing a folder in a save panel, why you have to choose the folder in the save panel (because I need your permission), OR just quit the app you just bought because it'll otherwise do nothing if you don't choose a folder in the save panel. Users got enough panels to deal with. At the very least App review shouldn't send me broken links from the Documentation Archive.
So I'm using my sandbox container by default (because by default I cannot do anything else). I've been doing this for a long time and I don't understand why it is suddenly a problem. What is my sandboxed container for if I can't write to it?
If documentation such as the "App Sandbox Design Guide" is still relevant and important why is it being archived anyway ? The link redirects I cannot find the section the reviewer is citing in the provided link.
I don't mind being asked to do something to improve the app but I've wasted a lot of time trying to satisfy app review in the past only to misinterpret what they actually are asking me to do causing more wasted time and energy and not getting a whole lot in return.
And I don't think it's fair to block a bug fix update.
Topic:
App Store Distribution & Marketing
SubTopic:
App Review
Tags:
macOS
App Review
App Sandbox
Mac App Store