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

Unrealistically high snowfall amounts being reported by WeatherKit
I filed FB16332997 about the VERY high snowfall estimates I'm seeing in WeatherKit and iOS Weather. I initially thought something was wrong with my weather app but I verified the numbers with the iOS Weather app and another third party weather app. For Atlanta last week it was saying 7.5" when it ended up being 2" (which I can live with). Two days ago it reported there could be 16" of snow in northern Florida. That's impossible! This morning it was reporting that Niceville could have 6-7" of snow, which would be significantly more than highest amount in recorded history for Florida (where snow is extremely rare). It almost makes me wonder if the liquid precipitation value is actually the snowfall amount in reality. And then that is incorrectly being converted to the snowfall amount.
2
0
427
Jan ’25
UIDocumentBrowserViewController - adjust order and color of navigation bar items
I'm using UIDocumentBrowserViewController. This view controller automatically creates a TabView with navigation titles and up to two trailing navigation bar items. To visualize this, open the Files app by Apple on an iPhone. I want to do the following: Add a third button and place it farthest on the trailing side. Keep all three buttons blue (the default color), but adjust the color of the navigation title to use the primary text color (it is also currently blue, by default) Button Order If my button is represented by C, then the order from left-to-right or leading-to-trailing should be A B C. I tried to add it by using additionaltrailingnavigationbarbuttonitems: class DocumentBrowserViewController: UIDocumentBrowserViewController, UIDocumentBrowserViewControllerDelegate { override func viewDidLoad() { super.viewDidLoad() let button = UIBarButtonItem(...) additionalTrailingNavigationBarButtonItems.append(button) } } This always adds it as the leftmost trailing item. The order when the view loads is C A B, where C represents my button. Here are some things I've tried: Add it in viewWillAppear - same results. Add it in viewDidAppear - same results. Add it using rightBarButtonItems - does not show up at all. insert it at: 0 instead of appending it - same results. Add it with a delay using DispatchQueue.main.async - same results. After some experimentation, I realized that the arrays referenced by additionalTrailingNavigationBarButtons and rightBarButtonItems seem to be empty, other than my own button. This is the case even if the DispatchQueue delay is so long that the view has already rendered and the two default buttons are clearly visible. So I'm not sure how to place my button relative to these, since I can't figure out where they actually are in the view controller's properties. How do I put my button farther to the trailing/right side of these two default buttons? Title Color The navigation titles created by UIDocumentBrowserViewController are blue when not in their inline format. I want them to use the primary text color instead. In viewDidLoad, I could do something like this: UINavigationBar.appearance().tintColor = UIColor.label This will change the title color to white or black, but it will also change the color of the buttons. I've tried various approaches like titleTextAttributes, and none of them seem to work with this view controller. How do I change just the color of the navigation title, and not the color of the navigation bar items?
Topic: UI Frameworks SubTopic: UIKit
0
0
350
Jan ’25
App Clip No Available
1.APPStore Arraignment passed. Not yet released. The diagnostic link configuration is not available. Firstly,We filled in the configuration of the corresponding domain name, and the verification was successful. My AASA file is configured correctly (general deep links work with it, as well as some app clip URLs) and is also configured for app clips. "applinks": { "apps": [], "details": [ { "appID": "xxx.com.xx.easyshare", "paths": [ "*" ] }, { "appID": "xxx.com.xx.easyshareExport", "paths": [ "*" ] } ] }, "appclips": { "apps": [ "xxx.com.xx.easyshare.Clip" ] } } Well,I used https://es.xx.com/send or https://es.xx.com to get diagnostic information is wrong My TestFight config is ok Another problem is that using NFT jumps directly to Safire.
1
0
338
Jan ’25
Getting Error: Type '()' cannot conform to 'View'
can't see what the problem is .. Im getting the error: Type '()' cannot conform to 'View' struct CalendarView: View { @StateObject private var viewModel = CalendarViewModel() @State private var selectedDate: CalendarDate? @State private var showModal = false var body: some View { VStack { Text("Calendar App") .font(.largeTitle) .padding() GridStack(rows: 5, columns: 7) { row, col in let index = row * 7 + col if index < viewModel.calendarDates.count { let calendarDate = viewModel.calendarDates[index] Text("\(Calendar.current.component(.day, from: calendarDate.date))") .frame(width: 40, height: 40) .background(calendarDate.isSelected ? Color.blue : Color.clear) .cornerRadius(10) .foregroundColor(calendarDate.isSelected ? Color.white : Color.black) .onLongPressGesture { selectedDate = calendarDate showModal = true } } } } .background(Color.gray) .sheet(isPresented: $showModal) { if let date = selectedDate { DateSelectionModal(selectedDate: date) } } } } struct GridStack<Content: View>: View { let rows: Int let columns: Int let content: (Int, Int) -> Content var body: some View { VStack { ForEach(0..<rows) { row in HStack { ForEach(0..<columns) { column in content(row, column) } } } } } } #Preview { CalendarView() }
Topic: UI Frameworks SubTopic: SwiftUI
2
0
190
Feb ’25
Keyboard will not show when setting focus on a SwiftUI text field from a button in an ornament on visionOS
Using a button that is placed in the bottom ornament to set focus on a text field will not display the keyboard properly while a button embedded in the view will behave as expected. To demonstrate the issue, simply run the attached project on Vision Pro with visionOS 1.1 and tap the Toggle 2 button in the bottom ornament. You’ll see that the field does have focus but the keyboard is now visible. Run the same test with Toggle 1 and the field will get focus and the keyboard will show as expected. import SwiftUI import RealityKit import RealityKitContent struct ContentView: View { @State private var text = "" @State private var showKeyboard = false @FocusState private var focusedField: FocusField? private enum FocusField: Hashable { case username case password } var body: some View { VStack { TextField("Test", text: $text) .focused($focusedField, equals: .username) Text("Entered Text: \(text)") .padding() Button("Toggle 1") { // This button will work and show the keyboard if focusedField != nil { focusedField = nil } else { focusedField = .username } } Spacer() } .padding() .toolbar { ToolbarItem(placement: .bottomOrnament) { Button("Toggle 2") { // This button will set focus properly but not show the keyboard if focusedField != nil { focusedField = nil } else { focusedField = .username } } } } } } Is there a way to work around this? FB13641609
1
0
757
Jan ’25
Numerous Undefined symbol errors
Getting these two warnings: Could not find or use auto-linked framework 'CoreAudioTypes': framework 'CoreAudioTypes' not found Could not parse or use implicit file '/Applications/Xcode16.0/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/Frameworks/SwiftUICore.framework/SwiftUICore.tbd': cannot link directly with 'SwiftUICore' because product being built is not an allowed client of it Followed by 100 + errors like below Undefined symbol: _TIFFCleanup & Undefined symbol: _TIFFReadRGBAImageOriented ..... Any ideas? I have tried adding CoreAudioTypes etc. Error is not clear. Am trying to stop using Rosetta
Topic: UI Frameworks SubTopic: General
2
0
781
Dec ’24
Why timer isn't working with button in SwiftUI
.onReceive construction isn't working with button long press gesture but tap is working, it increases count by 1. Construction should increase count every 0.5 seconds if button pressed struct Test: View { @State private var count = 0 @State private var isLongPressed = false var body: some View { VStack { Text("Count: \(count)") Button("Increase") { count += 1 print("Button tapped") } .onLongPressGesture { isLongPressed = true print("Long press started") } .onLongPressGesture(minimumDuration: 0) { isLongPressed = false print("Long press ended") } } .onReceive(Timer.publish(every: 0.5, on: .main, in: .common).autoconnect()) { _ in if isLongPressed { count += 1 print("Count increased: \(count)") } } } }
1
0
388
Jan ’25
Screen capture notification in MacOs catalyst
We have a IOS app and we are using the same app for Mac Catalyst. In IOS we are able to detect when user take the screenshot using UIApplicationUserDidTakeScreenshotNotification. But in MACCatalyst it is not working. As per docs UIApplicationUserDidTakeScreenshotNotification and UIScreenCapturedDidChangeNotification are both supported for MacCatalyst 13.1+. But I am not getting screen shot notifications using both
3
0
498
Feb ’25
Using AsyncStream vs @Observable macro in SwiftUI (AVCam Sample Code)
I want to understand the utility of using AsyncStream when iOS 17 introduced @Observable macro where we can directly observe changes in the value of any variable in the model(& observation tracking can happen even outside SwiftUI view). So if I am observing a continuous stream of values, such as download progress of a file using AsyncStream in a SwiftUI view, the same can be observed in the same SwiftUI view using onChange(of:initial) of download progress (stored as a property in model object). I am looking for benefits, drawbacks, & limitations of both approaches. Specifically, my question is with regards to AVCam sample code by Apple where they observe few states as follows. This is done in CameraModel class which is attached to SwiftUI view. // MARK: - Internal state observations // Set up camera's state observations. private func observeState() { Task { // Await new thumbnails that the media library generates when saving a file. for await thumbnail in mediaLibrary.thumbnails.compactMap({ $0 }) { self.thumbnail = thumbnail } } Task { // Await new capture activity values from the capture service. for await activity in await captureService.$captureActivity.values { if activity.willCapture { // Flash the screen to indicate capture is starting. flashScreen() } else { // Forward the activity to the UI. captureActivity = activity } } } Task { // Await updates to the capabilities that the capture service advertises. for await capabilities in await captureService.$captureCapabilities.values { isHDRVideoSupported = capabilities.isHDRSupported cameraState.isVideoHDRSupported = capabilities.isHDRSupported } } Task { // Await updates to a person's interaction with the Camera Control HUD. for await isShowingFullscreenControls in await captureService.$isShowingFullscreenControls.values { withAnimation { // Prefer showing a minimized UI when capture controls enter a fullscreen appearance. prefersMinimizedUI = isShowingFullscreenControls } } } } If we see the structure CaptureCapabilities, it is a small structure with two Bool members. These changes could have been directly observed by a SwiftUI view. I wonder if there is a specific advantage or reason to use AsyncStream here & continuously iterate over changes in a for loop. /// A structure that represents the capture capabilities of `CaptureService` in /// its current configuration. struct CaptureCapabilities { let isLivePhotoCaptureSupported: Bool let isHDRSupported: Bool init(isLivePhotoCaptureSupported: Bool = false, isHDRSupported: Bool = false) { self.isLivePhotoCaptureSupported = isLivePhotoCaptureSupported self.isHDRSupported = isHDRSupported } static let unknown = CaptureCapabilities() }
0
0
376
Dec ’24
GeometryReader problem
I'm adding Admob ads to my app, and Admob needs to know the width of the view, so I'm using GeometryReader for that. To prevent GeometryReader from grabbing screen space, I've wrapped the main view in GeometryReader { }. I then use geometry.size.width in my call to the adView. This all works fine. I have two main screens where I show ads, and they both work, until I rotate the device. Then the app crashes! If I comment out the GeometryReader code and pass a fixed value to the ad view, I can rotate the device with no fear of a crash. My question is: Do I have to accept that GeometryReader will crash the app when it's rotated, or is there another, stable way to get view dimensions?
3
0
521
Dec ’24
Crash when typing Japanese in TextEditor with TextSelection binding.
Environment Mac mini M4 Pro macOS: Version 15.1.1 (24B2091) Xcode: Version 16.1 (16B40) IME: Kotoeri, Google IME Code description struct ContentView: View { @State var text = “” @State var selection: TextSelection? var body: some View { VStack { TextEditor(text: $text, selection: $selection) } .padding() } } Issue Description When built for macOS (not Catalyst, Designed for iPad) and typing “あ” in Japanese input, it crashes. I tried using Kotoeri's Kana input, Kotoeri's Roman input, and Google IME, but the same error occurs and crashes in both cases. There is no issue when using English input. Errors (input method 56222 com.apple.inputmethod.Kotoeri.KanaTyping) (1): Fatal error: String index is out of bounds (input method 56338 com.apple.inputmethod.Kotoeri.RomajiTyping (1): Fatal error: String index is out of bounds Swift/StringUTF16View.swift:368: Fatal error: String index is out of bounds
Topic: UI Frameworks SubTopic: SwiftUI
1
0
354
Jan ’25
How does UIScene know whether it has the main key window and when it changes on iPad's multi-scene?
Hi. I know to know which window gets hardware keyboard events (such as shortcut key) currently on iPad. Until iPadOS 15.0, UIApplication.shared.keyWindow, which was deprecated on iPadOS 13.0 and didBecomeKeyNotification/didResignKeyNotification. But after iPadOS 15.0, a keyWindow is managed by UIScene, not by UIApplication. Each scene of my app always has just one window. For my purpose, checking deprecated UIApplication.shared.keyWindow is still effective but didBecomeKeyNotification and didResignKeyNotification don't work because they are fired when a change happens only inside the scene. So my questions are, What is the new alternative of UIApplication.shared.keyWindow? I know a wrong hack like UIApplication.shared.connectedScenes.compactMap { $0 as? UIWindowScene }.first?.windows.filter { $0.isKeyWindow }.first does not work since the order of connectedScenes is not related with getting hardware keyboard events. What are the new alternatives of didBecomeKeyNotification/didResignKeyNotification which work on inter-scene? The second question is more crucial. Because about the first question, I can still use deprecated UIApplication.shared.keyWindow. Thanks.
Topic: UI Frameworks SubTopic: General Tags:
0
0
237
Feb ’25
Context menu previews are ignoring the parent's scaleEffect() modifier
If you add the .scaleEffect() modifier to a parent view inside of which there are children with contextMenu()-s, the context menu preview unfortunately keeps the original, unscaled size of the child view. This results in a very weird, glitchy user experience. Unfortunately, providing a custom preview that is scaled up also does not help, since even though it is the right size, it gets cropped to the unscaled size of the child view. Adding scaleEffect() to each child element individually (BEFORE the contextMenu() modifier!) does make the problem disappear. However, I would like to avoid this, since my use case is zooming into a complex graph with context menus on its nodes, and having to recalculate the position of each node manually seems to perform much worse than delegating that work to scaleEffect(). Tested on iOS 18.2 (device + emulator) Is there a workaround? Here is a minimal working example that demonstrates the problem: struct ContentView: View { var body: some View { VStack(spacing: 20) { Rectangle() .frame(width: 100, height: 100) .contextMenu { Button("Test") {} Button("Test") {} } Rectangle() .frame(width: 100, height: 100) .contextMenu { Button("Test") {} Button("Test") {} } } .scaleEffect(1.5) } } Screenshot (problem: The two squares are the same size. However, the long-tapped upper square got shrunk down before the context menu got displayed.)
Topic: UI Frameworks SubTopic: SwiftUI
2
0
285
Feb ’25
SFSafariViewController's preferred colors are invalidated after rotation
There are two issues about SFSafariViewController. After rotate from landscape to portrait, The topAnchor is destroyed. The specified bar tint color and control tint color are invalidated.(Returns to system color) Regarding the second issue, I’ve found a temporary workaround. Override the viewWillTransition(to:with:) and keep it empty. Don't call super.viewWillTransition(to:with:). Since UIKit is not open source, I don’t know the exact cause, but I found something that could be the key to the issue. So, I reported it to Apple Feedback Assistant. You can check the details and the sample project in the GitHub repository below. https://github.com/ueunli/SafariViewer
0
0
302
Feb ’25
tvOS: Search Keyboard Unresponsive After Dismissing Custom Controller with Embedded TVDigitEntryViewController
Description I'm developing a tvOS application where I utilize a UISearchController embedded within a UISearchContainerViewController for search functionality. In a particular flow, a custom view controller contains a TVDigitEntryViewController as a child, with its modalPresentationStyle set to .blurOverFullScreen. The issue arises when a user initiates the PIN entry but decides to cancel and return to the search interface without entering a PIN. Upon returning, the search keyboard is no longer visible, and attempts to focus or interact with it are unsuccessful. Steps to Reproduce Initialize and present a UISearchContainerViewController that contains a UISearchController with a results view controller. Within the search results, present a custom view controller containing TVDigitEntryViewController as a child, setting its modalPresentationStyle to .blurOverFullScreen. Dismiss the custom view controller without entering a PIN (e.g., by pressing the Menu button on the remote). Observe that upon returning to the search interface, the keyboard is missing, and focus interactions are unresponsive. Observed Behavior After dismissing the custom view controller with TVDigitEntryViewController, the search keyboard does not reappear, and the focus system seems to lose track of the search input field. Expected Behavior The search keyboard should remain visible and functional after dismissing the custom view controller, allowing users to continue their search without interruption. Additional Context I have reviewed the TVDigitEntryViewController documentation (developer.apple.com) and related discussions on the Apple Developer Forums but have not found a solution to this specific issue. Questions Has anyone encountered a similar issue or have insights into why the search keyboard becomes unresponsive after dismissing a .blurOverFullScreen modal with a child TVDigitEntryViewController? Are there recommended practices to ensure the search keyboard remains active and focusable after such modal presentations? Any guidance or suggestions would be greatly appreciated. Thank you!
3
0
415
Feb ’25
SwiftUI TabVIew Faulting while switching between Tabs
I'm working on a SwiftUI based application for MacOS. I have a TabView component with two child Tab components. These Tab components display a List, each derived from an array of elements. While the application is running, clicking on the tabs in the TabView should switch between the views of different Lists. What I'm experiencing is that switching between the tabs causes a FAULT. With errors: Row index 1 out of row range (numberOfRows: 1) for <SwiftUI.SwiftUIOutlineListView: 0x1299d2000> Followed by: ( 0 CoreFoundation 0x000000019e096e80 __exceptionPreprocess + 176 1 libobjc.A.dylib 0x000000019db7ecd8 objc_exception_throw + 88 2 AppKit 0x00000001a1c744e8 -[NSTableRowData _availableRowViewWhileUpdatingAtRow:] + 0 3 SwiftUI 0x00000001cd8953f4 $s7SwiftUI0A17UIOutlineListViewC11removeItems2at8inParent13withAnimationy10Foundation8IndexSetV_ypSgSo07NSTableeL7OptionsVtF + 1232 ... ... ) And finally: FAULT: NSTableViewException: Row index 1 out of row range (numberOfRows: 1) for <SwiftUI.SwiftUIOutlineListView: 0x1299d2000>; (user info absent) This error happens when switching between the two tabs, defined thusly: @main struct MyApp: App { @State var rootDirectory: URL @State var selectedItem: URL @State var projectNavItems: [NavigationItem] = [] @State var jotNavItems: [NavigationItem] = [] @State var importerIsPresented: Bool = false let fileManager = FileManager.default init() { rootDirectory = URL(string: FileManager.default.currentDirectoryPath)! selectedItem = URL(string: FileManager.default.currentDirectoryPath)!.appendingPathComponent("README.md") } var body: some Scene { WindowGroup { NavigationSplitView { TabView { Tab("Projects", systemImage: "tray.and.arrow.down.fill") { List(projectNavItems, selection: $selectedItem) { // Changing this NavigationLink line to Text($0.title) makes no difference NavigationLink($0.title, value: $0.id) } } Tab("Jots", systemImage: "tray.and.arrow.up.fill") { List(jotNavItems, selection: $selectedJot) { // Can be written as Text($0.title) with no change in behavior NavigationLink($0.title, value: $0.id) } } } } detail: { Editor(for: selectedItem) } .fileImporter( isPresented: $importerIsPresented, allowedContentTypes: [UTType.folder], allowsMultipleSelection: false ) { result in // Code that gets a security scoped resource and populates the // projectNavItems: [NavItem] and jotNavItems: [NavItem] // arrays } } .commands(content: { CommandGroup (before: .newItem) { Button("Open Journal...") { importerIsPresented.toggle() } } }) } } The error only happens when both Tab views are populated by a List. If the Tab view have different child components, say a List, and a ForEach of Text components, switching between the tabs doesn't produce this error. List views with Text child components also produce this error. Here are screenshots of the running application Once the user selects a directory, we see the first Tab > List component populated by contents from the projectNavItems array: Clicking on the 'Jots' tab switches to the appropriate tab and correctly lists the items in the jotNavItems array, except there are additional lines, seemingly showing that there's an issue. Clicking back on the 'Projects' tab switches back, but now the List shows only one of the items from the projectNavItems array. Finally, clicking on 'Jots' again causes the errors to print in the console and interactivity with the tab components ceases. Last screenshot is representative of this state as the application FAULTS. This seems like a bug in SwifUI, wondering what workarounds I might be able to implement. I can provide the full backtrace, I cropped it for content length.
2
0
425
Jan ’25
iPhone mirroring and controlling
One of my clients is interested in developing a system similar to BrowserStack for internal team usage. Could you please guide me on how to approach the development of this system? Specifically, the project requires: Full iPhone screen recording. Capturing and executing click events on the iPhone. Do I need to obtain permission from Apple for these functionalities?
0
0
367
Jan ’25
Monintoring Picture in Picture is hide in Device Edge.
I am developing a custom Picture in Picture (PiP) app that plays videos. The video continues to play even when the app goes to the background, but I would like to be able to get the bool value when the PiP is hidden on the edge, as shown in the attached image. The reason why we need this is because we don't want the user to consume extra network bandwidth, so we want to pause the video when the PiP is hidden on the edge of the screen. Please let me know if this is possible. This can be done in the foreground or in the background.
1
0
339
Jan ’25
Application threw exception NSInternalInconsistencyException: Multi layer delegate table missing.
I recently detected a special crash on 18.0, 18.1, 18.1.1, 18.2,18.3 which cannot be repeated, and the page logs are related to the keyboard, is there any idea to deal with this problem? Exception Category: nsexception Exception Type: EXC_CRASH (SIGABRT) Exception Codes: 0x00000000 at 0x0000000000000000 Crashed Thread: 0 CrashDoctor Diagnosis: Application threw exception NSInternalInconsistencyException: Multi layer delegate table missing. Thread 0 Crashed: 0 CoreFoundation 0x00000001869d87cc __exceptionPreprocess + [ : 164] 1 libobjc.A.dylib 0x0000000183cab2e4 objc_exception_throw + [ : 88] 2 Foundation 0x0000000185da88d8 _userInfoForFileAndLine 3 UIKitCore 0x0000000189e78074 -[UIView _multiLayerDelegatesTableCreateIfNecessary:] + [ : 208] 4 UIKitCore 0x0000000189e780c4 -[UIView _registerMultiLayerDelegate:] + [ : 36] 5 UIKitCore 0x00000001894874c0 -[_UIPortalView setSourceView:] + [ : 132] 6 UIKitCore 0x000000018a1eb6bc -[_UIPortalView initWithSourceView:] + [ : 68] 7 UIKitCore 0x000000018a213ea4 -[_UITextMagnifiedLoupeView initWithSourceView:] + [ : 444] 8 UIKitCore 0x000000018a6c461c +[UITextLoupeSession _makeLoupeViewForSourceView:selectionWidget:orientation:] + [ : 84] 9 UIKitCore 0x000000018a6c47bc +[UITextLoupeSession _beginLoupeSessionAtPoint:fromSelectionWidgetView:inView:orientation:] + [ : 304] 10 UIKitCore 0x0000000189d50ce0 -[UITextRefinementTouchBehavior textLoupeInteraction:gestureChangedWithState:location:translation:velocity:modifierFlags:shouldCancel:] + [ : 1756] 11 UIKit 0x0000000240e309e0 -[UITextRefinementTouchBehaviorAccessibility textLoupeInteraction:gestureChangedWithState:location:translation:velocity:modifierFlags:shouldCancel:] + [ : 216] 12 UIKitCore 0x000000018a4d45b4 -[UITextRefinementInteraction loupeGestureWithState:location:translation:velocity:modifierFlags:shouldCancel:] + [ : 124] 13 UIKitCore 0x000000018a4d3f74 -[UITextRefinementInteraction loupeGesture:] + [ : 548] 14 UIKitCore 0x000000018952eac4 -[UIGestureRecognizerTarget _sendActionWithGestureRecognizer:] + [ : 128] 15 UIKitCore 0x000000018952e934 _UIGestureRecognizerSendTargetActions + [ : 92] 16 UIKitCore 0x000000018952e6f4 _UIGestureRecognizerSendActions + [ : 284] 17 UIKitCore 0x00000001891e1b28 -[UIGestureRecognizer _updateGestureForActiveEvents] + [ : 572] 18 UIKitCore 0x00000001891b3724 _UIGestureEnvironmentUpdate + [ : 2488] 19 CoreFoundation 0x000000018697a1f4 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + [ : 36] 20 CoreFoundation 0x0000000186979f98 __CFRunLoopDoObservers + [ : 552] 21 CoreFoundation 0x00000001869a9028 __CFRunLoopRun + [ : 948] 22 CoreFoundation 0x00000001869a8830 CFRunLoopRunSpecific + [ : 588] 23 GraphicsServices 0x00000001d29881c4 GSEventRunModal + [ : 164] 24 UIKitCore 0x000000018950eeb0 -[UIApplication _run] + [ : 816] 25 UIKitCore 0x00000001895bd5b4 UIApplicationMain + [ : 340] 26 顺丰小哥 0x0000000104423cc0 main + [main.m : 13] 27 (null) 0x00000001ac396ec8 0x0 + 7184412360
Topic: UI Frameworks SubTopic: UIKit
0
0
285
Dec ’24
UITabBarController y psoition issue for iOS 18
I am trying to give bottom padding to tabbar i.e ** tabBarFrame.origin.y = view.frame.height - tabBarHeight - 30** but it is not moving up from bottom, it gets sticked to bottom = 0 and the tabbar content moving up taher than tabbar itself.. Code snippet is - `i override func viewDidLayoutSubviews() { super.viewDidLayoutSubviews() let tabBarHeight: CGFloat = 70 // Custom height for the capsule tab bar var tabBarFrame = tabBar.frame tabBarFrame.size.height = tabBarHeight tabBarFrame.size.width = view.frame.width - 40 tabBarFrame.origin.y = view.frame.height - tabBarHeight - 30 tabBarFrame.origin.x = 20 tabBar.frame = tabBarFrame tabBar.layer.cornerRadius = tabBarHeight / 2 tabBar.clipsToBounds = true view.bringSubviewToFront(tabBar) }` Can anyone please help to resolve the issue for iOS 18, it is coming in iOS 18 rest previous versions are fine with the code.
0
0
328
Jan ’25