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

TabView Alignment Issue Inside a Popover on iPadOS
I've encountered an issue when using TabView inside a Popover on iPadOS, and I wanted to see if anyone else has run into this or if there's a known workaround before I file a bug report. Issue: When placing a TabView inside a Popover on iPadOS, the tab bar is not center-aligned correctly if the popover’s arrow appears on either the leading or trailing edge. It seems that the centering calculation for the TabView includes the width of the arrow itself. If the popover arrow is on the left, the tabs inside the TabView are pushed to the left. If the popover arrow is on the right, the tabs shift toward the right. This suggests that SwiftUI is incorporating the popover arrow’s width into the alignment calculation, which results in the misalignment. Questions: Has anyone else encountered this behavior? Is there a known workaround to ensure proper centering? If this is indeed a bug, should I file a report through Feedback Assistant? Any insights would be greatly appreciated!
0
0
5
6h
ForEach with binding seems to be broken in iOS 18.3.1 and iOS 18.4
Super easy to reproduce. Swiping to delete on the last remaining item in the list causes an index out of bounds exception. If you have 2 items in your list, it will only happen when you delete the last remaining item. From my testing, this issue occurs on 18.3.1 and onward (the RC it happens). I didn't test 18.3.0 so it might happen there as well. The only workarounds I have found is to add a delay before calling my delete function: OR to comment out the Toggle. So it seems as though iOS 18.3.x added a race condition in the way the ForEach accesses the values in its binding. Another thing to note, this also happens with .swipeActions, EditMode, etc... any of the built in ways to delete an item from a list. import SwiftUI struct ContentView: View { @StateObject var viewModel = ContentViewModel() var body: some View { List { ForEach($viewModel.items) { $item in HStack { Image(systemName: "globe") .imageScale(.large) .foregroundStyle(.tint) Text($item.text.wrappedValue) Spacer() Toggle(String(""), isOn: $item.isActive) .labelsHidden() } } .onDelete(perform: delete) } } func delete(at offsets: IndexSet) { // uncomment task to make code not crash // Task { viewModel.deleteItem(at: offsets) // } } } struct MyItem: Identifiable { var id: UUID = UUID() var text: String var isActive: Bool } class ContentViewModel: ObservableObject { @Published var items: [MyItem] = [MyItem(text: "Hello, world!", isActive: false)] func deleteItem(at offset: IndexSet) { items.remove(atOffsets: offset) } }
0
1
24
7h
[Suggestion] SwiftUI convenience environment navigation functions
I've been thinking a lot about how navigation and presentation are managed in SwiftUI, and I wanted to propose an idea for a more streamlined approach using environment values. Right now, handling navigation can feel fragmented — especially when juggling default NavigationStack, modals, and tab selections. What if SwiftUI provided a set of convenience environment values for these common actions? Tabs @Environment(\.selectedTab) var selectedTab @Environment(\.selectTab) var selectTab selectedTab: Read the current tab index selectTab(index: Int): Programmatically switch tabs Stack Navigation @Environment(\.stackCount) var stackCount @Environment(\.push) var push @Environment(\.pop) var pop @Environment(\.popToRoot) var popToRoot stackCount: Read how many views are in the navigation stack push(destination: View): Push a new view onto the stack pop(last: Int = 1): Pop the last views popToRoot(): Return to the root view Modals @Environment(\.sheet) var sheet @Environment(\.fullScreenCover) var fullScreenCover @Environment(\.popover) var popover @Environment(\.dismissModal) var dismissModal sheet(view: View): Present a sheet fullScreenCover(view: View): Present a full-screen cover popover(view: View): Show a popover dismissModal(): Dismiss any presented modal Alerts & Dialogs @Environment(\.alert) var alert @Environment(\.confirmationDialog) var confirmationDialog @Environment(\.openAppSettings) var openAppSettings alert(title: String, message: String): Show an alert confirmationDialog(title: String, actions: [Button]): Show a confirmation dialog openAppSettings(): Directly open the app’s settings Why? Clean syntax: This keeps navigation code clean and centralized. Consistency: Environment values already manage other app-level concerns (color scheme, locale, etc.). Why not navigation too? Reusability: This approach is easy to adapt across different view hierarchies. Example @main struct App: App { var body: some Scene { WindowGroup { TabView { NavigationStack { ProductList() } .tabItem { ... } NavigationStack { OrderList() } .tabItem { ... } } } } } struct ProductList: View { @Environment(\.push) var push @State var products: [Product] = [] var body: some View { List(protucts) { product in Button { push(destination: ProductDetails(product: product)) } } label: { ... } } .task { ... } } } struct ProductDetails: View { ... }
3
0
20
11h
Animate layout change
I want to show a view, where the user can add or remove items shown as icons, which are sorted in two groups: squares and circles. When there are only squares, they should be shown in one row: [] [] [] When there are so many squares that they don’t fit horizontally, a (horizontal) scrollview will be used, with scroll-indicator always shown to indicate that not all squares are visible. When there are only circles, they also should be shown in one row: () () () When there are so many circles that they don’t fit horizontally, a (horizontal) scrollview will be used, with scroll-indicator always shown to indicate that not all circles are visible. When there a few squares and a few circles, they should be shown adjacent in one row: [] [] () () When there are so many squares and circles that they don’t fit horizontally, they should be shown in two rows, squares on top, circles below: [] [] [] () () () When there are either too many squares or too many circles (or both) to fit horizontally, one common (horizontal) scrollview will be used, with scroll-indicator always shown to indicate that not all items are visible. I started with ViewThatFits: (see first code block) { let squares = HStack { ForEach(model.squares, id: \.self) { square in Image(square) } } let circles = HStack { ForEach(model.circles, id: \.self) { circle in Image(circle) } } let oneLine = HStack { squares circles } let twoLines = VStack { squares circles } let scrollView = ScrollView(.horizontal) { twoLines }.scrollIndicators(.visible) ViewThatFits(in: .horizontal) { oneLine twoLines scrollView.clipped() } } While this works in general, it doesn’t animate properly. When the user adds or removes an image the model gets updated, (see second code block) withAnimation(Animation.easeIn(duration: 0.25)) { model.squares += image } and the view animates with the existing images either making space for a new appearing square/circle, or moving together to close the gap where an image disappeared. This works fine as long as ViewThatFits returns the same view. However, when adding 1 image leads to ViewThatFits switching from oneLine to twoLines, this switch is not animated. The circles jump to the new position under the squares, instead of sliding there. I searched online for a solution, but this seems to be a known problem of ViewThatFits. It doesn't animate when it switches... (tbc)
1
0
19
12h
iOS 18.1 SwiftUI popover crash
When trying to debug a mysterious app crash pointing to some layoutIfNeeded() method call, me and my QA team member reduced it to this sample app. struct ContentView: View { @State var isPresented = false var body: some View { VStack { Button { isPresented = true } label: { Text("show popover") } .popover(isPresented: $isPresented) { Text("hello world") } } .padding() } }` This code crashes on his iPad iOS 18.1.0 22B5034E with EXC_BAD_ACCESS error. It is not reproducible on simulator or on device with iOS 18.2 or iOS 17. Is this a known issue? Are there any known workarounds? I've found similar posts here https://developer.apple.com/forums/thread/769757 https://developer.apple.com/forums/thread/768544 But they are about more specific cases.
1
0
39
18h
SwiftUI not displaying correctly (extend to all screen) on app across visionOS & iOS
As seen in the screenshot below, I set up a visionOS project at the beginning in Xcode 16 and later add iOS as a different platform it's also running. And I use swiftUI as the framework for UI layout here. It runs smoothly on visionOS. However, when it comes to iOS, even if I have included modifiers as .edgesIgnoringSafeArea(.all), the display still shrinks to only weird certain area on the screen (I also tried to modify the ContentView() window size in App file and it doesn't work). Anybody has any idea for the across platform UI settings? What should I do to make the UI on iOS display normally (and it looks even more weird when it comes to Tab bars)?
0
0
11
20h
Abnormal UI and Keyboard Behavior in iPhone App Running on iPadOS 18.x Built with Xcode 16
Case-ID: 12591306 Use Xcode 16.x to compile an iPhone demo app and run it on an iPad (iPadOS 18.x) device or simulator. Launch the iPhone app and activate Picture-in-Picture mode. Attempt to input text; the system keyboard does not appear. Compare the output of [[UIScreen mainScreen] bounds] before and after enabling Picture-in-Picture mode, notice the values change unexpectedly after enabling PiP. This issue can be consistently reproduced on iPadOS 18.x when running an app built with Xcode 16.0 to Xcode 16.3RC(16E137). Beginning April 24, 2025, apps uploaded to App Store Connect must be built with Xcode 16 or later using an SDK for iOS 18, iPadOS 18, tvOS 18, visionOS 2, or watchOS 11.Therefore, I urgently hope to receive a solution provided by Apple.
1
0
30
21h
UIAlertController sometimes does not call its UIAlertAction handler
The iOS app that I’m helping to develop displays the following behavior, observed on an iPad Pro (4th generation) running iOS 18.1.1: The app uses UIAlertController to show an action sheet with two buttons (defined by two UIAlertAction objects). Each button has a handler block, and the first thing each handler does is to log that it was called. When the user taps one of the buttons and the action sheet disappears, most of the time the appropriate UIAlertAction handler is called. But sometimes there is no log entry for either of the action handlers, nor does the app do anything else associated with the chosen button, in which case I conclude that the handler was not called. I want to emphasize that I’m describing instances of the same action sheet displayed by the same code. Most of the time the appropriate button handler is called, but sometimes the handler is not called. The uncalled handler problem occurs about once per hour during normal use of the app. The problem has continued to occur across many weeks of testing. What could cause UIAlertController not to call its action handler?
Topic: UI Frameworks SubTopic: UIKit Tags:
2
0
25
1d
Buttons in menu don't respect the environment value of .layoutDirection in SwiftUI
Problem Setting ".environment(.layoutDirection, .rightToLeft)" to a view programmatically won't make buttons in menu to show right to left. However, setting ".environment(.locale, .init(identifier: "he-IL"))" to a view programmatically makes buttons in menu to show Hebrew strings correctly. Development environment: Xcode 16.x, macOS 15.3.1 Target iOS: iOS 17 - iOS 18 The expected result is that the button in the menu should be displayed as an icon then a text from left to right. Code to demonstrate the problem: struct ContentView: View { var body: some View { VStack(alignment: .leading) { Text("Buttons in menu don't respect the environment value of .layoutDirection") .font(.subheadline) .padding(.bottom, 48) /// This button respects both "he-IL" of ".locale" and ".rightToLeft" of ".layoutDirection". Button { print("Button tapped") } label: { HStack { Text("Send") Image(systemName: "paperplane") } } Menu { /// This button respects "he-IL" of ".locale" but doesn't respect ".rightToLeft" of ".layoutDirection". Button { print("Button tapped") } label: { HStack { Text("Send") Image(systemName: "paperplane") } } } label: { Text("Menu") } } .padding() .environment(\.locale, .init(identifier: "he-IL")) .environment(\.layoutDirection, .rightToLeft) } }
2
0
23
1d
SwiftUI update master list from detail view
Simple master screen with list, NavigationLink to editable detail view. I want edits on the detail screen to update to the master list "cars" variable and the list UI. On the detail view, if I edit one field and exit the field, the value reverts to the original value. Why? If I edit one field, don't change focus and hit the back button. The master list updates. This is what I want, but I can only update 1 field because of problem #1. Should be able to edit all the fields. If I implement the == func in the Car struct, then no updates get saved. Why? struct Car: Hashable, Equatable { var id: UUID = UUID() var make: String var model: String var year: Int // static func == (lhs: Car, rhs: Car) -> Bool { // return lhs.id == rhs.id // } } struct ContentView: View { @State private var cars: [Car] init() { cars = [ Car(make: "Toyota", model: "Camry", year: 2020), Car(make: "Honda", model: "Civic", year: 2021), Car(make: "Ford", model: "Mustang", year: 2022), Car(make: "Chevrolet", model: "Malibu", year: 2023), Car(make: "Nissan", model: "Altima", year: 2024), Car(make: "Kia", model: "Soul", year: 2025), Car(make: "Volkswagen", model: "Jetta", year: 2026) ] } var body: some View { NavigationStack { VStack { ForEach($cars, id: \.self) { $car in NavigationLink(destination: CarDetailView(car: $car)){ Text(car.make) } } } } } } struct CarDetailView: View { @Binding var car: Car var body: some View { Form { TextField("Make", text: $car.make) TextField("Model", text: $car.model) TextField("Year", value: $car.year, format: .number) } } }
1
0
29
1d
Error trying to emulate CarPlay
Hello everyone, I'm developing a radio app and I want to add CarPlay. Before starting the program I requested all the necessary permissions and they were accepted. Now when I run the app, emulate CarPlay and try to access the app, it crashes and gives me this log: *** Terminating app due to uncaught exception 'NSGenericException', reason: 'Application does not implement CarPlay template application lifecycle methods in its scene delegate.' *** First throw call stack: ( 0 CoreFoundation 0x00000001804b70ec __exceptionPreprocess + 172 1 libobjc.A.dylib 0x000000018008ede8 objc_exception_throw + 72 2 CoreFoundation 0x00000001804b6ffc -[NSException initWithCoder:] + 0 3 CarPlay 0x00000001bc830ee8 -[CPTemplateApplicationScene _deliverInterfaceControllerToDelegate] + 704 4 CarPlay 0x00000001bc82fa60 __64-[CPTemplateApplicationScene initWithSession:connectionOptions:]_block_invoke.4 + 116 5 CoreFoundation 0x00000001803e9aec CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER + 120 6 CoreFoundation 0x00000001803e9a24 ___CFXRegistrationPost_block_invoke + 84 7 CoreFoundation 0x00000001803e8f14 _CFXRegistrationPost + 404 8 CoreFoundation 0x00000001803e88f0 _CFXNotificationPost + 688 9 Foundation 0x0000000180ee2350 -[NSNotificationCenter postNotificationName:object:userInfo:] + 88 10 UIKitCore 0x0000000184f0a8e4 +[UIScene _sceneForFBSScene:create:withSession:connectionOptions:] + 1152 11 UIKitCore 0x0000000185aa445c -[UIApplication _connectUISceneFromFBSScene:transitionContext:] + 808 12 UIKitCore 0x0000000185aa470c -[UIApplication workspace:didCreateScene:withTransitionContext:completion:] + 304 13 UIKitCore 0x0000000185573c08 -[UIApplicationSceneClientAgent scene:didInitializeWithEvent:completion:] + 260 14 FrontBoardServices 0x0000000187994ce4 __95-[FBSScene _callOutQueue_didCreateWithTransitionContext:alternativeCreationCallout:completion:]_block_invoke + 260 15 FrontBoardServices 0x00000001879950a4 -[FBSScene _callOutQueue_coalesceClientSettingsUpdates:] + 60 16 FrontBoardServices 0x0000000187994b64 -[FBSScene _callOutQueue_didCreateWithTransitionContext:alternativeCreationCallout:completion:] + 408 17 FrontBoardServices 0x00000001879c1d50 __93-[FBSWorkspaceScenesClient _callOutQueue_sendDidCreateForScene:transitionContext:completion:]_block_invoke.156 + 216 18 FrontBoardServices 0x00000001879a1618 -[FBSWorkspace _calloutQueue_executeCalloutFromSource:withBlock:] + 160 19 FrontBoardServices 0x00000001879c0220 -[FBSWorkspaceScenesClient _callOutQueue_sendDidCreateForScene:transitionContext:completion:] + 388 20 libdispatch.dylib 0x0000000103e127b8 _dispatch_client_callout + 16 21 libdispatch.dylib 0x0000000103e163bc _dispatch_block_invoke_direct + 388 22 FrontBoardServices 0x00000001879e4b58 FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK + 44 23 FrontBoardServices 0x00000001879e4a34 -[FBSMainRunLoopSerialQueue _targetQueue_performNextIfPossible] + 196 24 FrontBoardServices 0x00000001879e4b8c -[FBSMainRunLoopSerialQueue _performNextFromRunLoopSource] + 24 25 CoreFoundation 0x000000018041b324 CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION + 24 26 CoreFoundation 0x000000018041b26c __CFRunLoopDoSource0 + 172 27 CoreFoundation 0x000000018041a9d0 __CFRunLoopDoSources0 + 232 28 CoreFoundation 0x00000001804150b0 __CFRunLoopRun + 788 29 CoreFoundation 0x0000000180414960 CFRunLoopRunSpecific + 536 30 GraphicsServices 0x0000000190183b10 GSEventRunModal + 160 31 UIKitCore 0x0000000185aa2b40 -[UIApplication _run] + 796 32 UIKitCore 0x0000000185aa6d38 UIApplicationMain + 124 33 SwiftUI 0x00000001d1e2eab4 $s7SwiftUI17KitRendererCommon33_ACC2C5639A7D76F611E170E831FCA491LLys5NeverOyXlXpFAESpySpys4Int8VGSgGXEfU_ + 164 34 SwiftUI 0x00000001d1e2e7dc $s7SwiftUI6runAppys5NeverOxAA0D0RzlF + 84 35 SwiftUI 0x00000001d1b70c8c $s7SwiftUI3AppPAAE4mainyyFZ + 148 36 streamz.debug.dylib 0x0000000106148e98 $s7streamz7StreamzV5$mainyyFZ + 40 37 streamz.debug.dylib 0x0000000106148f48 __debug_main_executable_dylib_entry_point + 12 38 dyld 0x00000001032d9410 start_sim + 20 39 ??? 0x000000010301a274 0x0 + 4345406068 I also get this error in the 'App' protocol: Thread 1: "Application does not implement CarPlay template application lifecycle methods in its scene delegate." If you need anything specific to figure out what it's about, I'll be happy to help.
2
0
32
1d
The issue of unable to use document type for Mac catalyst project
Hello, I have encountered a question that I hope to receive an answer to. Currently, I am working on a music project for Mac Catalyst and need to enable music files such as FLAC to be opened by right clicking to view my Mac Catalyst app. But currently, I have encountered a problem where I can see my app option in the right-click open mode after debugging the newly created macOS project using the following configuration. But when I created an iOS project and converted it to a Mac Catalyst app, and then modified the info.plist with the same configuration, I couldn't see my app in the open mode after debugging. May I ask how to solve this problem? Do I need to configure any permissions or features in the Mac Catalyst project? I have been searching for a long time but have not found a solution regarding it. Please resolve it, thank you. Here is the configuration of my macOS project: CFBundleDocumentTypes CFBundleTypeExtensions flac CFBundleTypeIconSystemGenerated 1 CFBundleTypeName FLAC Audio File CFBundleTypeRole Viewer LSHandlerRank Default Note: Sandbox permissions have been enabled for both the macOS project and the iOS to Mac Catalyst project. The Mac Catalyst project also has additional permissions for com. apple. security. files. user taught. read write
0
0
12
1d
How to make app for iPhone and iPad separatly
I released an app for iPhone (and it's could be downloaded for iPad also), and now I developered another app for iPad version with the same code and logic but I modified the layout to fit bigger screen and make better user experience and appearance. Howevert the app review rejected my release due to the duplicate content, how can I solve it?
Topic: UI Frameworks SubTopic: General
0
0
13
1d
UIKit or SwiftUI First? Exploring the Best Hybrid Approach
UIKit and SwiftUI each have their own strengths and weaknesses: UIKit: More performant (e.g., UICollectionView). SwiftUI: Easier to create shiny UI and animations. My usual approach is to base my project on UIKit and use UIHostingController whenever I need to showcase visually rich UI or animations (such as in an onboarding presentation). So far, this approach has worked well for me—it keeps the project clean while solving performance concerns effectively. However, I was wondering: Has anyone tried the opposite approach? Creating a project primarily in SwiftUI, then embedding UIKit when performance is critical. If so, what has your experience been like? Would you recommend this approach? I'm considering this for my next project but am unsure how well it would work in practice.
1
0
31
2d
Scroll up and bounce back loop issue when wrapping LazyVstack within a NavigationStack
The issue I'm facing arise when using a lazyvstack within a navigationstack. I want to use the pinnedViews: .sectionHeaders feature from the lazyStack to display a section header while rendering the content with a scrollview. Below is the code i'm using and at the end I share a sample of the loop issue: struct SProjectsScreen: View { @Bindable var store: StoreOf<ProjectsFeature> @State private var searchText: String = "" @Binding var isBotTabBarHidden: Bool @Environment(\.safeArea) private var safeArea: EdgeInsets @Environment(\.screenSize) private var screenSize: CGSize @Environment(\.dismiss) var dismiss private var isLoading : Bool { store.projects.isEmpty } var body: some View { NavigationStack(path:$store.navigationPath.sending(\.setNavigationPath)) { ScrollView(.vertical){ LazyVStack(spacing:16,pinnedViews: .sectionHeaders) { Section { VStack(spacing:16) { if isLoading { ForEach(0..<5,id:\.self) { _ in ProjectItemSkeleton() } } else{ ForEach(store.projects,id:\._id) { projectItem in NavigationLink(value: projectItem) { SProjectItem(project: projectItem) .foregroundStyle(Color.theme.foreground) } .simultaneousGesture(TapGesture().onEnded({ _ in store.send(.setCurrentProjectSelected(projectItem.name)) })) } } } } header: { VStack(spacing:16) { HStack { Text("Your") Text("Projects") .fontWeight(.bold) Text("Are Here!") } .font(.title) .frame(maxWidth: .infinity,alignment: .leading) .padding(.horizontal,12) .padding(.vertical,0) HStack { SSearchField(searchValue: $searchText) Button { } label: { Image(systemName: "slider.horizontal.3") .foregroundStyle(.white) .fontWeight(.medium) .font(.system(size: 24)) .frame(width:50.66,height: 50.66) .background { Circle().fill(Color.theme.primary) } } } } .padding(.top,8) .padding(.bottom,16) .background(content: { Color.white }) } } } .scrollIndicators(.hidden) .navigationDestination(for: Project.self) { project in SFoldersScreen(project:project,isBotTabBarHidden: $isBotTabBarHidden) .toolbar(.hidden) } .padding(.horizontal,SScreenSize.hPadding) .onAppear { Task { if isLoading{ do { let projectsData = try await ProjectService.Shared.getProjects() store.send(.setProjects(projectsData)) } catch{ print("error found: ",error.localizedDescription) } } } } .refreshable { do { let projectsData = try await ProjectService.Shared.getProjects() store.send(.setProjects(projectsData)) } catch{ print("error found: ",error.localizedDescription) } } }.onChange(of: store.navigationPath, { a, b in print("Navigation path changed:", b) }) } } I'm using tca library for managing states so this is my project feature reducer: import ComposableArchitecture @Reducer struct ProjectsFeature{ @ObservableState struct State: Equatable{ var navigationPath : [Project] = [] var projects : [Project] = [ ] var currentProjectSelected : String? } enum Action{ case setNavigationPath([Project]) case setProjects([Project]) case setCurrentProjectSelected(String?) case popNavigation } var body: some ReducerOf<Self> { Reduce { state, action in switch action { case .setNavigationPath(let navigationPath): state.navigationPath = navigationPath return .none case .setProjects(let projects): state.projects = projects return .none case .setCurrentProjectSelected(let projectName): state.currentProjectSelected = projectName return .none case .popNavigation: if !state.navigationPath.isEmpty { state.navigationPath.removeLast() } state.currentProjectSelected = nil return .none } } }
1
0
23
2d
Dynamic island not displaying UI views
i finally got previews for dynamic island to work and I'm just trying to first work on adding a static UI elements to my dynamic island like i did for my live screen live activity, but my dynamic island view is showing up totally empty, if i add my app icon image to the compact leading closure, it doesn't appear, if i ad text to an expanded region closure it doesn't appear. am really stuck on this and would approeciate the help. var body: some View { Image("dynamicrep") .resizable() .scaledToFit() .clipShape(.circle) } } struct DynamicRepLiveActivity: Widget { var body: some WidgetConfiguration { ActivityConfiguration(for: DynamicRepAttributes.self) { context in VStack { HStack(spacing: 257) { Text("from \(context.attributes.titleName ?? "no title")") .fontWeight(.light) .font(.system(size: 16)) .foregroundStyle(Color.gray) Circle() .frame(width: 53, height: 50) .foregroundStyle(Color.gray).opacity(0.23) .overlay { Image("mmicon") } } .frame(maxWidth: 500, maxHeight: 210) Spacer() Text("\(context.attributes.contentBody ?? "no content")") } .activityBackgroundTint(Color.cyan) .activitySystemActionForegroundColor(Color.black) .frame(width: 500, height: 300) } dynamicIsland: { context in DynamicIsland { // Expanded UI goes here. Compose the expanded UI through // various regions, like leading/trailing/center/bottom DynamicIslandExpandedRegion(.leading) { Text("from \(context.attributes.titleName ?? "no title")") } DynamicIslandExpandedRegion(.trailing) { Circle() } DynamicIslandExpandedRegion(.bottom) { Text("\(context.attributes.contentBody ?? "no content")") } } compactLeading: { AppLogo() } compactTrailing: { Text("") //empty for now } minimal: { Text("hello") //empty for now } .widgetURL(URL(string: "MuscleMemory.KimchiLabs.com")) .keylineTint(Color.white) } } }
0
0
25
3d
Loading secondary Icon
I want to add the option to choose an alternative icon inside the app. Is there a way to load an icon asset from within the app? I downloaded Apple’s alternative icon sample, which is supposed to show a list of icons to choose from, but even in the sample, it did not work. So the current solution is to add every alternative icon along with another image asset of the same image to display to the user. This sounds like a waste of bytes. Thank you in advance for any help.
Topic: UI Frameworks SubTopic: General
0
0
20
3d