Explore the various UI frameworks available for building app interfaces. Discuss the use cases for different frameworks, share best practices, and get help with specific framework-related questions.

All subtopics
Posts under UI Frameworks topic

Post

Replies

Boosts

Views

Activity

iOS18 UINavigationBar Crash
I encountered a crash when calling the tabBarView:didSelectIndex: method, and it only happens on iOS 18. Here is crash report: `OS Version: iPhone OS 18.0.1 (22A3370) Report Version: 105 SDK Version: 0.0.4 Exception Type: SIGABRT Exception Codes: #0 at 0x1f0acb274 Crashed Thread: 0 Application Specific Information: *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Layout requested for visible navigation bar, <UINavigationBar: 0x11266ef80; frame = (0 -91; 428 44); autoresize = W; tintColor = UIExtendedSRGBColorSpace 1 1 1 0.8; layer = <CALayer: 0x301e14800>> delegate=0x112670600 standardAppearance=0x3035b3720 scrollEdgeAppearance=0x3035b3b10, when the top item belongs to a different navigation bar. topItem = <UINavigationItem: 0x14309cf00> title='' titleView=0x15b1af700 style=navigator leftBarButtonItems=0x301c08940 rightBarButtonItems=0x301caa180, navigation bar = <UINavigationBar: 0x11266e080; frame = (0 -91; 428 44); autoresize = W; tintColor = UIExtendedSRGBColorSpace 1 1 1 0.8; layer = <CALayer: 0x301e1d0a0>> delegate=0x112670000 standardAppearance=0x30355ae60 scrollEdgeAppearance=0x30355aed0, possibly from a client attempt to nest wrapped navigation controllers.' Last Exception Backtrace: 0 CoreFoundation 0x00000001a0cad08c 0x1a0c29000 + 540812 1 libobjc.A.dylib 0x000000019dfaf2e4 0x19df98000 + 94948 2 Foundation 0x00000001a007e15c 0x19f85c000 + 8528220 3 UIKitCore 0x00000001a36b6028 0x1a33f4000 + 2891816 4 UIKitCore 0x00000001a3404248 0x1a33f4000 + 66120 5 UIKitCore 0x00000001a354d878 0x1a33f4000 + 1415288 6 QuartzCore 0x00000001a2749630 0x1a26d1000 + 493104 7 UIKitCore 0x00000001a3447cd0 0x1a33f4000 + 343248 8 UIKitCore 0x00000001a34e9a60 0x1a33f4000 + 1006176 9 UIKitCore 0x00000001a354aa48 0x1a33f4000 + 1403464 10 UIKitCore 0x00000001a34f1c64 0x1a33f4000 + 1039460 11 UIKitCore 0x00000001a368e2c8 0x1a33f4000 + 2728648 12 UIKitCore 0x00000001a368c504 0x1a33f4000 + 2721028 13 UIKitCore 0x00000001a34193c8 0x1a33f4000 + 152520 14 UIKitCore 0x00000001a34191f4 0x1a33f4000 + 152052 15 UIKitCore 0x00000001a340ae84 0x1a33f4000 + 93828 16 CoreAutoLayout 0x00000001c3ad7030 0x1c3ac5000 + 73776 17 UIKitCore 0x00000001a340ddc8 0x1a33f4000 + 105928 18 UIKitCore 0x00000001a340c7f0 0x1a33f4000 + 100336 19 UIKitCore 0x00000001a378087c 0x1a33f4000 + 3721340 20 UIKitCore 0x00000001a37804f0 0x1a33f4000 + 3720432 21 UIKitCore 0x00000001a377e814 0x1a33f4000 + 3713044 22 UIKitCore 0x00000001a37ee8a4 0x1a33f4000 + 4171940 23 UIKitCore 0x00000001a37edf14 0x1a33f4000 + 4169492`
Topic: UI Frameworks SubTopic: UIKit
0
0
393
Oct ’24
Detect when a tvOS top shelf tile/slide transition occurs?
Our tvOS app makes use of top shelf Carousel style slides to promote our content. We would like to detect when tvOS transitions between individual top shelf slides, regardless of whether the slide transition is made by a user (via the Siri remote), or by the system idle auto-transition. Has anyone achieved this, maybe there are undocumented system hooks or events we can listen to?
0
0
456
Nov ’24
Swift pressesBegan no longer works iOS 18?
Previously this code would trigger fine on pressesBegan in iOS 17 and earlier versions, but no longer works in iOS 18. How can I start capturing pressesBegan in iOS 18? It seems like UIResponder is just not capturing the keyboard anymore? struct ContentView: View { var body: some View { KeyBoardView() } } //To Use in SwiftUI struct KeyBoardView: UIViewRepresentable{ func makeUIView(context: Context) -> KeyEventView { KeyEventView() } func updateUIView(_ uiView: KeyEventView, context: Context) { } class KeyEventView: UIView { init() { super.init(frame: CGRect(x: 0, y: 0, width: 0, height: 0)) } required init?(coder: NSCoder) { fatalError("init(coder:) has not been implemented") } override func pressesBegan(_ presses: Set<UIPress>, with event: UIPressesEvent?) { print("test") } } }
0
0
275
Oct ’24
How to set followsUserLocation and define a custom camera distance dynamically using MapKit for SwiftUI ?
Hello, I've created an app that follows the user as they navigate through public transport. I want the camera to follow the user and at the same time I want the camera distance (elevation) to change dynamically depending on speed and other factors. I've tried a first approach using camera keyframes, but I've noticed a lot of crashes when the app comes back to the foreground. .mapCameraKeyframeAnimator(trigger: cameraFrame) { camera in KeyframeTrack(\MapCamera.centerCoordinate) { LinearKeyframe(cameraFrame.center, duration: cameraFrame.duration, timingCurve: cameraFrame.curve) } KeyframeTrack(\MapCamera.distance) { LinearKeyframe(cameraFrame.distance, duration: cameraFrame.duration, timingCurve: cameraFrame.curve) } } Some logs mention wrong center coordinates (nan, nan) but when I print them, it's show me valid coordinates. I've also tried manually setting the camera for each position update, but the result is not smooth. position = .camera( .init(.init( lookingAtCenter: newPosition, fromDistance: cameraElevation, pitch: .zero, heading: .zero) ) ) What's the best way to achieve this?
0
0
303
Nov ’24
Suddenly getting "Trailing closure passed to parameter of type 'Visibility' that does not accept a closure" for toolbars
Not sure exactly what’s going on here. I’ve been building out this little app for the past couple of weeks using Xcode 16 betas, and in a couple of places I have code like this: EditItemView(item: inItem) .toolbar { ToolbarItem { Button(action: { self.printLabel(item: inItem) }) { Label("Print Label", systemImage: "printer.filled.and.paper") } } } Now all of a sudden I'm getting an error on .toolbar: “Trailing closure passed to parameter of type 'Visibility' that does not accept a closure.” Looking at the comment for toolbar, it says this method "specifies the visibility," which is a weird thing for it to do with a name like that. But it also has a deprecation tag that I don't quite understand: @available(macOS, introduced: 13.0, deprecated: 100000.0, renamed: "toolbarVisibility(_:for:)"). The name change makes sense, given the description. But what is the huge deprecation version number? Just a hack? And why is this code no longer compiling? As I'm commenting out instances of this, all my toolbars are failing in this way. ETA: yeah, I finally found the right declaration of .toolbar: func toolbar<Content>(@ViewBuilder content: () -> Content) -> some View where Content : View. It's no longer choosing that one. I hate Swift sometimes. ETA2: I finally whittled it down to it not liking Label for some reason. Replacing that with Image works. But of course, the compiler won't tell me why. ETA3: It's worse than I thought: I tried to make a small test case for a bug, and Label works just fine. Why does my code not?
Topic: UI Frameworks SubTopic: SwiftUI Tags:
0
1
700
Oct ’24
TitleLabel crash problem
Hello bro, I create a custom button like this way: UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom]; button.titleLabel.font = [UIFont fontWithName:fontName size:fontSize]; Then I receive any issue from the third crash collection platform: 0 libobjc.A.dylib 0x000000018fd1e694 _objc_moveWeak + 196 1 libobjc.A.dylib 0x000000018fd1e694 _objc_moveWeak + 196 2 CoreFoundation 0x0000000197e7da94 __CFXNotificationRegistrarAddObserver + 392 3 CoreFoundation 0x0000000197e7c864 _CFXNotificationRegistrarAdd + 580 4 CoreFoundation 0x0000000197e7c040 __CFXNotificationRegisterObserver + 248 5 UIKitCore 0x000000019a1b6c98 _UILabelCommonInit + 188 6 UIKitCore 0x000000019a1b69fc -[UILabel _commonInit] + 520 7 UIKitCore 0x000000019a1cdf88 -[UILabel initWithFrame:] + 56 8 UIKitCore 0x000000019a24824c -[UIButtonLabel _initWithFrame:button:] + 100 9 UIKitCore 0x000000019a247c14 -[UIButtonLegacyVisualProvider _newLabelWithFrame:] + 84 10 UIKitCore 0x000000019a15ee80 -[UIButtonLegacyVisualProvider _setupTitleViewRequestingLayout:] + 84 11 UIKitCore 0x000000019a15d81c -[UIButtonLegacyVisualProvider titleViewCreateIfNeeded:] + 44 12 UIKitCore 0x000000019a1cfa78 -[UIButton titleLabel] + 36 So would you please tell me how to avoid it?
Topic: UI Frameworks SubTopic: UIKit
0
0
322
Nov ’24
Core Data : about newBackgroundContext()
Hi everyone, I’m wondering about Core Data. When creating a private context using newBackgroundContext(), does it automatically set the parent to the view context, or is it independent? I'd appreciate it if anyone could clarify this for me. Thanks in advance! 😊
0
0
274
Sep ’24
How do I add alternative app icons for a SwiftUI tvOS app?
I am familiar with providing the main layered app icon for a tvOS project, but I cannot work out how to successfully add support for alternative layered icons in the info.plist and/or asset catalog and/or build settings for a SwiftUI (or Swift) tvOS project. Whenever I check the result of UIApplication.shared.supportsAlternateIcons it returns false I have witnessed other tvOS apps such as Plex successfully switch the app icon, so it must be possible to do. How should the project be configured, what am I missing?
0
0
607
Oct ’24
Unable to change UITabbar Background color in iOS 18 for ipad
I am trying to change UITabBar background color runtime as theme changed. It is already working in iOS 17 as I am updating UITabBar.appearance().barTintColor and tintColor But for iOS first i need to change because I don't want that new elevated tabbar so I create custom tabbar controller as described in https://stackoverflow.com/questions/78631030/how-to-disable-the-new-uitabbarcontroller-view-style-in-ipados-18 Accepted Answer by awulf. And by doing this, My tabbar looks same like Old and it is working in iPhone and ipad for iOS 16, iOS 17 and iOS 18 too. But the issue is that I am unable to change my tabbar background color. I have also checked this forum: https://forums.developer.apple.com/forums/thread/761056 But not able to change I have set below 3 properties but no effect let appearance = UITabBar.appearance() appearance.backgroundColor = appearance.barTintColor = appearance.tintColor = I have created CustomTabBarController in storyboard and all working fine Also the appearance changed only once per application lifecycle. It will change color by restarting the app then it will pick last selected theme and the colors are changed. but not able to change colors runtime I have also did below code for reloading purpose tabBar.setNeedsLayout() tabBar.setNeedsDisplay() But nothing work
0
1
976
Oct ’24
Cocoa Binding for custom class
So I was trying to use an NSArrayController to bind the contents of a property , first I tried using NSDictionary and it worked great, here's what I did: @interface ViewController : NSViewController @property IBOutlet ArrayController * tableCities; @end ... @implementation ViewController - (void)viewDidLoad { [super viewDidLoad]; NSString* filePath = @"/tmp/city_test.jpeg"; NSDictionary *obj = @{@"image": [[NSImage alloc] initByReferencingFile:filePath], @"name": @"NYC", @"filePath": filePath}; NSDictionary *obj2 = @{@"image": [[NSImage alloc] initByReferencingFile:filePath], @"name": @"Chicago", @"filePath": filePath}; NSDictionary *obj3 = @{@"image": [[NSImage alloc] initByReferencingFile:filePath], @"name": @"Little Rock", @"filePath": filePath}; [_tableCities addObjects:@[obj, obj2, obj3]]; } @end Now for an NSPopUpButton, binding the Controller Key to the ArrayController and the ModelKeyPath to "name" works perfectly and the popupbutton will show the cities as I expected. But now, instead of using an NSDictionary I wanted to use a custom class for these cities along with an NSMutableArray which holds the objects of this custom class. I'm having some trouble going about this.
0
0
419
Oct ’24
SwiftUI TabView lifecycle is weird
I tested the life cycle of TabView and its sub-Views through the demo and found something strange. Please help analyze it. Thank you. The demo project is here https://feedbackassistant.apple.com/feedback/15629780 Operation steps: Step 1: launch app Step 2: click Login button the below log is correct SettingsViewModel init HomeViewModel init HomeView appear Step 3: click Settings tab SettingsView appear (correct) Step 4: click Refresh TabView button the below log is incorrect Refresh TabView StatusViewModel init AccountViewModel init StatusViewModel init (weird) AccountViewModel init (weird) HomeView appear (weird) StatusViewModel deinit AccountViewModel deinit AccountView appear SettingsViewModel deinit HomeViewModel deinit Expect log: Refresh TabView SettingsViewModel deinit HomeViewModel deinit StatusViewModel init AccountViewModel init AccountView appear
0
0
312
Oct ’24
SwiftUI FocusState seems to 'misbehave' when Scene contains a DocumentGroup...
I have a view containing either a TextField or a SecureField. I'm hoping I can use a single FocusState value that will apply to either the TextField or SecureField. (I'm using FocusState to ensure the cursor will be in the field when it initially loads) I've verified this works in a sample project when the view is in a WindowGroup. But when I instead use a DocumentGroup ~50% of the time when the view loads/launches, it does not have focus. Here is my ContentView: struct ContentView: View { let coinFlip: Bool = .random() // used to choose between the TextField and the SecureField @State var fieldContent: String = "" // bound to the Field value @FocusState var focus: Bool var body: some View { VStack { Text("Coin Flip: \(coinFlip)") actualField .focused($focus, equals: true) } .onAppear() { focus = true } } @ViewBuilder var actualField: some View { if coinFlip { TextField("Enter text here", text: $fieldContent) } else { SecureField("Enter secure text here", text: $fieldContent) } } } and here is my App swift file @main struct ModernTurtleApp: App { var body: some Scene { // WindowGroup { // ContentView() // } DocumentGroup(newDocument: ModernTurtleDocument()) { file in ContentView() } } } When this code runs, the Field has focus about 50% of the time on initial launch. When I uncomment the WindowGroup and comment the DocumentGroup, the field always has focus on initial launch. I realize I can work around this behaviour by using an optional enum for FocusState. I would be ok going this route, but I first want to try to understand the behaviour I'm seeing, and possibly keep my simpler FocusState implementation. Thanks, in advance for any help.
0
0
405
Oct ’24
IOS Status bar is missing in the screenshot
I'm using React Native to create a mobile application.When I click on a button in my app, I need to programmatically take a screenshot of the current page of my application together with the iPhone status bar that shows the time, cellular provider, and battery level. However, my app page is being captured without having the statusbar. My 'screenshot taken' function is written in Objective-C. Is this happening because of any privacy-related concerns? Would you kindly assist me with this? Attaching the screenshot code, #import <UIKit/UIKit.h> #import <React/RCTBridgeModule.h> #import <React/RCTLog.h> @interface ScreenshotModule : NSObject @end @implementation ScreenshotModule RCT_EXPORT_MODULE(); RCT_REMAP_METHOD(takeStatusBarScreenshot, resolver:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject) { dispatch_async(dispatch_get_main_queue(), ^{ @try { // Get the status bar window UIWindow *statusBarWindow = [UIApplication sharedApplication].windows.firstObject; UIScene *scene = [UIApplication sharedApplication].connectedScenes.allObjects.firstObject; if ([scene isKindOfClass:[UIWindowScene class]]) { UIWindowScene *windowScene = (UIWindowScene *)scene; BOOL statusBarHidden = windowScene.statusBarManager.isStatusBarHidden; if (statusBarHidden) { NSLog(@"Status bar is hidden, app is in full-screen mode."); } else { NSLog(@"Status bar is visible."); } } else { NSLog(@"The scene is not a UIWindowScene."); } // Check if the statusBarWindow is valid if (!statusBarWindow) { reject(@"screenshot_failed", @"Status bar window not found", nil); return; } // Get the window scene and status bar frame UIWindowScene *windowScene = statusBarWindow.windowScene; CGRect statusBarFrame = windowScene.statusBarManager.statusBarFrame; // Log the status bar frame for debugging RCTLogInfo(@"Status Bar Frame: %@", NSStringFromCGRect(statusBarFrame)); // Check if the status bar frame is valid if (CGRectIsEmpty(statusBarFrame)) { reject(@"screenshot_failed", @"Status bar frame is empty", nil); return; } // Start capturing the status bar UIGraphicsBeginImageContextWithOptions(statusBarFrame.size, NO, [UIScreen mainScreen].scale); CGContextRef context = UIGraphicsGetCurrentContext(); // Render the status bar layer [statusBarWindow.layer renderInContext:context]; // Create an image from the current context UIImage *image = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); if (!image) { reject(@"screenshot_failed", @"Failed to capture screenshot", nil); return; } // Convert the image to PNG format and then to a base64 string NSData *imageData = UIImagePNGRepresentation(image); if (imageData == nil) { reject(@"screenshot_failed", @"Image data is nil", nil); return; } NSString *base64String = [imageData base64EncodedStringWithOptions:0]; // Log base64 string length for debugging RCTLogInfo(@"Base64 Image Length: %lu", (unsigned long)[base64String length]); // Optionally, save the image to a file (for debugging purposes) NSString *path = [NSTemporaryDirectory() stringByAppendingPathComponent:@"statusbar_screenshot.png"]; [UIImagePNGRepresentation(image) writeToFile:path atomically:YES]; RCTLogInfo(@"Status bar screenshot saved to: %@", path); // Resolve with the base64 image resolve(base64String); } @catch (NSException *exception) { reject(@"screenshot_error", @"Error while capturing status bar screenshot", nil); } }); } @end
Topic: UI Frameworks SubTopic: General
0
0
432
Oct ’24
How to share PHAsset with UIActivityViewController like Photos App?
I am building an app about photos and I want to create a photo sharing feature like Apple's Photos App. Please see Steps to Reproduce and attached project. The current share method has the following issues The file name of the shared photo changes to “FullSizeRender”. The creation and update dates of shared photos will change to the date they were edited or shared. I want to ensure that the following conditions are definitely met Share the latest edited version. The creation date should be when the original photo was first created. How can I improve the code? STEPS TO REPRODUCE class PHAssetShareManager { static func shareAssets(_ assets: [PHAsset], from viewController: UIViewController, sourceView: UIView) { let manager = PHAssetResourceManager.default() var filesToShare: [URL] = [] let group = DispatchGroup() for asset in assets { group.enter() getAssetFile(asset, resourceManager: manager) { fileURL in if let fileURL = fileURL { filesToShare.append(fileURL) } group.leave() } } group.notify(queue: .main) { self.presentShareSheet(filesToShare, from: viewController, sourceView: sourceView) } } private static func getAssetFile(_ asset: PHAsset, resourceManager: PHAssetResourceManager, completion: @escaping (URL?) -> Void) { print("getAssetFile") let resources: [PHAssetResource] switch asset.mediaType { case .image: if asset.mediaSubtypes.contains(.photoLive) { // let editedResources = PHAssetResource.assetResources(for: asset).filter { $0.type == .fullSizePairedVideo } // let originalResources = PHAssetResource.assetResources(for: asset).filter { $0.type == .pairedVideo } let editedResources = PHAssetResource.assetResources(for: asset).filter { $0.type == .fullSizePhoto } let originalResources = PHAssetResource.assetResources(for: asset).filter { $0.type == .photo } resources = editedResources.isEmpty ? originalResources : editedResources } else { let editedResources = PHAssetResource.assetResources(for: asset).filter { $0.type == .fullSizePhoto } let originalResources = PHAssetResource.assetResources(for: asset).filter { $0.type == .photo } resources = editedResources.isEmpty ? originalResources : editedResources } case .video: let editedResources = PHAssetResource.assetResources(for: asset).filter { $0.type == .fullSizeVideo } let originalResources = PHAssetResource.assetResources(for: asset).filter { $0.type == .video } resources = editedResources.isEmpty ? originalResources : editedResources default: print("Unsupported media type") completion(nil) return } guard let resource = resources.first else { print("No resource found") completion(nil) return } let fileName = resource.originalFilename let tempDirectoryURL = FileManager.default.temporaryDirectory let localURL = tempDirectoryURL.appendingPathComponent(fileName) // Delete existing files and reset cache if FileManager.default.fileExists(atPath: localURL.path) { do { try FileManager.default.removeItem(at: localURL) } catch { print("Error removing existing file: \(error)") } } let options = PHAssetResourceRequestOptions() options.isNetworkAccessAllowed = true resourceManager.writeData(for: resource, toFile: localURL, options: options) { (error) in if let error = error { print("Error writing asset data: \(error)") completion(nil) } else { completion(localURL) } } } private static func presentShareSheet(_ items: [Any], from viewController: UIViewController, sourceView: UIView) { print("presentShareSheet") let activityViewController = UIActivityViewController(activityItems: items, applicationActivities: nil) if UIDevice.current.userInterfaceIdiom == .pad { activityViewController.popoverPresentationController?.sourceView = sourceView activityViewController.popoverPresentationController?.sourceRect = sourceView.bounds } viewController.present(activityViewController, animated: true, completion: nil) } }```
0
0
528
Oct ’24
Problem with ScrollView
Hi guys, I have a really odd problem. Whenever I try to add a vertical ScrollView, VStack or a LazyVStack to this code everything disappears. Anyone have an idea why this is happening and how to fix it? No errors show up in my code. GeometryReader{ geometry in VStack(alignment: .center, spacing: 100){ ScrollView(.horizontal, showsIndicators: false){ HStack(spacing: 250){ CardView1( showOnlyImage: false, imagename1: "TheMiceGalaxiesHubble", heading1: "The Mice Galaxies", description1: "Located in the constellation Coma Berenices." ) .scaleEffect(getScale(proxy: geometry)) .animation(.easeOut(duration: 0.3), value: getScale(proxy: geometry)) CardView1( showOnlyImage: false, imagename1: "TheMiceGalaxiesHubble", heading1: "The Mice Galaxies", description1: "Located in the constellation Coma Berenices." ) .scaleEffect(getScale(proxy: geometry)) .animation(.easeOut(duration: 0.3), value: getScale(proxy: geometry)) } } .frame(height: -200) ScrollView(.horizontal, showsIndicators: false){ HStack(spacing: 250){ CardView1( showOnlyImage: false, imagename1: "TheMiceGalaxiesHubble", heading1: "The Mice Galaxies", description1: "Located in the constellation Coma Berenices." ) .scaleEffect(getScale(proxy: geometry)) .animation(.easeOut(duration: 0.3), value: getScale(proxy: geometry)) } } } } } .contentMargins(50, for: .scrollContent) .scrollTargetBehavior(.viewAligned) .scrollTargetLayout() .padding(.horizontal, 10) .padding(.top, -35) .padding(.bottom, 50) } } } } }
Topic: UI Frameworks SubTopic: SwiftUI
0
0
279
Oct ’24
OSLog Logger & SwiftUI
Hi, Are there any macros that can be used with Logger to automatically capture the SwiftUI function that the message originates from? Currently, I am using something similar to: Logger.misc.error("In \(#fileID), \(#function): \(error)") Currently, the #function only tells me that it originates in body... Ideally, I'd like to be able to tell if it was with an onAppear, onChange, Button, alert, etc... I realize I can manually enter this, but was wondering if there was a more automated way to capture this info. Thx,
Topic: UI Frameworks SubTopic: SwiftUI
0
0
232
Dec ’24
3rd party OSS license string in settings.bundle could not been displayed in iOS 18
Hello, Dear Developers Problem Description My team is working on functionality test in iOS18. Basically, application functionality works as expected without any modification. However, We found a small issue in settings application. iOS 17 In iOS17, 3rd party OSS license string in settings application would been displayed if the license button is been clicked. Model: iPhone SE 3 OS Version: 17.6.1 iOS 18 However, in iOS18, nothing but a blank page. Model: iPhone SE 3 OS Version: 18.0.1 Settings.bundle Below are files in settings.bundle. What I've searched Using XCode 16 makes no change Nothing about settings.bundle in iOS 18 release note A similar post: https://forums.developer.apple.com/forums/thread/764519 The solution in the post doesn't solve my problem. If you know the solution, please let me know. Best wishes.
0
0
408
Oct ’24
tableView works properly in older iphones, but fails in newer ones
I have an ios application where I have a tab and a container view. Container view changes according to the tab I have selected. Issue I am facing is that that my table view shows all cells properly in older iphones(iphone with home button), while in newer iphones(iphone with home bar), table view doesn't scroll till the end and hides bottom cell. I have tried adding all necessary constraints and content insets, but still it is giving me same issue I have different class for tabBar, tabBar+containerView, and all related view controllers based on tab selected. Please help me find the solution to this. Thanks
0
0
332
Dec ’24
How to close the keyboard using SwiftUI
I've been having trouble with finding a good way to allow the user to close the keyboard. Naturally, I'd like to use the keyboard toolbar but it's so inconsistent, it's impossible. Sometimes it shows up, other times it doesn't. At the moment, it's not appearing at all no matter where I put it. On the NavigationStack, on the List inside of it, on the TextField. It just doesn't appear. I added a TapGesture to my view to set my FocusState that I'm using for the fields back to nil, however, this stops the Picker I have from working. I tried using SimultaneousGesture with TapGesture, and that didn't work. For example: .simultaneousGesture( TapGesture() .onEnded() { if field != nil { field = nil } } ) With the current setup, each TextField switches to the next TextField in the onSubmit. The last one doesn't, which will close the keyboard, but I want to give people the option to close the keyboard before that. Does anyone have a good way to close the keyboard?
Topic: UI Frameworks SubTopic: SwiftUI
0
0
326
Sep ’24