Discuss the different user interface frameworks available for your app.

All subtopics
Posts under UI Frameworks topic

Post

Replies

Boosts

Views

Activity

Wallpaper Api
Hey, I have an app that user selects wallpaper for iPhone. I want a feature that user can set wallpaper direct from app itself for lock screen and home screen not download the image and manually set the wallpaper. As my research there was a PhotoLibrary api that contains PLWallpaperImageViewController.h which allows you to set wallpaper directly. Thank You!
1
0
1k
Oct ’24
Android Emulator "System UI Isn't Responding" Error on macOS Monterey
Hello everyone, I’m experiencing an issue with the Android Emulator in Android Studio (version Ladybug) on my Mac running macOS Monterey (12.7). The emulator frequently displays the message “System UI isn’t responding” and then crashes. I've tried a few troubleshooting steps, including: Restarting Android Studio and the emulator. wipe data on AVD. tried to change the emulator performance from automatic to hardware but this option isn't available to me. Despite these efforts, the problem persists. Has anyone else encountered this issue? Any suggestions or solutions would be greatly appreciated!
2
0
828
Nov ’24
Landscape safe area is incorrect when presenting SKStoreProductViewController
Hi. If the app is in landscape only and when the SKStoreProductViewController is presented, the safeArea changes to what looks like a portrait mode safe area. When the SKStoreProductViewController is dismissed, the safeArea does NOT revert back to the original values. Is there a way to force the safeArea to "reset"? I've submitted some bug tickets through Apple Feedback but I haven't received any response about it. The below code will pop up the SKStoreProductViewController and if you have a UIView that is constrained to the safe area, then you can visibly notice that the safe area is changed and doesn't go back. I have tested this on iPhone 14 Pro, iPhone 15, and iPhone 16 Pro and in the Simulators. The incorrect behavior happens on those and probably more. Thanks. #import "ViewController.h" #import <StoreKit/StoreKit.h> @interface ViewController () @property (nonatomic, strong) SKStoreProductViewController *productViewController; @end @implementation ViewController - (IBAction)buttonTapped:(id)sender { self.productViewController = [[SKStoreProductViewController alloc] init]; NSDictionary *parameters = @{ @"id" : @"6443575749" }; [self.productViewController loadProductWithParameters:parameters completionBlock:^(BOOL result, NSError * _Nullable error) { [self presentViewController:self.productViewController animated:YES completion:^{ // presented // The panel that is constraint to the safe area visibly shows that the safe area is no longer correct. }]; }]; } @end
3
1
646
Nov ’24
Distributing Mac Desktop Apps using GTKMM Without AppKit/UIKit on Mac App Store
Dear DTS Engineer, I hope this message finds you well. I am currently developing a Mac desktop application using the GTKMM framework, and I have some questions regarding the distribution of such an application through the Mac App Store. Project Context: I am building a native Mac desktop application using GTKMM as the UI framework. As GTKMM does not rely on macOS's AppKit or UIKit, my application does not use these Apple-specific frameworks for the UI. Instead, GTKMM provides its own cross-platform UI components. While this approach allows me to target macOS alongside Linux and Windows, I am uncertain whether this setup will be compatible with the Mac App Store's submission guidelines. My Questions: App Store Compatibility: Is it possible to distribute a macOS desktop application built with GTKMM (without using AppKit or UIKit) on the Mac App Store? App Store Guidelines: Are there specific App Store guidelines I should be aware of when submitting a non-native, non-AppKit UI-based app, such as one using GTKMM for macOS? Notarization & Code Signing: Does my app need to use AppKit/UIKit to meet the code signing and notarization requirements, or can I proceed with signing and notarizing a GTKMM-based app? App Store Review Process: Will the absence of AppKit/UIKit affect the review process or the acceptance of the app into the Mac App Store? I would greatly appreciate any guidance or clarification on these points. If you need additional details about my development environment or the specific technologies I'm using, please let me know. Thank you for your time and assistance.
0
0
511
Nov ’24
UIDocumentPickerViewController fullScreen not working
When I present a UIDocumentPickerViewController I want it to occupy the fullscreen but it never displays as fullscreen The modalPresentationStyle seems to have no effect no matter what I set it to Running the code with DispatchQueue.main.async did not help either Here is the code Anybody got any suggestions? `@objc private func plusButtonPressed() { DispatchQueue.main.async { let picker = UIDocumentPickerViewController(documentTypes: [kUTTypeData as String], in: .import) picker.delegate = self picker.modalPresentationStyle = .fullScreen self.present(picker, animated: true) } }`
0
0
494
Nov ’24
Help needed to understand the issues from the app
Hi, There are total three errors from the app running on the device. First one is right after the app starts running on the device: Could not create a sandbox extension for '/var/containers/Bundle/Application/D4CBF093-EFB1-43C5-996D-7D5CB04BF643/appadmob.app' Below second issue comes when I dismiss the Interstitial Ad First responder issue detected: non-key window attempting reload - allowing due to manual keyboard (first responder window is <UIWindow: 0x10d11c700; frame = (0 0; 414 896); hidden = YES; autoresize = W+H; gestureRecognizers = <NSArray: 0x301749300>; backgroundColor = <UIDynamicSystemColor: 0x3002b3080; name = _windowBackgroundColor>; layer = <UIWindowLayer: 0x3019b7960>>, key window is <QUIWindow: 0x10880db00; baseClass = UIWindow; frame = (0 0; 414 896); gestureRecognizers = <NSArray: 0x3017276e0>; layer = <UIWindowLayer: 0x3019852f0>>) And the third issue below follows right after the second one: Error acquiring assertion: <Error Domain=RBSServiceErrorDomain Code=1 "((target is not running or doesn't have entitlement com.apple.developer.web-browser-engine.rendering AND target is not running or doesn't have entitlement com.apple.developer.web-browser-engine.networking AND target is not running or doesn't have entitlement com.apple.developer.web-browser-engine.webcontent))" UserInfo={NSLocalizedFailureReason=((target is not running or doesn't have entitlement com.apple.developer.web-browser-engine.rendering AND target is not running or doesn't have entitlement com.apple.developer.web-browser-engine.networking AND target is not running or doesn't have entitlement com.apple.developer.web-browser-engine.webcontent))}> 0x118024480 - ProcessAssertion::acquireSync Failed to acquire RBS assertion 'WebProcess NearSuspended Assertion' for process with PID=19180, error: (null) Failed to terminate process: Error Domain=com.apple.extensionKit.errorDomain Code=18 "(null)" UserInfo={NSUnderlyingError=0x3019254a0 {Error Domain=RBSRequestErrorDomain Code=3 "No such process found" UserInfo={NSLocalizedFailureReason=No such process found}}} Also when I dismissed the interstitial ad, the screen looks greyed out, but when I touch the screen, the screen comes to normal. Could you please suggest any solution for the problems. Thanks,
2
0
2.3k
Dec ’24
Delay between animation and view accepting touch input
Hi! I was trying to add an animation to my SwiftUI view with UIKit, but after the animation runs there's a delay before the view will accept touch interactions. I thought it was because of the frame size of the view controller, but even after fixing that I still get the delay. Could anyone point me to where I might be going wrong, or if maybe using a UIKit modifier for the animation just doesn't work? Any help would be greatly appreciated! UIView: class BounceView: UIView { required init() { super.init(frame: .zero) } func bounceAnimation() { guard let piece = self.subviews.first else { return } UIView.animate(withDuration: 0.7, delay: 0, usingSpringWithDamping: 0.7, initialSpringVelocity: 0) { piece.frame.origin.x += 10 } } func bounceBack() { guard let piece = self.subviews.first else { return } UIView.animate(withDuration: 0.7, delay: 0, usingSpringWithDamping: 0.7, initialSpringVelocity: 0) { piece.frame.origin.x -= 10 } } required init?(coder: NSCoder) { fatalError("init(coder:) has not been implemented") } } UIView controller: class BounceViewController: UIViewController { init(controller: UIViewController) { super.init(nibName: nil, bundle: nil) view = BounceView() addChild(controller) controller.view.translatesAutoresizingMaskIntoConstraints = false controller.view.backgroundColor = .clear view.addSubview(controller.view) controller.didMove(toParent: self) } // adjusts view to match bounds of child override func viewDidLayoutSubviews() { super.viewDidLayoutSubviews() let subviewFrame = self.view.subviews.first?.bounds ?? .zero view.frame = subviewFrame print(subviewFrame) self.updateViewConstraints() } func update(animated: Bool) { let bounceView = view as? BounceView if animated { bounceView?.bounceAnimation() } else { bounceView?.bounceBack() } } required init?(coder: NSCoder) { fatalError("init(coder:) has not been implemented") } } SwiftUI wrapper: struct BounceUIViewController: UIViewControllerRepresentable { private var controller: UIViewController @Binding var animated: Bool init(controller: UIViewController, animated: Binding<Bool>) { self.controller = controller self._animated = animated } func makeUIViewController(context: Context) -> BounceViewController { BounceViewController(controller: controller) } func updateUIViewController(_ uiViewController: BounceViewController, context: Context) { uiViewController.update(animated: animated) } } View extension: extension View { func bounce(animated: Binding<Bool>) -> some View { modifier(Bounce(animated: animated)) } } struct Bounce: ViewModifier { @Binding var animated: Bool init(animated: Binding<Bool>) { self._animated = animated } func body(content: Content) -> some View { BounceUIViewController(controller: content.uiViewController, animated: $animated) } }
1
0
628
Dec ’24
traitCollectionDidChange iOS18
iOS18.2 / iPhone 16pro / Xcode 16.2 'traitCollectionDidChange' This function has been deprecated since ios17. However, in ios18, when I changed the app to the background state or changed it to the foreground state again, it was confirmed that the function worked. It hasn't been confirmed in ios17, but why is it only confirmed in ios18?
0
0
583
Dec ’24
iPadOS 18 TabView with Large Navigation Title
I’m following the example code from Apple to implement the new iPadOS 18 TabView() with the new Tab(). While the tabbing itself is working fine, I can’t get it to show up a (large) navigation title in the sidebar (like the Home or Files app). I’ve tried placing .navigationTitle("App Name") at the TabView, but that doesn’t work. Is it possible to do this in any way or is this not recommended to show? TabView { Tab("Overview", systemImage: "film") { Text("Put a OverviewView here") } TabSection("Watch") { Tab("Movies", systemImage: "film") { Text("Put a MoviesView here") } Tab("TV Shows", systemImage: "tv") { Text("Put a TVShowsView here") } } TabSection("Listen") { Tab("Music", systemImage: "music.note.list") { Text("Put a MusicView here") } Tab("Podcasts", systemImage: "mic") { Text("Put a PodcastsView here") } } } .tabViewStyle(.sidebarAdaptable) .navigationTitle("App Name") .navigationBarTitleDisplayMode(.large) I know that there is also the .tabViewSidebarHeader() modifier, but that adds any view above the scroll view content. Neither does that easily allow to make it look like the regular navigation title, nor does it actually display in the navigation bar at the top, when scrolling down.
2
0
886
Dec ’24
Implement two lists side by side with SwiftUI on iPad
I'm currently building an App using a TabView as the main navigation method. In my app I would like to build a page similar to the Top Charts in the native App Store App with two lists side by side: So far I came up with this code (simplified demo): import SwiftUI struct Demo: View { var body: some View { TabView { Tab("Main Tab", systemImage: "tray.and.arrow.down.fill") { NavigationStack { HStack { List { Text("Left List") } List { Text("Right List") } } .navigationTitle("Demo") .navigationBarTitleDisplayMode(.inline) } } } } } #Preview { Demo() } However, I’m encountering a couple of issues: • Scrolling to the top of the left list doesn’t trigger the toolbar background effect, and the content overlaps with the tabs in a strange way. Scrolling to the top of the right list works as expected. • The navigation title is always hidden. I haven’t been able to find a solution to these problems. What would be the correct approach? Thank you!
1
0
524
Jan ’25
PHPickerViewController No Auto Focus
The issue is, I cannot auto acquire bluetooth keyboard focus in PHPickerViewController after enabling 'Full Keyboard Access' in my IPhone 14 with iOS version 18.3.1. The keyboard focus in PHPickerViewController will show, however, after I tapped on the blank space of the PHPickerViewController. How to make the focus on at the first place then? I'm using UINavigationController and calling setNavigationBarHidden(true, animated: false). Then I use this controller to present PHPickerViewController using some configuration setup below. self.configuration = PHPickerConfiguration() configuration.filter = .any(of: filters) configuration.selectionLimit = selectionLimit if #available(iOS 15.0, *), allowOrdering { configuration.selection = .ordered } configuration.preferredAssetRepresentationMode = .current Finally I set the delegate to PHPickerViewController and call UINavigationController.present(PHPickerViewController, animated: true) to render it. Also I notice animation showing in first video then disappear.
2
0
240
Mar ’25
Unexpected onAppear behavior in NavigationStack with ViewThatFits
Hello, My goal is to have a NavigationStack whose root view is determined based on its height and width. To do so, I'm using ViewThatFits, which should choose the right view to display. It is working fine, but unexpectedly both views trigger onAppear, whereas only the appropriate one should. This causes the logic in both closures to be executed, which is not intended. The code below demonstrates the problem: struct NavigationStackContentView: View { var body: some View { NavigationStack { ViewThatFits(in: .vertical) { Color.yellow .onAppear { print("|-> on appear: yellow") } .onDisappear { print("|-> on disappear: yellow") } Color.red .frame(width: 1500, height: 1500) .onAppear { print("|-> on appear: red") } .onDisappear { print("|-> on disappear: red") } } } } } this produces: |-> on appear: red |-> on disappear: red |-> on appear: yellow When ViewThatFits is not nested within NavigationStack, the problem does not occur — only the yellow view (in this sample) triggers onAppear, which is the expected behavior. I also checked the macOS version, and the problem does not occur at all, whether within NavigationStack or not. This example is simple and demonstrates that the larger view is the second one. When I switch their places, the problem does not occur because it recognizes that the first view would not fit at this point. However, in my case I will have these views without knowing which one will not fit, so switching their order is not a viable solution if this works without NavigationStack. Am I doing something wrong, or is this a bug? // iOS: 18.3.1 Xcode: 16.2
1
0
163
Mar ’25
listRowSeparatorTint not updated
This sample code exhibits two issues: struct ContentView: View { @State private var myColor = Color.red var body: some View { VStack() { List() { Text("Object") Text("Object") Text("Object") .listRowSeparatorTint(myColor) Text("Object") } Button(action:{myColor = Color.green}) {Text("Change color")} } .foregroundColor(myColor) } } the row separator isn't redraws when the @State property change listRowSeparatorTint apply to two lines The first point is really disappointing. Is there anyone which know if this is a bug or there is a more correct way to use listRowSeparatorTint with changing parameter?
2
0
123
Apr ’25
Get MacOS menubar size in Swift
To get menubar size, we can call. let menuBarHeight = NSStatusBar.system.thickness That is returning 24 and it is the same as my external screen. I did command + shift + 5 and use the screen capture tool to rougly measure the size of menubar. It is roughly 24px. However, for my macbook pro 14 inches m2 pro. The menubar seem thicker because of the webcam. Is there a way to find out the size in Swift?
2
1
132
Apr ’25
memory leak/increased memory by NSTextField setString
I just put the TextField on UI and call the NSTextField setString, but it is memory usage is increasing. StoryBoard Objective C put TextField and button to UI set TextField variable to "ABC" in ViewController.h @property (weak) IBOutlet NSTextView* ABC; on button event function //dispatch_sync(dispatch_get_main_queue(), ^{ [_ABC setString:str]; //}); How to block the memory usage increase? Also I was check on Instruments app, and there are many malloc 48bytes, its count is almost same with setString count. Thank you!
1
0
75
May ’25
The NSTextViewDelegate method textViewDidChangeSelection(:) will not fire, while all other text view delegate methods do.
I am trying to implement the NSTextViewDelegate function textViewDidChangeSelection(_ notification: Notification). My text view's delegate is the Coordinator of my NSViewRepresentable. I've found that this delegate function never fires, but any other delegate function that I implement, as long as it doesn't take a Notification as an argument, does fire (e.g., textView(:willChangeSelectionFromCharacterRange:toCharacterRange:), fires and is called on the delegate exactly when it should be). For context, I've verified all of the below: textView.isSelectable = true textView.isEditable = true textView.delegate === my coordinator I can call textViewDidChangeSelection(:) directly on the delegate without issue. I can select and edit text without issues. I.e., the selections are being set correctly. But the delegate method is never called when they are. I am able to add the intended delegate as an observer for the selector textViewDidChangeSelection via NotificationCenter. If I do this, the function executes when it should, but fires for every text view in my view hierarchy, which can number in the hundreds. I'm using an NSLayoutManager, so I figure this should only fire once. I've added a check within my code: func textViewDidChangeSelection(_ notification: Notification) { guard let textView = notification.object as? NSTextView, textView === layoutManager.firstTextView else { return } // Any code I want to execute... } But the above guard check lets through every notification, so, no matter what, my closure executes hundreds of times if I have hundreds of text views, all of them being sent by textView === layoutManager.firstTextView, but once for each and every text view managed by that layoutManager. Does anyone know why this method isn't ever called on the delegate, while seemingly all other delegate methods are? I could go the NotificationCenter route, but I'd love to know why this won't execute as a delegate method when documentation says that it should, and I don't want to have to implement a counter to make sure my code only executes once per selection update. And for more reasons than that, implementing via delegate method is preferable to using notifications for my use case. Thanks for any help!
3
0
104
May ’25