Post

Replies

Boosts

Views

Activity

Views Autopsy in SwiftUI
Hi, How to see a views Autopsy in SwiftUI specially when views stacks together and over each other, like to see what area they occupy how they overlap understand why white space is here and there ? Maybe there's a tool or plug in ? I remember layers in UIKit, had such tool and feature in Xcode. Kindest Regards
0
0
400
Feb ’24
Adding multi view to NavigationPath in one go
Hi How can we add multi view to NavigationPath in one go like in code below maybe using something like path.append(mobiles.all) ? where all 3 views of mobiles Array get added at once ? Kindest Regards `struct NavigationPathView: View { var mobiles: [Mobiles] = [.init (name: "iPhone", imageName: "folder", color: .mint), .init (name: "Samsung", imageName: "pin", color: .pink), .init (name: "Mac Pro", imageName: "book", color: .gray)] @State var path = NavigationPath() var body: some View { NavigationStack (path: $path) { List { Section ("Platforms") { Button("Go To Platform") { path.append(mobiles.first!) } Button("Go To Mobile") { path.append(mobiles.last!) } Button("Add All Mobiles") { } } } } .navigationDestination(for: Mobiles.self) {mobile in ZStack { mobile.color.ignoresSafeArea() VStack { Image(systemName: mobile.imageName) Label (mobile.name, systemImage: mobile.imageName) .font(.largeTitle).bold().foregroundColor(.white) Button("Go Home") { path.removeLast(path.count) } } } } } }
2
0
551
Jun ’24
Text Don't Show in swipeActions buttons !
Hi, I have the below code and don't know why the text doesn't show fro swipe buttons just the icons show ? Kind Regards import SwiftUI struct NewView: View { var body: some View { NavigationStack { List { ForEach(1...7, id: \.self) { number in VStack { Text("Item \(number)") .padding() } .swipeActions(edge: .trailing) { Button(role: .destructive) { withAnimation { deletePatient2() } } label: { Label("Delete", systemImage: "trash.fill") } Button { deletePatient2() // toDoToEdit = item } label: { Label("Edit", systemImage: "pencil") } .tint(.orange) } } } } .listStyle(.plain) } func deletePatient2() { } } #Preview { NewView() }
3
0
890
Jul ’24
Center Aligning SF Symbols in Sidebar Menu
Hi, When watching SF Symbols WWDC videos about SF Symbols the recommendations is always to center align them, but suppose we are making sidebar menu items where we have VStack of HStacks , and each Stack have an SF Symbol and a text in this case how can SF Symbols be center aligned ? they will mostly right aligned so will this damage the design ? specially if they have like badges ? -- Kind Regards
Topic: Design SubTopic: General Tags:
0
0
619
Jul ’24
One to Many Relationship in SwiftData
Hi, I understand how to make one to many relationship in SwiftData and how to show the child records, like all cities of a country. But how to navigate and show the parent record from a child record, Like I want to show a country of a city ? like country.cities show all cities of a country, will cities.country work to show the country ? like cities.country.name ? Kind Regards
3
0
447
Sep ’24
Views Autopsy in SwiftUI
Hi, How to see a views Autopsy in SwiftUI specially when views stacks together and over each other, like to see what area they occupy how they overlap understand why white space is here and there ? Maybe there's a tool or plug in ? I remember layers in UIKit, had such tool and feature in Xcode. Kindest Regards
Replies
0
Boosts
0
Views
400
Activity
Feb ’24
Auto hiding details panel
Hi, By default when selecting an item from a list in details panel it doesn't close how to make it close or hide by default ? Kindest Regards
Replies
0
Boosts
0
Views
326
Activity
May ’24
Details panel catching show/hide
Hi, How to catch the event when details panel of a SplitView shows and get hidden, like when split is 2 columns and when its details only ? Kindest Regards
Replies
2
Boosts
0
Views
465
Activity
May ’24
Adding multi view to NavigationPath in one go
Hi How can we add multi view to NavigationPath in one go like in code below maybe using something like path.append(mobiles.all) ? where all 3 views of mobiles Array get added at once ? Kindest Regards `struct NavigationPathView: View { var mobiles: [Mobiles] = [.init (name: "iPhone", imageName: "folder", color: .mint), .init (name: "Samsung", imageName: "pin", color: .pink), .init (name: "Mac Pro", imageName: "book", color: .gray)] @State var path = NavigationPath() var body: some View { NavigationStack (path: $path) { List { Section ("Platforms") { Button("Go To Platform") { path.append(mobiles.first!) } Button("Go To Mobile") { path.append(mobiles.last!) } Button("Add All Mobiles") { } } } } .navigationDestination(for: Mobiles.self) {mobile in ZStack { mobile.color.ignoresSafeArea() VStack { Image(systemName: mobile.imageName) Label (mobile.name, systemImage: mobile.imageName) .font(.largeTitle).bold().foregroundColor(.white) Button("Go Home") { path.removeLast(path.count) } } } } } }
Replies
2
Boosts
0
Views
551
Activity
Jun ’24
Hiding chevron from list, SwiftUI
Hi, How to hide the Chevron icon from a list rows in SwiftUI ? Kindest Regards
Topic: UI Frameworks SubTopic: SwiftUI
Replies
4
Boosts
0
Views
2.4k
Activity
Jun ’24
Prevent debugging window from opening
Hi, Every time I run my App in Xcode the below debugging window opens and I need to close it every time as I don't need it, how to disable this behavior in Xcode ? I want to open it manually when needed. Kindest Regards
Replies
0
Boosts
1
Views
308
Activity
Jun ’24
SwiftData Model Container for Many Classes
Hi, Most of SwiftData tutorials use one SwiftData Class model though defining it is modelContainer is straightforward, what if I have say 10 model classes how to define them in the modelContainer ? Kind Regards
Replies
0
Boosts
0
Views
416
Activity
Jun ’24
Text Don't Show in swipeActions buttons !
Hi, I have the below code and don't know why the text doesn't show fro swipe buttons just the icons show ? Kind Regards import SwiftUI struct NewView: View { var body: some View { NavigationStack { List { ForEach(1...7, id: \.self) { number in VStack { Text("Item \(number)") .padding() } .swipeActions(edge: .trailing) { Button(role: .destructive) { withAnimation { deletePatient2() } } label: { Label("Delete", systemImage: "trash.fill") } Button { deletePatient2() // toDoToEdit = item } label: { Label("Edit", systemImage: "pencil") } .tint(.orange) } } } } .listStyle(.plain) } func deletePatient2() { } } #Preview { NewView() }
Replies
3
Boosts
0
Views
890
Activity
Jul ’24
Making Dropdown Picker or Menu Open Down
Hi, Menus and pickers in iOS and iPadOS opens toward, can it be configured to open downward ? For example if I have country list opening upwards won't be good, Kind Regards
Topic: UI Frameworks SubTopic: SwiftUI
Replies
1
Boosts
0
Views
423
Activity
Jul ’24
Center Aligning SF Symbols in Sidebar Menu
Hi, When watching SF Symbols WWDC videos about SF Symbols the recommendations is always to center align them, but suppose we are making sidebar menu items where we have VStack of HStacks , and each Stack have an SF Symbol and a text in this case how can SF Symbols be center aligned ? they will mostly right aligned so will this damage the design ? specially if they have like badges ? -- Kind Regards
Topic: Design SubTopic: General Tags:
Replies
0
Boosts
0
Views
619
Activity
Jul ’24
Sorting SwiftData module records based on recent update
Hi, I know how to sort SwiftData records based on one of its properties such as name, but how to sort based on recent updated records ? like in Apple Notes App ? Kind Regards
Replies
3
Boosts
0
Views
569
Activity
Aug ’24
Baseline Align SF Symbols and Text
Hi, When putting an image that uses systemName next to a text will they be baseline aligned by default ? -- Kindest Regards
Topic: Design SubTopic: General Tags:
Replies
1
Boosts
0
Views
646
Activity
Aug ’24
Failed to find a currently active container for "Module Name"
Hi, I had a SwiftData model and it was working fine, I had few records in it, but when I added to its Module file few extra properties I started to get the below error ! how to fix this ? "Thread 1: Fatal error: failed to find a currently active container for Patient"
Replies
1
Boosts
0
Views
1.3k
Activity
Aug ’24
Inserting array of model objects using modelContext
Hi, I saw many examples on how to insert one model object at a time in SwiftData using modelContext.insert() , but can that command insert an array of objects in one batch as well ? -- Kind Regards
Replies
1
Boosts
0
Views
608
Activity
Sep ’24
One to Many Relationship in SwiftData
Hi, I understand how to make one to many relationship in SwiftData and how to show the child records, like all cities of a country. But how to navigate and show the parent record from a child record, Like I want to show a country of a city ? like country.cities show all cities of a country, will cities.country work to show the country ? like cities.country.name ? Kind Regards
Replies
3
Boosts
0
Views
447
Activity
Sep ’24