Search results for

column

2,046 results found

Post

Replies

Boosts

Views

Activity

SwiftUI Inspector ideal width
Should this not set the inspector width to 550 every time? TableView() .inspector(isPresented: $state.presented) { InspectorFormView(selection: model[state.selection]) .inspectorColumnWidth(min: 150, ideal: 550, max: 600) } This is almost verbatim from the WWDC video (10161). This ideal parameter will be the size of the column at at first launch, but if the user resizes the inspector, the system will persist that size across launches. Inspector uses the minimum width (150) in every case. How can the ideal width be guaranteed upon initial launch? I could set the minimum to 550, but I'd like the user to be able to reduce the size of the inspector as well ... Thanks much & keep inspecting!🧐 (Sonoma, beta 5 / Xcode beta 6)
1
0
1.3k
Aug ’23
Xcode Application Continuous (OSX) Indexing Crash Problem
Xcode indexing will cause my Mac Mini (M1) to crash when indexing is active (ON). ===> Xcode Version 12.5.1 (12E507) To test the following, I created a smaller OSX desktop application, compared to my main OSX desktop application, which is significantly larger in scope, and size. That said, I enter the following code in the terminal to activate and deactivate Xcode Indexing: 1. Indexing is active (ON) when applied in the terminal : defaults write com.apple.dt.XCode IDEIndexDisable 0 2. Indexing is NOT active (OFF) when applied in the terminal : defaults write com.apple.dt.XCode IDEIndexDisable 1 The application causing the crash with Xcode Indexing turned (ON), creates a PList file for my main application to use, which is an array of dictionary tuples. This application for the moment, creates a baseline array of 4,000+ dictionary objects with eight (8) tuple objects per dictionary. I use the same design with different, and significantly less information to create other PList array of dictionary objects, suc
2
0
2.6k
Aug ’23
TabluarData DataFrame removing row results in EXC_BAD_ACCESS
I am working with data in Swift using the TabularData framework. I load data from a CSV file into a DataFrame, then copy the data into a second DataFrame, and finally remove a row from the second DataFrame. The problem arises when I try to remove a row from the second DataFrame, at which point I receive an EXC_BAD_ACCESS error. However, if I modify the timings column (the final column) before removing the row (even to an identical value), the code runs without errors. Interestingly, this issue only occurs when a row in the column of the CSV file contains more than 15 characters. This is the code I'm using: func loadCSV() { let documentsDirectory = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask).first! let url = documentsDirectory.appendingPathComponent(example.csv) var dataframe: DataFrame do { dataframe = try .init( contentsOfCSVFile: url, columns: [user, filename, syllable count, timings], types: [user: .string, filename: .string, syllable count: .i
2
0
1.1k
Aug ’23
Trying to understand SQLite step statement
I am learning SQLite queries. I use prepare statement and one or more calls to a step statement. The prepare statement knows the pointer to the database, the UFT8 select statement and the name of the pointer which will point to the complied SQL select statement. The first step call runs the compiled select statement and if data is returned, the first row is made available via column calls. It seems logical to me that the select statement returns all matching rows but if the first step statement only has access to the first row of data, the balance of matching rows must be stored somewhere. Is this the case and if so where are the query results stored? Or is does this work in some other manner?
1
0
550
Aug ’23
Reply to TabluarData DataFrame removing row results in EXC_BAD_ACCESS
This is most definitely a bug, probably in TabularData itself. I boiled your example down to this: import Foundation import TabularData func test() { let csv = c CCCCCCCCCCCCCCCC var dataFrame = try! DataFrame( csvData: Data(csv.utf8), columns: [c], types: [c: .string] ) dataFrame.removeRow(at: 0) } test() and it crashes in roughly the same way. I’m running this as a command-line tool on macOS 13.4. I tested with both Xcode 14.3 and Xcode 15 beta and it crashes either way. I then put this code into tiny iOS test project and ran it on the iOS 17 beta simulator. It doesn’t crash there, suggesting that the bug has already been fixed. The really interesting thing is that removing a single character from CCCCCCCCCCCCCCCC makes the problem go away. Share and Enjoy Quinn “The Eskimo!” @ DTS @ Apple
Topic: Programming Languages SubTopic: Swift Tags:
Aug ’23
Reply to iCloud for Mac is stuck on "waiting to upload"
Certainly this iCloud upload being stuck bug is frustrating. My method to resolve it is as follows: Launch Activity Monitor, click on the CPU tab at the top, look for the bird process in the Process Name column, select it, and stop it (kill it) by clicking on the Stop icon on the tool bar (the one with an X inside a circle). You will noticed that the process id number listed in the PID column changes after a couple of seconds, which indicates that the bird process has been restarted by the system (The bird process is responsible of the iCloud background file synchronization). Most of the times this solution will work. If stopping the bird process did not solve the iCloud synching, then perform a full shutdown/restart of your computer. This is the ultimate fix that has always worked for me thus far.
Topic: App & System Services SubTopic: Core OS Tags:
Aug ’23
UITabBarController is unsupported as viewController
Hi, I'm testing one of my app on iOS 14 with Xcode 12 beta 3 (12A8169g) and I have a problem with my storyboards. Xcode give me this error for all the storyboards that contain a split view controller: An internal error occurred. Editing functionality may be limited. The log generated by the Xcode Report a bug button say: Exception name: NSInvalidArgumentException Exception reason: UITabBarController is unsupported as viewController for -[UISplitViewController setViewController:forColumn:] in Primary column It worked correctly on Xcode 12 beta 2. Has anyone encountered the same problem and found a way to fix it? Thank you
7
0
2.8k
Jul ’23
Swift UI Table - Problems removing selection from row
Hi,i have been trying out SwiftUI Table and wanted to present a details view when click on Table Row occurs, but I couldn't figure out how to deselect row once its been selected, while it may not be what Table was intended for, but I still think this code should be valid. (iPadOS) struct Person: Identifiable { let givenName: String let familyName: String let emailAddress: String let id = UUID() } private var people = [ Person(givenName: Juan, familyName: Chavez, emailAddress: juanchavez@icloud.com), Person(givenName: Mei, familyName: Chen, emailAddress: meichen@icloud.com), Person(givenName: Tom, familyName: Clark, emailAddress: tomclark@icloud.com), Person(givenName: Gita, familyName: Kumar, emailAddress: gitakumar@icloud.com) ] @State private var selectedPeople: Person.ID? @State private var detailsViewPresented: Bool = false var body: some View { Table(people, selection: $selectedPeople) { TableColumn(Given Name, value: .givenName) TableColumn(Family Name, value: .familyName) TableColumn(E-Mail Address, va
1
0
1.6k
Jul ’23
Help customizing the accessibility of a large UICollectionView
Hello, I am turning to this forum because I suspect I am doing it wrong when it comes to implementing VoiceOver accessibility in my collection view. I suspect this because the system has resisted everything I have tried to do, fought it tooth and nail, and I can't see any way to get this to work. The Collection View I have a collection view that displays a large dataset. It uses a custom collection view layout to create a spreadsheet-like view. It has hundreds of rows, and each row can have hundreds of items. The items in each row do not conform to specific column widths. Their width is defined by the data they display, and for the purposes of this discussion, can be considered to be arbitrary. To the left of the table is a column of sticky headers whose position remains fixed in relation to the content. On top of the table is a row of headers, whose position also remains fixed. The Problem The default accessibility behavior that Apple has baked into UICollectionView is completely impractica
2
0
2.3k
Jul ’23
Reply to SQLite - Testing for existence of a table
It is my understanding that the SELECT statement returns a 0 if the table does not exist and 1 if it does. Actually that statement will return a result row if the table exists, and no result rows if it doesn’t exist. If you really want a result row containing a number every time, then you could use: SELECT COUNT(*) FROM sqlite_master WHERE type = 'table' AND name = 'Contact' But this would require you to fetch the column value to check the number. Your original query actually makes this task easier by letting you simply check if a row was returned or not. the API step statement returns 101 (SQLITE_Done) if the table does not exist. That means sqlite3_step has finished stepping through all the result rows, of which there are none. But if the table does exist it does not return 101. That would be SQLITE_ROW which means it got a result row. If you were to call sqlite3_step once again (or in a loop) you would get SQLITE_DONE the next time.
Topic: Programming Languages SubTopic: Swift Tags:
Jul ’23
SwiftUI/Table/Sort: Problem with the sort function on a Table
Hello everyone. I'm having a problem using the table sort function in Swiftui. Here's an example to illustrate (data is provided by an API that returns fake data) : struct CompanyListResponse: Codable { let status: String let code: Int let total: Int let data: [CompanyData] } struct CompanyData: Codable, Identifiable { let id: Int let name: String let email: String } @Observable final class ViewModel { var companies : [CompanyData] = [] func fetch() async { guard let url = URL(string: https://fakerapi.it/api/v1/companies?_quantity=200) else { return } do { let (data, _) = try await URLSession.shared.data(from: url) let decoder = JSONDecoder() let response = try decoder.decode(CompanyListResponse.self, from: data) self.companies = response.data } catch { print(Error fetching data: (error)) } } } struct ContentView: View { @State private var viewModel = ViewModel() @State private var sortOrder : [KeyPathComparator] = [.init(.name, order: SortOrder.forward)] var body: some View { Table(of: CompanyData.self, sort
1
0
924
Jul ’23
Reply to How to capture unknown number of matches using RegexBuilder?
Just want to clarify, suppose I want to parse a table with multiple columns each separated by “|”, I can do one of the followings and use firstMatch(of: regex) or wholeMatch(of: regex), but they assume fixed number of columns in the table. How do I deal with dynamic number of columns? // using multi-line literal let regex = #/ (|) (? (.*?)(?=|)) (|) (? (.*?)(?=|)) (|) (? (.*?)(?=|)) /# // using RegexBuilder let separator = /|/ let regexBuilder = Regex { separator Capture ( OneOrMore(.any, .reluctant) ) separator Capture ( OneOrMore(.any, .reluctant) ) separator Capture ( OneOrMore(.any, .reluctant) ) separator }
Topic: App & System Services SubTopic: General Tags:
Jul ’23
Display a LazyVGrid with Sections
I am trying to render a list of entities that are split into sections (think CoreData NSFetchedResultsSectionInfo). This my solution, however it renders poorly. The ScrollView is far too long, scrolling is not fluid and may freeze. struct SectionsGridView: View { let results: Sections let columns = [ GridItem(.adaptive(minimum: .cellSize)) ] var body: some View { ScrollView { LazyVGrid(columns: columns, spacing: .gridSpacing, pinnedViews: .sectionHeaders) { ForEach(results) { section in Section(header: Text(section.title?.uppercased() ?? error)) { ForEach(section) { item in GridCell().environmentObject(item) } } } } } } } private extension CGFloat { static let gridSpacing = 8.0 static let cellSize = 100.0 } I believe this solution (or very similar) used to be in the documentation. I have tried several ways of doing this, either I get the scrolling issue or pinnedViews won't pin.
1
0
2.6k
Jul ’23
Reply to Reset Matrix Help
for anyone who might have the same question/problem. here's the sample that works as I wanted. import SwiftUI struct ContentView: View { let numberOfRows = 5 let numberOfColumns = 5 @State var matrix: [[Int]] = Array(repeating: Array(repeating: 0, count: 5), count: 5) @State var selectedRow1 = 0 @State var selectedColumn1 = 0 @State var selectedRow2 = 0 @State var selectedColumn2 = 0 @State var selectedRow3 = 0 var body: some View { VStack { Image(systemName: globe) .imageScale(.large) .foregroundColor(.accentColor) Text(Hello, world!) Form { Section(header: Text(Question 1)) { Picker(Select a row:, selection: $selectedRow1) { ForEach(1...numberOfRows, id: .self) { row in Text((row)) } } .pickerStyle(SegmentedPickerStyle()) Picker(Select a column:, selection: $selectedColumn1) { ForEach(1...numberOfColumns, id: .self) { column in Text((column)) } } .pickerStyle(SegmentedPickerStyle()) } Section(header: Text(Question 2)) { Picker(Select a row:, selection: $selectedRow2) { ForEach(1..
Topic: Programming Languages SubTopic: Swift Tags:
Jul ’23