Hi,
I have the below code as you can see the list doesn't hide its line separator, so is it a bug ? is there any work around ?
@State var flag: Bool = false
var myList: [String] = ["Hello", "World", "SwiftUI"]
var body: some View {
VStack(alignment: .leading) {
List (myList, id: \.self) { list in
Text(list)
}
.listRowSeparator(.hidden)
.listStyle(.plain)
}
.overlay(
RoundedRectangle(cornerRadius: 10)
.stroke(sysSecondary.opacity(0.4), lineWidth: 1)
)
.frame(width: 220, height:260)
.background(.white)
.clipShape (RoundedRectangle (cornerRadius: 10))
}
}
Post
Replies
Boosts
Views
Activity
Hi,
Is there anyway to auto format a text field to show mobiles numbers properly like a modifier or something ? and is there an API to check if the text is a valid mail address not just dummy text ?
--
Kind Regards
Hi,
The example that Apple shows in link below doesn't show how truncationMode works, because the text get truncated anyway when its length it more than frame height so what's the use of truncationMode ?
https://developer.apple.com/documentation/swiftui/view/truncationmode(_:)
--
Kind Regards
Hi,
Is it possible to change font color of dark text in DatePicker in SwiftUI ? Also can we change size of arrows on top right ?
Kind Regards
Hi,
Some times long text damage the design of views it might go to a second row and increase view height and damage the overall design, so how to solve this issue, is there a way to set a Max Characters number for Text and TextField views in SwiftUI ? and maybe show few dots as used in some designs ?
Kind Regards
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
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
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"
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
Hi,
When putting an image that uses systemName next to a text will they be baseline aligned by default ?
--
Kindest Regards
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
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
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()
}
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
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