Search results for

column

2,052 results found

Post

Replies

Boosts

Views

Activity

SwiftUI NavigationSplitView Bug?
Hi All! I am working on a Multiplatform SwiftUI app and I've encountered an issue with NavigationSplitView. My app's ContentView is a NavigationSplitView sidebar and detail. The sidebar is a list with several NavigationLinks. (I haven't adopted programmatic navigation because of the simplicity this sidebar.) One of the NavigationLinks brings the user to a Table with several rows and columns. Then, when I go to select an item on the table, a row shows selected for a split second, before deselecting itself again. Then, I can use the table as normal. This happens every time the view is opened. The reason I think that this is an issue with NavigationSplitView is because when I use the legacy NavigationView, everything is fine. Is this normal behavior for NavigationSplitView, and if it is, how to I make it so that my table receives focus when the NavigationLink is open?
1
0
1.1k
Jan ’23
What are the column definitions of the database I downloaded?
I downloaded the database from my app store connect profile and now that I have the data all set up in my warehouse I am unable to do any analysis because I am unsure of what data the tables and columns are actually displaying. How do I get a key that describes what the data means that are in tables and columns?
1
0
1.6k
Jan ’23
Reply to The new tensorflow-macos and tensorflow-metal incapacitate training
Ok, a bit of work to get the older and more stable versions up and running. First and foremost, you'll need homebrew Then you'll need to use the version of python supported for the targeted release. The table for how to match up archival versions of tensorflow-macos and tensorflow-metal is near the bottom of this page. You can then use brew to install the legacy python brew install python@3.9 And then use that to create a virtual environment. Code follows for my install, though double check the location of your homebrew. /opt/homebrew/opt/python@3.9/bin/python3.9 -m venv ~/tensorflow source ~/tensorflow/bin/activate With the virtual environment created, you then need to get the urls for the old pip installs. Apple prohibits the linking of external urls on this forum, but you can look up tensorflow-macos and tensoflow-metal at pypi dot org and find their release history on the left side column. Then right click/command click the release. pip install is an acceptable way to install packages. Take care
Topic: Machine Learning & AI SubTopic: General Tags:
Jan ’23
3D interactive software - which documentation should I look at first?
Thinking of trying to code a 3d engineering design software. I know it won't be easy to code. The basic idea is the user is given an interactive 3d interface, and the user can move through the 3d space, drag and drop columns beams etc, select deselect dragged or created items, assign values to it, dimensions etc. The user should be able to change sizes of elements (like when user type 10 width, the beam should change it's size to the typed value etc), get fixed to other elements etc. Any idea which documentation should I look at for xcode, swiftui to get an idea or first few steps into interactive 3d etc?
2
0
1k
Jan ’23
Reply to Displaying Core Data entity in Table (iOS 16)
You can bind the table to the fetch request's sort descriptors there is no need to have additional state, e.g. Table(stats, sortOrder: $stats.sortDescriptors) { When the users clicks on a table column the fetch and the table will update automatically. Unfortunately there is an issue where if the View containing the FetchRequest is re-init then the sortDescriptors get reset to their default. I'm not sure if that is a design flaw in @FetchRequest or we are supposed to make our own @State for the sort in the view above and pass it in as a binding and use the value in the @FetchRequest and using the binding to the binding in the Table, e.g. @Binding var sortDescriptors: [SortDescriptor] init(sd: Binding<[SortDescriptor]>) { _items = FetchRequest(sortDescriptors: sd.wrappedValue) _sortDescriptors = sd } ... Table(stats, sortOrder: $sortDescriptors) {
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jan ’23
How to sort SwiftUI Table with Data from Core Data FetchResult
I habe the following code : @Environment(.managedObjectContext) private var context @FetchRequest(fetchRequest: Club.fetch(NSPredicate.all)) private var clubs: FetchedResults @State private var selectedClubs = Set() @State var sortOrder: [KeyPathComparator] = [ .init(.city, order: SortOrder.forward) ] var body: some View { VStack { Text(Clubs) Table(clubs, selection: $selectedClubs, sortOrder: $sortOrder) { TableColumn(Club ID, value: .clubId) TableColumn(Name, value: .name) TableColumn(Short Name, value: .shortName) TableColumn(Acronym, value: .acronym) TableColumn(City, value: .city) }.onChange(of: sortOrder) { newValue in print(newValue) } } } } How can I enable column sorting? The example app from wwdc does not use Core Data.
4
0
5.6k
Jan ’23
NavigationSplitView
I need help with this topic please. I'm interested in the three column layout version. Column one I want my list of Core Data Entities, Column two I want a list of my Core Data Entity's ListView items, and for Column three I want the detail view of the selected list view item. Any help on figuring out the best way to accomplish this would be much appreciated. Thanks
2
0
1.1k
Jan ’23
Reply to NavigationSplitView
For column one I setup an enum enum Nav: String, Hashable, CaseIterable and the cases are the different Entity names. And then use a list to display them. For column two I'd need a way to show the ListView() for whatever Entity name was selected from column one. And then the third column you show the DetailView() of the selected ListView() item. I guess is my sudo way of thinking about how it should work. But maybe that's not a great way of how you'd go about it?
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jan ’23
Wired spacing between rows when using LazyVGrid
My code is import SwiftUI struct ContentView: View { var emojis = [🚂, 🤡, 🚀, 🚁, 🚕, 😅, ✅, 👍, 🥳, 🎃] @State var emojiCount = 6 var body: some View { VStack { ScrollView { LazyVGrid(columns: [GridItem(.adaptive(minimum: 65))]) { ForEach(emojis[0.. 1 { emojiCount -= 1 } }, label: { Image(systemName: minus.circle) }) } var add: some View { Button { if emojiCount < emojis.count { emojiCount += 1 } } label: { Image(systemName: plus.circle) } } } struct CardView: View { var content: String @State var isFaceUp: Bool = true var body: some View { ZStack { let shape = RoundedRectangle(cornerRadius: 20) if isFaceUp { shape.fill().foregroundColor(.white) shape.strokeBorder(lineWidth: 3) Text(content) .font(.largeTitle) } else { shape.fill() } } .onTapGesture { isFaceUp = !isFaceUp } } } struct ContentView_Previews: PreviewProvider { static var previews: some View { ContentView() .preferredColorScheme(.light) ContentView() .preferredColorScheme(.dark) } } Then I get Actually, the spacing between rows is t
1
0
810
Jan ’23
Simple core data app doesn't support undo
Hello, Amateur developer here. I dusted off a hobby core data app coded mostly under OSX 10.7, and which supported undo for free (as Apple say it). It still works when I build it with recent Xcode versions, except that it no longer supports undo. To understand why, I coded the most basic objective-C, core data (not document-based) app. In short, a single table view with a single column bound to an NSArray Controller set in entity name mode and bound to the managed object context. The core data model has a single entity class with a single NSString attribute (called name, and which the table view column shows). It all works well, I can add and remove entities, and change their names from the table. Changes are saved normally... except there is nothing I can undo. The undo menu item is greyed out. I checked that my App Delegate implements the windowWillReturnUndoManager method and that this selector is called regularly. So to check that the undo manager sees anything to undo, I added this meth
2
0
1.6k
Jan ’23
Parser Json with Single Quote
Hi. I am having issues with json parsing. all my source data use double quote except for one. here is the sample do { let json = [['16772', 'Cebu', 'Philippines']] if let jsonArray = try JSONSerialization.jsonObject(with: Data(json.utf8), options: []) as? [[Any]] { print(Hello World) } } catch { print(error) } if the json string is let json = [[16772, Cebu, Philippines]] it works ok. but if it is single quote, then it gives out the error message Error Domain=NSCocoaErrorDomain Code=3840 Invalid value around line 1, column 2. UserInfo={NSDebugDescription=Invalid value around line 1, column 2., NSJSONSerializationErrorIndex=2} What am i missing to enable parsing single quote normally? Thoughts?
2
0
1.9k
Dec ’22
Reply to Save DataFrames as CSVs
I don’t think there’s a way to do that but, if you know that the names are unique, you can rename the columns after the join. Share and Enjoy — Quinn “The Eskimo!” @ Developer Technical Support @ Apple let myEmail = eskimo + 1 + @ + apple.com
Topic: Programming Languages SubTopic: Swift Tags:
Dec ’22
Deleting all items in an array causes issues with the ForEach used to render the arrays items
I use Core Data with two entities: Set and Link. Both entities contain a UUID id. Sets can contain 1 or more Links and this is represented in a 1-many relationship When the user wants to delete ALL links, this code is called for link in learningSet.webLinksArray.reversed(){ container.viewContext.delete(link) } do{ try container.viewContext.save() } catch let error { print(Failure deleting all links } Here is the view code that renders link if !learningSet.webLinksArray.isEmpty{ LazyVGrid(columns: columns, alignment: .center, spacing: 16, pinnedViews: []) { ForEach(learningSet.webLinksArray, id: .id) { link in RichWebLinkView(webLink: link) } } } It all works, but I get the following error/warning in the console ForEach, _FlexFrameLayout>>: the ID nil occurs multiple times within the collection, this will give undefined results! LazyVGridLayout: the ID nil is used by multiple child views, this will give undefined results! It's unclear why the LazyVGrid is even being re-rendered when the
1
0
945
Dec ’22
navigationDestination(isPresent:content) in NavigationStack doesn't work on iOS16.1 beta
Hi, I've just finished replacing to NavigationStack, but I'm having trouble with this issue. The following simple sample code works on iOS 16.0 production, but it doesn't work on iOS 16.1 beta. When navigationDestination(isPresent:) is called, Xcode displays runtime warning message, but I cannot understand what the means. A `navigationDestination(isPresented:content:)` is outside an explicit NavigationStack, but inside the detail column of a NavigationSplitView, so it attempts to target the next column. There is no next column after the detail column. Did you mean to put the navigationDestination inside a NavigationStack? I didn't use NavigationSplitView and navigationDestination(isPresent:) is inside NavigationStack. Could someone please point out the problem with this code? Or is it a SwiftUI bug? Test environment Xcode Version 14.1 beta 2 (14B5024i) iPhone SE (3rd gen) (iOS 16.1) Sample Code @main struct StackViewSampleApp: App { var body: some Scene { WindowGroup { Navi
3
0
2k
Dec ’22