Search results for

column

2,052 results found

Post

Replies

Boosts

Views

Activity

how do I remove the columns showing in the below pic if no data is available.
this below is the view which doesn't remove the columns after I click the delete button and it shows the data even after it is removed from the firestore unless relaunched the app. import SwiftUI import Firebase struct user:Identifiable{ @State var id:String= @State var productnm:String= @State var quan:String= } class mainviewmodel:ObservableObject{ @Published var use = [user]() init(){ fetchCurrentUser() } func fetchCurrentUser(){ guard let uid = Firebase.Auth.auth().currentUser?.uid else { return } FirebaseManager.shared.firestore.collection(users).document(uid).collection(product).getDocuments{snapshot,error in if error==nil{ //no errors if let snapshot = snapshot{ //update the user property in the main thread DispatchQueue.main.async { // //get all the documents and create user self.use=snapshot.documents.map{ d in //map will iterate over array and perform code on each item //create an new user for each document returned return user(id: d.documentID,productnm: d[product name] as? String ?? , qua
1
0
715
Mar ’22
Reply to ARKit - Get User's Position
Hi to get the uers location you use the frame.camera.transform this is basically a world matrix representing the camera. It will either be the last column or last row in the matrix (I cant remember the matrix order used by these systems). It will give you values like x,y,z,1 when you take the last column (or row). Just ignore the 1.Anyway, that should give you enough to work it out.
Topic: Spatial Computing SubTopic: ARKit Tags:
Jun ’17
Reply to Undefined symbols error when trying to use NSToolbarPrimarySidebarTrackingSeparatorItemIdentifier & NSToolbarSupplementarySidebarTrackingSeparatorItemIdentifier
Yep, beta 4 seems to fix these. Now getting some weirdness when using the toggleSidebar item in that the window title appears in the primary column rather than the supplementary column, and the toggleSidebar item moves to the far right within the overflow item. This must be a bug, toggling the toolbar into icon + label mode and back to icon only mode seems to fix it temporarily.
Topic: App & System Services SubTopic: General Tags:
Aug ’20
How to display Data in 2 columns in Table dynamically
Hi I want to display below Data in table Dynamically. No of records can vary.Title DescTitle DescTitle Desc{ error = 0; message = Ok; result = ( { id = 81; desc = <p>Traveler can select any date of travel before 60 days . He can pay remaining payment as per the payment plan mentioned above. </p> n; title = Payment Policy; }, { id = 76; desc = <p> </p> n n<p>6000</p> n; title = Advance; }, { id = 68; desc = <p>25% of Tour Cost (including booking amount)</p> n; title = On confirmation of Price quote; }, { id = 79; desc = <p>70% of Tour Cost</p> n; title = “30 Days Before Departure; }, { id = 77; desc = <p>Total Cost</p> n; title = 10 Days before Departure; } ); }Thanks
3
0
2.6k
Jul ’17
WeatherKit REST API new columns for CurrentWeather
My pipeline broke today as new fields were added for the current weather dataset: cloudCoverLowAltPct cloudCoverMidAltPct cloudCoverHighAltPct I presumed new fields would only be released in a new version of the API? Is there any way to use a specific version of the API that will not be subject to change? The current weather REST API docs are here, which don't include these fields: https://developer.apple.com/documentation/weatherkitrestapi/currentweather/currentweatherdata
6
0
1.4k
Jan ’23
Reply to Question About Swift
Here's what I ended up with, it works now...import Cocoa protocol TabularDataSource { var numberOfRows: Int { get } var numberOfColumns: Int { get } func label(forColumn column: Int) -> String func itemFor(row: Int, column: Int) -> String } func computeWidths(for dataSource: TabularDataSource) -> [Int] { var columnWidths = [Int]() for j in 0 ..< dataSource.numberOfColumns { let columnLabel = dataSource.label(forColumn: j) columnWidths.append(columnLabel.count) for i in 0 ..< dataSource.numberOfRows { let item = dataSource.itemFor(row: i, column: j) if columnWidths[j] < item.count { columnWidths[j] = item.count } } } return columnWidths } func printTable(_ dataSource: TabularDataSource & CustomStringConvertible) { print(Table: (dataSource.description)) var firstRow = | var columnWidths = computeWidths(for: dataSource) for i in 0 ..< dataSource.numberOfColumns { let columnLabel = dataSource.label(forColumn: i) let paddingNeeded = columnWidths[i] - columnLabel.
Topic: Programming Languages SubTopic: Swift Tags:
Mar ’18
Swift - access attribute in array of core data entities in a table column via a variable
The below code works. I pass in an array of core data entities and display attributes in a table. In the second table column I use a switch case statement to handle the 3 possible attributes I want to display. I could eliminate the switch case if I could figure out how to access a given core data attribute via a variable that contains the specific attribute name but have been unable to determine how to do so. Two attempts are commented out in the code. struct DataTable: View { private var closingValues: Array var heading: String var attribute: String init(closingValues: [TradingDayPrices], heading: String, attribute: String) { self.closingValues = closingValues self.heading = heading self.attribute = attribute } var body: some View { Text(heading) .foregroundColor(.black) .font(Font.custom(Arial, size: 18)) .bold() .padding(.top, 10) Table(self.closingValues) { TableColumn(Date) { value in HStack { Spacer() Text(dateToStringFormatter.string(from: value.timeStamp!)) Spacer() } } .width(100) TableColum
1
0
863
Apr ’23
Reply to Creating Floor Plan with RoomPlan
actually what you need to do is remove the y component and not the z component, if you want to convert from 3D->2D, from CapturedRoom you get dimensions.x (wall length) and (transform) .columns.3.x, transform .columns.3.z) is the coordinate of the center of the wall and the direction(transform.columns.0.z, transform.columns.0.z), is the direction of the wall, now you there is a starting and ending point of a wall, similar to other things
Topic: Spatial Computing SubTopic: ARKit Tags:
Mar ’23
Reply to TabularData Framework: DataFrame as a List in SwiftUI
Here's a working example for Mac OS (but should be the same for iOS except for the URL setup for the incoming csv file). The csv test data are in 3 columns, with headers of Name, Position and Score - so as to test data types of String, Integer and Double. The Data Model (ViewModel) import Foundation import TabularData class DataModel { static let shared = DataModel() @Published var dataTable: DataFrame? init() { getData() } func getData() { var url: URL? do { url = try FileManager.default.url(for: FileManager.SearchPathDirectory.downloadsDirectory, in: FileManager.SearchPathDomainMask.userDomainMask, appropriateFor: nil, create: true) } catch{ print(Failed to get Downsloads URL (error)) return } let csvOptions = CSVReadingOptions(hasHeaderRow: true, ignoresEmptyLines: true, delimiter: ,) let fileURL = url?.appendingPathComponent(TestCSV.csv) do { dataTable = try DataFrame(contentsOfCSVFile: fileURL!,columns: nil, rows: nil, types: [Name:CSVType.string,Position:CSVType.integer,Score:CSVType.d
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Mar ’22
Reply to SwiftUI Collection View
I agree these are not technically collection views or table views.What I meant and would like to achieve is a grid layout (like in Music's album library, Apple Books' library, etc.) or cascading layout (e.g. Pinterest) natively in SwiftUI.According to SwiftUI's documentation, a List is a container that presents rows of data arranged in a single column. What I'm looking for is a container that present data arranged in several columns and rows.
Topic: App & System Services SubTopic: Core OS Tags:
Jun ’19