Post

Replies

Boosts

Views

Activity

Reply to Crash on iOS 16.2: -[UITableView _createPreparedCellForGlobalRow:withIndexPath:willDisplay:
Yes I was able to resolve it. So in my case I have a dedicated object as the UITableViewDataSource that sits between the UIViewController and the UITableView. The object that I use as the table view data source implements everything needed to populate the table view data, refreshing it automatically on model changes, etc. The only thing my table view data source doesn't do was provide a UITableView cell in -tableView:cellForRowAtIndexPath: method (instead it asks its delegate for the cell, which is the UIViewController) . My data source object is sort of like UITableViewDiffableDataSource in this way. So what was happening is the UITableView AND the table view data source objects were occasionally outliving the UIViewController. Then when a model change notification is posted my datasource object asked the view controller for the cell in -tableView:cellForRowAtIndexPath: (but the view controller was already deallocated). Never was able to reproduce it in debug mode. I removed the delegate-protocol from my data source object and captured the cell creation code in a block property and I haven't had a crash since.
Topic: UI Frameworks SubTopic: UIKit Tags:
Apr ’23
Reply to UIDeferredMenuElement With Uncached Provider Not Working on Mac Catalyst. Uncached provider block never called and menu displays as "Loading"
Still not fixed in Ventura 13.3. Can you show your code so I can see what's different from mine? I tried using it with a UIButton instead of UIBarButtonItem and then adding it to my NSToolbar with NSUIViewToolbarItem but still not working. The menu just shows a "Loading..." item and the uncached provider block is never called.
Topic: UI Frameworks SubTopic: UIKit Tags:
Apr ’23
Reply to UITextView.scrollRangeToVisible() broken
UITextView -scrollRangeToVisible: wasn't working for me either. I have a UITextView and I'm trying to have it scroll to particular words. In my case I set the scrollEnabled property to NO on the UITextView because I need user scrolling to be disabled. For me the workaround was to set the scrollEnabled property back to YES and set the userInteractionEnabled property to NO. -scrollRangeToVisible: then started working but only sometimes. I had to change the text layout to TextKit1 as mentioned by @alexschecha to get the -scrollRangeToVisible: method to work properly. Unlike -setContentOffset: the -scrollRangeToVisible: method will only work if the scrollEnabled property is YES it seems and it will only work reliably under TextKit1 as far as I can tell. There is still a limitation though. I'd like to scroll the range to the middle of the UITextView. If the range is below the visible region of the UITextView then -scrollRangeToVisible: will scroll it to the bottom. I tried getting the frame for the range myself like so: UITextPosition *beginning = textView.beginningOfDocument; UITextPosition *start = [textView positionFromPosition:beginning offset:range.location]; UITextPosition *end = [textView positionFromPosition:start offset:range.length]; UITextRange *textRange = [textView textRangeFromPosition:start toPosition:end]; CGRect rect = [textView firstRectForRange:textRange]; CGRect finalRect = [textView convertRect:rect fromView:textView.textInputView]; textView.contentOffset = CGPointMake(0.0,finalRect.origin.y-visibleOffetY); And that works... sometimes. Every once and awhile the computed rect from the range will be CGRectNull (range is valid but I get CGRectNull anyway).
Topic: App & System Services SubTopic: Core OS Tags:
May ’23
Reply to UISheetPresentationController behind UITabBar
+1 for a sample. How does presenting a UITabBarController on top of the UISheetPresentationController make the sheet appear behind the tab bar but above the tab view controllers' content? Only thing I can think of is maybe adding a UITabBar (which is a view) to the sheet itself at the bottom. But then I'd have to basically reimplement UITabBarController functionality from scratch and this would be very disruptive to my app's current structure (probably not worth the effort). That would get the "Find My app" look (which has a sheet that can't be dismissed). In my case I need a sheet that is dismissible. I think a nice enhancement would be able to specify a passthrough view, or something of that nature on UISheetPresentationController. Something like: @property (nonatomic,strong,nullable) UITabBar *passThroughTabBar; So existing UITabBarControllers can easily add a sheet that doesn't block the tab bar. Or maybe something like this: @property (nonatomic,strong,nullable) CGFloat bottomMargin; //assign the UITabBar's frame height to this so it floats above the tab bar instead of covering it.
Topic: UI Frameworks SubTopic: UIKit Tags:
May ’23
Reply to WKWebView elementFullscreenEnabled on iPad. Full screen video doesn't properly resize on orientation change.
I filed FB12009926
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Feb ’23
Reply to Mac Catalyst Copying NSURLs to the pasteboard translation is bad?
This works better it seems: NSString *string = urlToCopy.absoluteString; NSArray *objects = (string != nil) ? @[urlToCopy,string] : @[urlToCopy]; [[UIPasteboard generalPasteboard] setObjects:objects]; Will have to remove WKWebViews default copy action.
Replies
Boosts
Views
Activity
Feb ’23
Reply to Mac Catalyst Copying NSURLs to the pasteboard translation is bad?
FB12010301
Replies
Boosts
Views
Activity
Feb ’23
Reply to WKWebView Airplay Video Doesn't Work on Mac Catalyst?
I filed FB12010327
Topic: Safari & Web SubTopic: General Tags:
Replies
Boosts
Views
Activity
Feb ’23
Reply to Mac Catalyst Copying NSURLs to the pasteboard translation is bad?
Also noticed copying multiple links to the pasteboard does not work on Mac Catalyst. [UIPasteboard generalPasteboard].URLs = @[appleDotComURL,websiteTwoURL,websiteThreeURL]; On iOS when I do that I can open "Notes" and paste and the strings for all three urls paste properly. But doing the same thing on Mac Catalyst it just pastes one url string...
Replies
Boosts
Views
Activity
Feb ’23
Reply to Is Virtualizing an Intel Mac Supported on Apple Silicon Via the Virtualization Framework?
Thanks for answering.
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Feb ’23
Reply to UIDeferredMenuElement With Uncached Provider Not Working on Mac Catalyst. Uncached provider block never called and menu displays as "Loading"
I filed FB12062113
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Mar ’23
Reply to Crash on iOS 16.2: -[UITableView _createPreparedCellForGlobalRow:withIndexPath:willDisplay:
Yes I was able to resolve it. So in my case I have a dedicated object as the UITableViewDataSource that sits between the UIViewController and the UITableView. The object that I use as the table view data source implements everything needed to populate the table view data, refreshing it automatically on model changes, etc. The only thing my table view data source doesn't do was provide a UITableView cell in -tableView:cellForRowAtIndexPath: method (instead it asks its delegate for the cell, which is the UIViewController) . My data source object is sort of like UITableViewDiffableDataSource in this way. So what was happening is the UITableView AND the table view data source objects were occasionally outliving the UIViewController. Then when a model change notification is posted my datasource object asked the view controller for the cell in -tableView:cellForRowAtIndexPath: (but the view controller was already deallocated). Never was able to reproduce it in debug mode. I removed the delegate-protocol from my data source object and captured the cell creation code in a block property and I haven't had a crash since.
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Apr ’23
Reply to Mac Catalyst Menu Bar/Toolbar Actions Not Validating Properly After Changing Active Windows
It appears in AppKit land the expected NSWindow is the main window when the described issue occurs but in the Mac Catalyst world the wrong UIWindowScene has the foreground active state which is good news because that means a workaround should be possible.
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Apr ’23
Reply to Mac Catalyst Menu Bar/Toolbar Actions Not Validating Properly After Changing Active Windows
Another quick question: would it be considered intended behavior for two UIWindowScenes to have their activationState set to UISceneActivationStateForegroundActive at the same time?
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Apr ’23
Reply to UIDeferredMenuElement With Uncached Provider Not Working on Mac Catalyst. Uncached provider block never called and menu displays as "Loading"
Still not fixed in Ventura 13.3. Can you show your code so I can see what's different from mine? I tried using it with a UIButton instead of UIBarButtonItem and then adding it to my NSToolbar with NSUIViewToolbarItem but still not working. The menu just shows a "Loading..." item and the uncached provider block is never called.
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Apr ’23
Reply to Uploading App Preview Video for Mac App Fails with Error "Your app preview contains unsupported or corrupted audio" even though the video contains no audio.
Workaround: Add audio to the preview video in iMovie. Set the audio volume to 0. Export the video again and upload.
Replies
Boosts
Views
Activity
Apr ’23
Reply to UITextView.scrollRangeToVisible() broken
UITextView -scrollRangeToVisible: wasn't working for me either. I have a UITextView and I'm trying to have it scroll to particular words. In my case I set the scrollEnabled property to NO on the UITextView because I need user scrolling to be disabled. For me the workaround was to set the scrollEnabled property back to YES and set the userInteractionEnabled property to NO. -scrollRangeToVisible: then started working but only sometimes. I had to change the text layout to TextKit1 as mentioned by @alexschecha to get the -scrollRangeToVisible: method to work properly. Unlike -setContentOffset: the -scrollRangeToVisible: method will only work if the scrollEnabled property is YES it seems and it will only work reliably under TextKit1 as far as I can tell. There is still a limitation though. I'd like to scroll the range to the middle of the UITextView. If the range is below the visible region of the UITextView then -scrollRangeToVisible: will scroll it to the bottom. I tried getting the frame for the range myself like so: UITextPosition *beginning = textView.beginningOfDocument; UITextPosition *start = [textView positionFromPosition:beginning offset:range.location]; UITextPosition *end = [textView positionFromPosition:start offset:range.length]; UITextRange *textRange = [textView textRangeFromPosition:start toPosition:end]; CGRect rect = [textView firstRectForRange:textRange]; CGRect finalRect = [textView convertRect:rect fromView:textView.textInputView]; textView.contentOffset = CGPointMake(0.0,finalRect.origin.y-visibleOffetY); And that works... sometimes. Every once and awhile the computed rect from the range will be CGRectNull (range is valid but I get CGRectNull anyway).
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
May ’23
Reply to UIVisualEffectView inside UISheetPresentationController Looks Wrong When largestUndimmedDetentIdentifier is the current selected identifier in Dark mode (Hard to See)
Resolved. Please delete this thread.
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
May ’23
Reply to UISheetPresentationController behind UITabBar
+1 for a sample. How does presenting a UITabBarController on top of the UISheetPresentationController make the sheet appear behind the tab bar but above the tab view controllers' content? Only thing I can think of is maybe adding a UITabBar (which is a view) to the sheet itself at the bottom. But then I'd have to basically reimplement UITabBarController functionality from scratch and this would be very disruptive to my app's current structure (probably not worth the effort). That would get the "Find My app" look (which has a sheet that can't be dismissed). In my case I need a sheet that is dismissible. I think a nice enhancement would be able to specify a passthrough view, or something of that nature on UISheetPresentationController. Something like: @property (nonatomic,strong,nullable) UITabBar *passThroughTabBar; So existing UITabBarControllers can easily add a sheet that doesn't block the tab bar. Or maybe something like this: @property (nonatomic,strong,nullable) CGFloat bottomMargin; //assign the UITabBar's frame height to this so it floats above the tab bar instead of covering it.
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
May ’23