Search results for

column

2,062 results found

Post

Replies

Boosts

Views

Activity

Reply to NavigationSplitView two and three column interfaces in the same app
From the way Apple made the NavigationSplitView API, it is clear that having two and three column layouts shouldn't happen or should be avoided. Nevertheless, you can still achieve this through the use of two split views wrapped in a condition. Something like this, which I have tested, will work: struct ContentView: View { @State private var selectedInt: Int? = 1 @State private var columnVisibility: NavigationSplitViewVisibility = .all var sidebarList: some View { List(1...10, id: .self, selection: $selectedInt) { int in NavigationLink(Row (int), value: int) } .navigationTitle(Sidebar) } var contentView: some View { Text(Content (selectedInt ?? 0)) } var detailView: some View { Text(Detail (selectedInt ?? 0)) } var body: some View { Group { // Only rows that are a multiple of 2 will have a two-column layout if selectedInt?.isMultiple(of: 2) == true { NavigationSplitView(columnVisibility: $columnVisibility) { sidebarList } detail: { detailView } } else { NavigationSplitView(columnVisibility:
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Aug ’22
Handling single selection action in multi-selection SwiftUI Table
I have a SwiftUI Table on iPadOS that supports multiple selection and contains rows representing documents that can be opened. I want to be able to select multiple rows from edit mode or with keyboard modifiers for batch operations, but a regular tap on a single item should open it and push it onto the navigation stack. Rows are highlighted when I tap on them, but the table's selection isn't modified and I can't figure out how to respond to that action. There's nowhere for me to put a NavigationLink because I'm only providing views for each column and not for the row itself. I could also push onto the navigation stack manually if I could respond to the action, but I don't see any API for doing so. I've tried using .onChange(of: selection) and checking that the selection only contains a single element, but single taps on rows don't modify the selection, and even if they did, this logic would trigger incorrectly when adding the first item to the selection in edit mode for example. Is there something I'
2
0
1.8k
Aug ’22
Reply to DATA
You can export a CSV file and have something sort of like this. While that’ll work, if you’re doing anything serious with CSV files I strongly recommend that you check out the TabularData framework. See the code snippet below. Share and Enjoy — Quinn “The Eskimo!” @ Developer Technical Support @ Apple let myEmail = eskimo + 1 + @ + apple.com import Foundation import TabularData let csv = Aloe Vera, skin healer, Cut from middle, once every three days, cut the leave and use the gel inside for your rash Almond, skin healer, cut the young leaves, daily, soak in water overnight rinse and blend func main() throws { var options = CSVReadingOptions() options.hasHeaderRow = false let frame = try DataFrame.init(csvData: Data(csv.utf8), options: options) print(frame) // ┏━━━┳━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━┳… // ┃ ┃ Column 0 ┃ Column 1 ┃ Column 2 ┃… // ┃ ┃ ┃ ┃ ┃… // ┡━━━╇━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━╇… // │ 0 │ Aloe Vera │ skin
Aug ’22
NavigationSplitView in two-column mode does not work properly on iOS in portrait mode
Hey there, I was trying to get an overview of the new navigation in the Xcode-14 Beta. I watched the WWDC22 session The SwiftUI Cookbook for Navigation and downloaded the associated sample code https://developer.apple.com/documentation/swiftui/bringing_robust_navigation_structure_to_your_swiftui_app. When trying it out, I noticed that the two-column mode of the NavigationSplitView in portrait mode does not work properly on iOS. In the download version of NavigationCookbook, a click on one of the related recipes in the recipe detail view does not lead to the detail view of the corresponding recipe (portrait format only on iOS), but to the detail of the NavigationSplitView. The only solution I found was to include a NavigationStack in .navigationDestation. Is there a more sophisticated solution other than using @Environment(.horizontalSizeClass) private var horizontalSizeClass to avoid the problem.
1
0
1.2k
Jul ’22
Reply to Driving NavigationSplitView with something other than List?
Since List is very versatile, I'm not sure why it cannot be used here. For example, the following works fine in iOS and iPadOS (by persisting the selection): import SwiftUI class Q708440NavigationModel: ObservableObject { @Published var selectedThingId: Thing? } struct Thing: Identifiable, Hashable { let id: UUID = UUID() let name: String } class ThingData: ObservableObject { @Published var things: [Thing] = [ Thing(name: One), Thing(name: Two), Thing(name: Three) ] } struct ThingDetail: View { let thing: Thing @EnvironmentObject var navigationModel: Q708440NavigationModel var body: some View { Text(Thing: (thing.name)) } } struct SomeOtherViewHere: View { var body: some View { Text(Some other view) } } @main struct Q708440App: App { @StateObject var navigationModel = Q708440NavigationModel() @StateObject var thingData = ThingData() var body: some Scene { WindowGroup { Q708440(things: $thingData.things) .environmentObject(navigationModel) } } } struct Q708440: View { @Binding var things: [Thing] @EnvironmentO
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Aug ’22
Clarity on below queries with respect to App Store subscription
Is there any way to set common currency for all the Territory except India? Eg: We want to set $6.59 to all the countries & India INR 49/- All prices & currency list has 3 columns. Want to know whether the Year 1 & Year 2 proceeds are exclusion of all taxes & Apple commission? When we choose the primary currency in the US dollar, why again is the US dollar price getting changed in the confirmation page. Please find its relevant screenshots
1
0
757
Jul ’22
Reply to Exception SIGABRT encountered in App Store review
When I followed the procedure to symbolicate an external file by changing the .ips extension to .crash, adding an external device, viewing All Logs and dragging the .crash file from MacOS12.4 Finder to the LH column, a part of the log appear in the RH window but does not include any frame data. The last line is Crashed Thread: 0 Dispatch queue enabled. Right-clicking on the added file and selecting Re-Symbolicate Log results in nothing happening. If I click Done and open View All Logs again, the added file is not present. I presumed this was due to lack of debug symbols but from your comment this is not the case.
Topic: App & System Services SubTopic: General Tags:
Jul ’22
Reply to Missing argument for parameter 'images' in call
Thanks so much, your first works great for me... But, how can I do the next step ? When I tapped on Landschaften that will be shows me Landschaften... That's nice. How can I do it for Maritimes? When I Tapped on Maritimes then I will that shows me Maritimes images... Can I drop more NavigationLinks in ContentView ? Have many Thanks ;) import SwiftUI struct ContentView: View { var columns = [GridItem(.adaptive(minimum: 160), spacing: 5)] var body: some View { NavigationView { ScrollView { LazyVGrid(columns: columns) { ForEach(ImagesList, id: .id) { images in NavigationLink { LandView() } label: { ImageCard(images: images) } } } .padding(10) } .navigationBarTitle(Text(Übersicht)) } .navigationViewStyle(StackNavigationViewStyle()) } } struct ContentView_Previews: PreviewProvider { static var previews: some View { ContentView() } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jul ’22
Missing argument for parameter 'images' in call
Dear All Hope some one can help me... Xcode Shows me 4 Elements to fix it... I will that the user tapped on one Card and goes to that Category. What is my fails ? I know that I have struggle whit the NavigationLink... Hope you can help me out please . Have a nice Weekend.... import SwiftUI struct ContentView: View { func Images(_ images : Images){} var columns = [GridItem(.adaptive(minimum: 170), spacing: 20)] var body: some View { NavigationView { ScrollView { LazyVGrid(columns: columns, spacing: 10) { ForEach(ImagesList, id: .id) {images in ImageCard(images: images) NavigationLink {LandCard()} label: { ImageCard() }) } } .padding(10) } .navigationTitle(Text(Bilder)) } .navigationViewStyle(StackNavigationViewStyle()) } } struct ContentView_Previews: PreviewProvider { static var previews: some View { ContentView() } }
6
0
1.8k
Jul ’22
Reply to Missing argument for parameter 'images' in call
Have a lot of thanks.... Of Course. Here ist Code for ImageCard.... import Swift UI struct ImageCard: View { var images: Images var body: some View { NavigationView{ ZStack(alignment: .bottom) { Image(images.image) .resizable() .cornerRadius(18) .frame(width: 200) .scaledToFit() VStack(alignment: .leading) Text((images.category)) .frame(width: 200, height: 40, alignment: .center ) .background(.ultraThinMaterial) .cornerRadius(18) .bold() } .frame(width: 200, height: 200) .shadow(radius: 3) } } } struct ImageCard_Previews: PreviewProvider { static var previews: some View { ImageCard(images: ImagesList[0]) } } And here is the Code of my model import Foundation struct Images: Identifiable { var id = UUID() var name: String var category: String var image: String } var ImagesList = [Images(name: Steinkirchen, category: Landschaften, image: Uebersicht_1), Images(name: Seacloud-Spirit,category: Maritimes, image: Uebersicht_2), Images(name: Grashalm, category: Natur, image: Uebersicht_3), Images(name: Details, catego
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jul ’22