Hi,
I use the elbow code to toggle between English and Arabic locale, but the alert message always shows en_QA which is English I guess even when locale changed to Arabic ? why is that ?
struct arview: View {
@Environment(\.locale) private var locale
@State private var showingAlert = false
@State private var isLTR: Bool = false
@State private var txtValue = ""
var body: some View {
VStack{
Text("Note Title")
TextField("Place Holder", text: $txtValue)
Button("Change Locale") {
isLTR.toggle()
}
Button("Show Alert") {
showingAlert = true
}
.alert("Current Locale: \(locale.identifier)", isPresented: $showingAlert) {
Button("OK", role: .cancel) { }
}
}
.padding()
.environment (\.locale, isLTR ? Locale.init(identifier: "en" ) : Locale.init(identifier: "ar" ))
}
}
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
Hi,
How to reducing default space between tool bar items, it seems little to much.
Kindest Regards
Hi,
How to remove a background color from segmented control ? in SwiftUI.
Kindest Regards
Hi
I have a view I used it in the details section of SpliView and I want it to occupy the whole view, thing is it top area stopped responding and receiving taps ? is it a bug ?
Kindest Regards
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
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
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
Topic:
App & System Services
SubTopic:
iCloud & Data
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,
When putting an image that uses systemName next to a text will they be baseline aligned by default ?
--
Kindest Regards
Hi,
However I tried to reduce space between list rows in below code I fail, is there any way to reduce this space ?
@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)
.border(Color.black)
.font(.system(size: 12)) // Smaller font size
.frame(maxWidth: .infinity, minHeight: 20, alignment: .leading) // Reduced height
.padding(.vertical, 4) // Minimal padding for vertical spacing
.listRowInsets(EdgeInsets(top: 0, leading: 0, bottom: 0, trailing: 0)) // Remove insets
.listRowSeparator(.hidden) // Hide separator
}
.listStyle(.plain)
}
.overlay(
RoundedRectangle(cornerRadius: 10)
.stroke(sysSecondary.opacity(0.4), lineWidth: 1)
)
.frame(width: 220, height:260)
.background(.white)
.clipShape (RoundedRectangle (cornerRadius: 10))
}
}
Topic:
UI Frameworks
SubTopic:
SwiftUI
Hi,
The new TabBar, SideBar combination is very nice, but I tried customizing like text sizes, icon sizes using imageScale and all dint have any effect, also shows of selected item in side bar couldn't customize it, is there any suggestions ?
Kind Regards
Topic:
UI Frameworks
SubTopic:
SwiftUI
Hi,
When SplitView is in detailsOnly and I swipe from left side the sidebar appears as popover above the details content, but when I try to open it manually by settings the columnVisibility to doubleColumn it pushes the details view and shows, so haw to make it appear as poorer ?
Kind Regards
Topic:
UI Frameworks
SubTopic:
SwiftUI
Hi,
If Im in detailsOnly mode in SplitView how to manually open the SideBar as popover same as behavior as default rectangle menu icon at top of Details View.
Kind Regards
I want to create master details relationship between patient and vitals signs so which of option codes below are better performance wise ? Option one is master - details done manually ..
option 1
@Model
class TestResult {
@Attribute(.primaryKey) var id: UUID
var patientID: UUID
Option 2
@Model
final class Vital {
var patient: Patient?
Hi,
Im developing a data centric App using SwiftData, I noticed that the device I use for testing doesn't sync its data with the simulator although both have same Apple Account ? What's Im missing here ? arched is my project settings.
Kind Regards