Post

Replies

Boosts

Views

Activity

Reply to UIDeferredMenuElement With Uncached Provider Not Working on Mac Catalyst. Uncached provider block never called and menu displays as "Loading"
I ran into this issue recently and found a workaround to this. Don't attach the menu to the bar button item. Instead use a UIButton as the custom view (sorry about the bastardized ObjC code): let optionsButton = [UIButton buttonWithType:UIButtonTypeCustom]; [optionsButton setImage:optionsImage forState:UIControlStateNormal]; optionsButton.showsMenuAsPrimaryAction = YES; optionsButton.menu = menu; optionsBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:optionsButton]; I want to saw if I changed the button type to .system then I got the same 'Loading...' menu item forever. But when it is custom seems to work. Of course now the bar button item behaves a little differently when the window isn't active so you'll have to write code to tint it to look inactive as needed. But hey the menu works.
Jul ’24
Reply to Mac Catalyst Menu Bar/Toolbar Actions Not Validating Properly After Changing Active Windows
Nice fix. In my case I used some appkit code to create the toolbar item view instead of using UIView. It would be far nicer though if I could just use a subclass of UIView again. I just tested my sample app on Sonoma/Xcode 15 and it looks like they fixed the bug. Would be nice if there were actual release notes for Mac Catalyst code. Will experiment with your fix in my app. Thanks for posting it.
Nov ’23
Reply to Strange vertical alignment in Catalyst navigation bar titles in modal sheets w/Catalyst & macOS Sonoma
You likely need create a UIBarButtonItemAppearance and adjust the titlePositionAdjustment property then set navigationBarAppearance.buttonAppearance = buttonItemAppearance. Same for navigationBarAppearance.doneButtonAppearance and navigationBarAppearance.backButtonAppearance. For the back button I had to multiply the vertical value by -1.0 to get it to be the same as the other properties. Then lastly had to apply the full appearance to the navigation bar: navigationBar.standardAppearance = navigationBarAppearance navigationBar.scrollEdgeAppearance = navigationBarAppearance
Nov ’23
Reply to Handling Mouse Scroll Wheel events using UIPanGestureRecognizer
Here's some code I'm using. I grabbed it from somewhere and didn't make note of where it came from. UIPanGestureRecognizer *scrollWheelGesture = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(handleScrollWheelGesture:)]; scrollWheelGesture.allowedScrollTypesMask = UIScrollTypeMaskDiscrete; // only accept scroll-wheel, not track-pad scrollWheelGesture.maximumNumberOfTouches = 0; (void)handleScrollWheelGesture:(UIPanGestureRecognizer *)pan { CGPoint delta = [pan translationInView:self.view]; // delta.y will be negative if scrolling up and positive if down I think..
May ’23