Post

Replies

Boosts

Views

Created

NavigationSplitView Collapse Button
Hi, When creating a 3 columns Split View in SwiftUI the second view that resemble the mails list in Apple Mails App have a blue icon at top left corner where when tapped shows the column of Mail boxes such as Inbox, Sent etc. This icon by default when creating the Split View disappears after tapping, it shows the third column and disappear , I would like it to stay so I can show and collapse the first column sam as Apple Mail App. how to do that ? its called back also how to rename it and add icon to it ?
3
0
1.1k
Nov ’23
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
Dec ’23
Getting the Locale of the System in iOS
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" )) } }
0
0
386
Jan ’24
Initializing NavigationStack
Hi, NavigationStack is a struct so to initialize it we need to use var or let so how come we use it without this keywords ? Kindest Regards
Replies
1
Boosts
0
Views
399
Activity
Nov ’23
What's the # symbol in swift documentation
Hi. I see a # symbol allot in swift documentation, as in definition below what it means ? Kindest Regards import <#module#>
Replies
3
Boosts
0
Views
618
Activity
Nov ’23
NavigationSplitView Collapse Button
Hi, When creating a 3 columns Split View in SwiftUI the second view that resemble the mails list in Apple Mails App have a blue icon at top left corner where when tapped shows the column of Mail boxes such as Inbox, Sent etc. This icon by default when creating the Split View disappears after tapping, it shows the third column and disappear , I would like it to stay so I can show and collapse the first column sam as Apple Mail App. how to do that ? its called back also how to rename it and add icon to it ?
Replies
3
Boosts
0
Views
1.1k
Activity
Nov ’23
Access Control SwiftUI Structs
Hi, when declaring variables or constants inside a Struct in SwiftUI projects is it by default private or internal ? seems little confusing cause I see some using the private word explicitly sometimes. Kindest Regards
Replies
2
Boosts
0
Views
1.5k
Activity
Dec ’23
Customizing Back Button in Column 2 "Content" in SplitView
Hi, How can I customize the Back Button in Column 2 "Content" in SplitView, like changing its color, label, icon ? Also is it possible to keep it visible even when Column 1 is shown and make it work like toggling showing and hiding Column 1 ? Kindest Regards
Replies
2
Boosts
0
Views
524
Activity
Dec ’23
Using Data or View in NavigationStack
Hi, Is it recommended to use data and SwiftUI controls inside the NavigationStack or to use views as before ? I think views is easier to maintain or Im missing something ? cause I hear that the new way is to use data directly ? Kindest Regards
Replies
0
Boosts
0
Views
284
Activity
Dec ’23
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
Dec ’23
Are Fitness features exists in HealthKit ?
Hi, The fitness features such as distance moved, steps, calories burned is it in HealthKit or in a different kit ? couldn't find any API in HealthKit ? Also for example how can Apple Watch distinguish that this amount of steps was walked and not moved by a slow car or a scoter for example ? Kindest Regards
Replies
0
Boosts
0
Views
598
Activity
Dec ’23
Apple Car Kit & carOS
Hi, The Car Kit Apple introduced recently is it a separate OS or what ? I mean how can I develop and deploy a whole new designed Car Info System and dashboards same as the designs Apple published last year ? Kindest Regards
Replies
0
Boosts
0
Views
775
Activity
Dec ’23
Xcode Local Source Control Merging Branches
Hi, When I use local Xcode source control and not connect to a cloud git I don't have the ability to merge branches ? if possible can you show hw please ? Also other features such as push, pull, cherry Pick isn't supported ? Kindest Regards
Replies
0
Boosts
0
Views
422
Activity
Dec ’23
Catching the keyboard language changing in iOS and getting the language
Hi, How to catch the keyboard language changing in iOS when use select a different language from keyboard, and how to know what language he selected and if its right to left ? in SwiftUI App. Kindest Regards
Replies
0
Boosts
0
Views
426
Activity
Jan ’24
Getting the Locale of the System in iOS
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" )) } }
Replies
0
Boosts
0
Views
386
Activity
Jan ’24
Reducing default space between tool bar items
Hi, How to reducing default space between tool bar items, it seems little to much. Kindest Regards
Replies
1
Boosts
0
Views
463
Activity
Jan ’24
Removing source control repository from specific Xcode project
Hi, I added local source control for a project and I want to remove it how to do that ? disabling source control from Xcode settings will hide source control from other projects which I don't want, just removing this specific project from source control and deleting the repository . Kindest Regards
Replies
1
Boosts
0
Views
1.1k
Activity
Jan ’24
Deleting a post
Hi, How to delete a post from Apple Developer Forum ? Kindest Regards
Replies
1
Boosts
0
Views
928
Activity
Jan ’24