Post

Replies

Boosts

Views

Activity

UITableview content overlaps translucent nav bar when scrolled on iOS 13
So, a UItableview inside a *regular* UIViewController (not using UITableviewcontroller).1) This view controller is embedded in a UINavigationController. The navigation item has "automatic' large title mode.2) The navigation controller's nav bar prefers large title.3) When the table view is scrolled, the big title does *not* shrink to the *regular* title size like in the iOS mail app. Instead, the table view content overlaps the navbar and bleeds through, making a UI glitch.On iOS 12 the scrolled content does not overlap the nav bar. This is new in IOS 13. Anyone get this and have a workaround?
Topic: UI Frameworks SubTopic: UIKit Tags:
7
0
5.4k
May ’22
Run CloudKit App Using the Production Environment From Xcode?
I'm getting ready to release a new app that uses CloudKit. I just deployed my Development schema to Production in CloudKit dashboard. Is there a way to run my app from Xcode using the CloudKit Production environment for testing? Details of how to test in the production environment are described here: https://developer.apple.com/library/archive/documentation/DataManagement/Conceptual/CloudKitQuickStart/TestingYourApp/TestingYourApp.html But would be faster (and easier for debugging potential issues) if I could select tell Xcode to use the production environment when running from the debugger. Is this supported? Thanks
5
0
2.2k
Jun ’22
Window's title bar separator draws way out of place on Mac Catalyst, not even close to title bar location
So I built my app with Mac Catalyst. I see this little line appear and disappear periodically in the window. Then all of a sudden it disappears when the window's activation state changes sometimes. It looks like a weird little glitch. Turns out this is the title bar's separator which is UITitlebarSeparatorStyleAutomatic (I believe the system hides/shows the separator in this mode based on current window states. I change the separator style to shadow and sure enough it draws like a shadow and never disappears. It's not even close to where the separator is supposed to be (nowhere near the title bar). The only workaround I have is to use UITitlebarSeparatorStyleNone which I'll do if I have to but was wondering if someone else has run into this and has a better workaround.
5
2
1.1k
Oct ’22
Mac Catalyst UIActivity subclasses that implement the activityViewController property don't work. API is broken.
I have a UIActivity subclass that generates data asynchronously. So as an example say we have a "Generate Spreadsheet" activity. In the implementation of the activity: -(UIViewController*)activityViewController {     if (_backingViewController == nil)     {         _backingViewController = [[ActivityWithProgressUIViewController alloc]init];         [self performActivity]; // <-- start the activity... always required to manually start the activity when providing a view controller.     }     return _backingViewController; }// return non-nil to have view controller presented modally. call activityDidFinish at end. default returns nil Then in -performActivity override...do the work... -(void)performActivity {     NSLog(@"start performing...pretend we are creating a spreadsheet..");     dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(10 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{         [self activityDidFinish:YES];         NSLog(@"Finished performing.");     }); } And that works on iOS. On Mac Catalyst the system never dismisses the view controller returned by UIActivity subclass. Also the UIActivityViewController's completionWithItemsHandler is called immediately after the custom activity is invoked, the system doesn't wait for the custom activity to call -activityDidFinish: The system just leaves the abandoned view controller returned by the custom activity on screen. Works fine on iOS. Easy to reproduce in a sample project.
5
0
717
Dec ’22
Possible to have NSWindow *without* NSWindowStyleMaskTitled to make the screen its on the main screen?
I have a NSWindow subclass. The window has a custom shape, and thus has a custom contentView which overrides drawRect to draw . Since the window has a custom shape it cannot use the system provided titlebar. The problem I'm having is when there are multiple screens, if my window is on the inactive screen (not mainScreen with menu bar) and I move the mouse over to the second monitor and click the window....the menu bar doesn't travel to the screen my app is on after the window is clicked. This does not happen with any other window. In all other windows, the menu bar moves to the screen once you click a window on that screen. So it appears this is because my window is not using NSWindowStyleMaskTitled. As far as I know, I can't use the system title bar and draw my custom window shape. Abandoning the custom window shape is not an option. Without going into too many details as to why I care, the menu bar really should travel with first click on my window like other apps.. Is there a way to tell the system (other than using the NSWindowStyleMaskTitled) that clicking on my window should make that screen the "main screen" (bring the menu bar over? I tried programmatically activating the application, ordering the window to the front, etc. but none of this works. This forces the user to click outside my app window, say on the desktop, to move the menu bar over, which feels wrong. Thanks in advance if anyone has any suggestions.
Topic: UI Frameworks SubTopic: AppKit Tags:
5
0
678
Dec ’24
Project Navigator Broken in Xcode 16? Drag and Drop to Reorder Files Doesn't Work. "New Groups" Creates New Folders.
I just created a new project in the newest version of Xcode as a sample project for a feedback. Bug 1 So simply what I do in every new project is create a "Supporting Files" group (not a folder because I don't want to move these files on the file system). I put the following files in this group: .entitlements file -the Info.plist (which apparently new projects don't create anymore because I don't see one). main.m Assets.xcassets In previous version of Xcode this was done with the "New Group without Folder" action (though back in the day I believe you'd get yellow folders in "New Group" and blue folder with 'New Folder" and they were separate actions.... which was actually better and much less insane IMO but that's not really important to this). In any case, "New Group without Folder" is nowhere to be found in the context menu. I finally was able to get "New Group" to appear as long as I wasn't right clicking underneath any directory. But.... New Group actually creates a New Folder, just like New Folder. So I put the .entitlements in the Supporting Files group (which is not a group, but a directory) and the app won't compile unless I fix the path in project settings because I moved the file which is most definitely not what I wanted. So we can no longer group files in the project navigator without moving them to new directories? Is this intentional behavior? It can't be, right? Bug 2 I noticed dragging and dropping to reorder files in the project navigator no longer seems to work? In previous versions of Xcode I could drag and drop to reorder files (in groups and in folders, this would work). This appears to no longer work. I just have to accept the way Xcode orders my project files?
5
0
2.5k
Jan ’25
App Groups on macOS, 'Register App Groups' Code Signing Problems
So I just updated Xcode to 16.3 and updated a project to its recommended build settings which includes "Register App Groups". So I have an outside Mac App Store app that uses app groups. Here we have an action extension. I can't debug it, can't get it to run. Nothing useful in Xcode is displayed when I try... but it looks like a code signing issue when I run and have Console open. So I try to make a provisioning profile manually and set it...didn't work. I noticed now though in signing & capabilities the group id is in red...like it's invalid, or something? This was a "macOS styled" group without the "group." prefix. So am I supposed to switch it to have the group. prefix? It makes the red text go away (no warnings or anything about app groups here, just red text). So if I change it to group. prefix..does that make an entire new container?What happens on app update for installs that don't have group. prefix? Does the system transparently migrate the group? Or Am I supposed to migrate the entire group container to the identifier with group. prefix? Also how does this affect running on older version of macOS? If I go with the "group." prefix to make the red text go away,.. what happens on macOS 11.0? Got a little more than I bargained for here after midnight.
5
0
123
May ’25
UINavigationController's interactivePopGestureRecognizer sometimes causes the popped view controller to never be released (memory leak)
I notice if I pop a view controller off a UINavigationController's navigation stack using the interactivePopGestureRecognizer, every so often the view controller being popped off is not being released from memory. Haven't been able to come up with a workaround or determine anything that seems to make the issue reproduce reliably. I simply log out dealloc in the view controller that is going to be popped. Push and pop a few times and notice that dealloc doesn't log out after it is being popped off. Not sure if something in the UI (other animation) that is interrupting the pop gesture's _UINavigationInteractiveTransition ... I haven't been able to track down what is retaining my view controller. When the issue happens I can see it is still in memory (I have it listen to UISceneWillEnterForegroundNotification and I put the scene in the background then move it to the foreground and hit a breakpoint). But...I can't seem to figure out what is strongly retaining the view controller. From he debugger I start setting view controller properties to nil to see if I can break a potential retain cycle I created) but no luck. I'm only able to reproduce the memory leak when I dismiss the view controller with the interactive pop gesture (not the back button). I know that's not a lot to go on but am wondering if someone has experience anything similar and has a potential workaround?
Topic: UI Frameworks SubTopic: UIKit Tags:
4
0
986
Jun ’22
Are in-app purchase receipts included in the App Store receipt on initial install on a new device?
I'm working on an app that uses Auto renewable subscriptions. The app uses StoreKit (not StoreKit2). It is pre-release. I was under the assumption that if the user subscribes via in app purchase on Device 1, and then installs the same app on Device 2 (logged in with the same Apple ID) that the receipt on Device 2 would include the in app purchase receipt on initial install, and therefore by inspecting the receipt locally I could determine that showing onboarding UI on Device 2 is not necessary (and all this could be done locally). Is this not true? I just watched the WWDC 2022 session 110404 "Implement proactive in-app purchase restore" which seems to indicate that this is not the case?
4
0
3.2k
Jul ’22
NSUndoManager -setActionName: being ignored on Mac Catalyst
So I just noticed that my calls to -setActionName: on NSUndoManager are not properly updating the Undo/Redo menu item titles in the menu bar on Mac Catalyst. At first I thought maybe my actionName string was too long, so I just created a really simple sample project and ...yeah...my calls to -setActionName are ignored. The menu bar items just say "Undo" and "Redo.." Sample: -(IBAction)changeBackgroundColorAction:(UIButton*)sender {     UIColor *currentBGColor = self.view.backgroundColor;     self.view.backgroundColor = UIColor.yellowColor;     NSUndoManager *undoManager = self.undoManager;     [undoManager registerUndoWithTarget:self selector:@selector(setBackgroundColorWithColor:) object:currentBGColor];     [undoManager setActionName:@"Change BG Color"]; } I'm really starting to regret not using AppKit...
4
0
787
Nov ’22
Enable WKWebView Web Inspector Under Mac Catalyst?
I'm trying to enable the web inspector on WKWebView in a Mac Catalyst app. I'm only doing this for debugging purposes. In the released the web inspector will not be enabled. Doing this under Mac Catalyst does not work:  WKPreferences *prefs = [[WKPreferences alloc]init];   [prefs _setDeveloperExtrasEnabled:YES]; //Assign the WKPreferences to a WKWebViewConfiguration and create the web view.. Is there any way to do this? Thanks in advance.
4
0
1.8k
Oct ’23
WKWebView on Mac Catalyst elementFullscreenEnabled set to YES on WKPreferences but it does not work
Setting elementFullscreenEnabled property to YES on WKPreferences is not honored on Mac Catalyst.  WKWebViewConfiguration *webViewConfig = [[WKWebViewConfiguration alloc]init];  WKPreferences *prefs = [[WKPreferences alloc]init]; prefs.elementFullscreenEnabled = YES;   webViewConfig.preferences = prefs; //then create the WKWebView.. I load a Youtube url in the WKWebView. Youtube complains that the browser doesn't support full screen. Is there a workaround? Full screen does work in an AppKit app though using the exact same API...though it causes an Autolayout crash (I will be making another thread about that separate issue shortly).
4
0
1.3k
Oct ’23
WKWebView document.onvisibilitychange event not always being fired. Need to detect page changes reliability from WKUserScript
I need to prepare an object when the user navigates to a new page in WKWebView and refresh UI. I run a WKUserScript on behalf of the user to do this. I'm using the readystatechange event listener to detect initial page load. I'm also listening to the visibilitychange event to refresh UI if the DOM is already loaded on a "Go back" or "Go Forward" action. document.addEventListener('visibilitychange', () => { //do whatever if the DOM is already loaded and if we are visible. }); document.addEventListener('readystatechange', (event) => { //do whatever when page is loaded }); On certain websites however I noticed that neither of these events are being fired when I navigate -goForward: and -goBack: I'm not sure why. My WKUserScript is in WKContentWorld.defaultClientWorld so it shouldn't be interfering with the javascript of the page. Is there another JS event I'm missing? I could pick up the changed URL on the native code side but it would be nice to keep this all contained within the WKUserScript as this UI is for the "webview" and the native code shouldn't have to be bothered with having to patch in the additional glue. Is there another DOM event I need to listen to? I tried listening to window's pageshow but that didn't work. Also experimented a bit with the window's popstate event but no luck.
4
0
1.9k
Jul ’23