Search results for

column

2,048 results found

Post

Replies

Boosts

Views

Activity

Reply to vLookup In App?
I suspect that the reason no one has responded is that your question is cast in terms of spreadsheets, which are a bit hard to grok when you’re used to traditional programming languages. So I dusted off my copy of Numbers and looked up the VLOOKUP function. It seems to be equivalent to Swift’s array subscripting. For example: let sheet: [[Int]] = [ [1, 2, 3], [4, 5, 6], [7, 8, 9], ] let row = 1 let column = 2 print(sheet[row][column]) // prints “6”If you read the documentation on arrays and subscripts, that might put you on the right path.Share and Enjoy — Quinn “The Eskimo!” Apple Developer Relations, Developer Technical Support, Core OS/Hardware let myEmail = eskimo + 1 + @apple.com
Topic: Programming Languages SubTopic: Swift Tags:
Sep ’16
Reply to Correct way to label TextField inside Form in SwiftUI
I've never needed to do this, but I've had a quick look, and this seems reasonable: var body: some View { VStack(alignment: .leading) { Form { Text(First Name) TextField(, text: $firstName, prompt: Text(Required)) Text(Last Name) .padding(.top, 10) TextField(, text: $lastName, prompt: Text(Required)) Text(Email) .padding(.top, 10) TextField(, text: $email, prompt: Text(Required)) Text(Job) .padding(.top, 10) TextField(, text: $job, prompt: Text(Required)) Text(Role) .padding(.top, 10) TextField(, text: $role, prompt: Text(Required)) } .formStyle(.columns) .padding(.horizontal, 16) .padding(.vertical, 16) Spacer() } } The key is .formStyle(.columns).
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Feb ’25
Reply to Xcode 8 not showing iOS 10 simulators
Just to be sure, have you tried the Xcode menu option window | devicesOn the left column click on the + and add a simulator.Be sure to select a device type that supports iOS 10 and select the OS version and click create.iOS 10 devices should be there by default. I've had weird behavior in the past when updating to a new version.
Sep ’16
Reply to NSBrowser Column titles not showing up.
Pretty sure I did set the titled property in IB, i'll have to go back and check the nib.I also noticed another issue. Even though my browser is set to *not* take the title from the previous column, sometimes it does, until I force it to redraw by resizing the window, then the title I return in the delegate method shows up.
Topic: UI Frameworks SubTopic: AppKit Tags:
Feb ’17
Reply to NSTextField intrinsicContentSize width is always -1 (NSViewNoInstrinsicMetric)
It’s correct that editable fields don’t have an intrinsic width. Typically they clip their contents to an arbitrary width, and during editing the field editor allows you to scroll through the text if it’s too large. In this case it sounds like you’ll want to constrain the field to its table cell so that it derives its width from the table column’s width.
Topic: UI Frameworks SubTopic: AppKit Tags:
Apr ’18
Reply to Extra argument in call
Try this: let columns: [GridItem] = [GridItem(.flexible()), GridItem(.flexible()), GridItem(.flexible())] struct ContentView: View { var body: some View { GeometryReader { geometry in VStack{ Spacer() ZStack { LazyVGrid(columns: columns) { Group { Circle() .frame(width: 100, height: 100) .foregroundColor(Color(.systemBlue)) .opacity(0.5) Circle() .frame(width: 100, height: 100) .foregroundColor(Color(.systemBlue)) .opacity(0.5) Circle() .frame(width: 100, height: 100) .foregroundColor(Color(.systemBlue)) .opacity(0.5) Circle() .frame(width: 100, height: 100) .foregroundColor(Color(.systemBlue)) .opacity(0.5) Circle() .frame(width: 100, height: 100) .foregroundColor(Color(.systemBlue)) .opacity(0.5) Circle() .frame(width: 100, height: 100) .foregroundColor(Color(.systemBlue)) .opacity(0.5) } Group { Circle() .frame(width: 100, height: 100) .foregroundColor(Color(.systemBlue)) .opacity(0.5) Circle() .frame(width: 100, height: 100) .foregroundColor(Color(.systemBlue)) .opacity(0.5) Cir
Dec ’21
Reply to SwiftUI Table Limit of Columns?
I am attempting to overcome the 10 columns limitation of Table This is Crashing the compiler with this error: The compiler is unable to type-check this expression in reasonable time; try breaking up the expression into distinct sub-expressions Code: import SwiftUI //--------------------------------------------------------------------------------------------- struct TestStruct : Identifiable { var id = UUID () var name : String var val : Int } //--------------------------------------------------------------------------------------------- struct ContentView: View { @State var testData : [ TestStruct ] = [ TestStruct ( name: Leopold, val: 1 ), TestStruct ( name: Napoleon, val: 2 ) ] var body: some View { VStack { Table ( testData ) { Group { TableColumn ( Name ) { testStruct in Text ( testStruct.name ) } TableColumn ( Value ) { testStruct in Text ( String ( testStruct.val ) ) } } } } } } //--------------------------------------------------------------------------------------------- struct ContentView_Pr
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Sep ’22
How to: Compositional layout with self-sizing rows of N columns where the height of each item is set to the tallest item in its row
Paging Steve Breen! 😄 I've seen this question asked a zillion times but I've never seen an answer. Is it possible to configure compositional layout to give you a grid of N columns (say 2 or 3) where each item in each row/group self-size their height, but the heights of those items are then set to be the height of the tallest item in their row. This is easy to do if you ignore the self-sizing requirement (just use a fixed or absolute item height), but on the surface this doesn't even appear to be possible if you require self-sizing. What I've Tried Configuring a layout where the items are set to a fractional height of 1.0 and their group is set to an estimated height (ex: 100). I was hoping compositional layout would interpret this as, Please self-size the height of the group and make each item 100% of that height. Unfortunately, compositional layout just uses the estimate you provide for the height as the actual height and no self-sizing occurs at all. Sad panda. 🐼 Use visibleItemsInvalidationHandl
Topic: UI Frameworks SubTopic: UIKit Tags:
4
0
5.4k
Nov ’22
Reply to Illegal NSTableViewDataSource
Hello Claude:See if the code you checked is the same as this because when I run it with changes I get the crash at line 12import Cocoa import CoreData class RegistrationReportsViewController: NSViewController { requiredinit?(coder aDecoder: NSCoder) { self.items = [] super.init(coder: aDecoder) } overridefunc viewDidLoad() { super.viewDidLoad() tableView.dataSource = self // Do this FIRST tableView.delegate = self showRegisteredStudents() // not needed, done in showRegisteredStudents } privatelazyvar fetchedResultsController: NSFetchedResultsController = { let fetchRequest: NSFetchRequest = Registration.fetchRequest() let frc = NSFetchedResultsController(fetchRequest: fetchRequest, managedObjectContext: self.persistentContainer.viewContext, sectionNameKeyPath: nil, cacheName: nil) frc.delegate = (selfas! NSFetchedResultsControllerDelegate) return frc }() var items: [NSManagedObject] var managedObjectContext = (NSApplication.shared.delegate as! AppDelegate).persistentContainer.viewContext let persistentContain
Topic: Programming Languages SubTopic: Swift Tags:
Jan ’20
Reply to How To Renew IOS Developer Certificate
You need to click on a specific profile, then click Edit. The available certificates should be shown at the bottom with radio buttons to choose the one you want. If it doesn't show up, are you sure you created an In House and Ad Hoc certificate and not a Development certificate? On the main Certificates page, the TYPE column should show iOS Distribution.
Jul ’20
Reply to Illegal NSTableViewDataSource
Yes, but what is the backtrace of the error ?What are the results of the print statements ?It seems that func tableView(_ tableView: NSTableView, objectValueFor tableColumn: NSTableColumn?, row: Int) -> Any? {is declared inside func configureCell(cell: NSTableCellView, row: Int, column: Int){which is not normalProbably miss a closing curly brace line 94.
Topic: Programming Languages SubTopic: Swift Tags:
Jan ’20
Reply to Anchor on Sky? (Yea the clear blue sky)
Yes. You can add your own anchor to the session: https://developer.apple.com/documentation/arkit/arsession/2865612-add To instantiate your own anchor, you can call the anchor initializer with a 4x4 transform: https://developer.apple.com/documentation/arkit/aranchor/2867985-init . Elevation of the space ship in meters above the ground would be the 3rd element in the fourth column of the transform.
Topic: Spatial Computing SubTopic: ARKit Tags:
Oct ’22
Reply to Archive: Distribute Content instead of Distribute App
So there must be something wrong with the settings I guess? Indeed. Can you archive the project from this post No I can’t. Well, I can do a Product > Archive but the Organizer says Distribute Content not Distribute App. Fascinating! Checking the .xcarchive reveals that the Products directory is empty, just like in your case. The build settings reveals the problem. Check out this screen shot: So Skip Install: Starts out as No in the iOS defaults column. Is not explicitly set in any of the columns. Ends up as Yes in the Resolved column. The only obvious source of the Yes value is the SampleCode.xcconfig file, but it does not set this build setting. Weird. Anyway, after a bunch of spelunking I finally figured out what’s going on here. It seems that the app target has the Installation Directory (INSTALL_PATH) build setting set to the empty string. So when you build an archive Xcode doesn’t put the app in the archive because it doesn’t know where to put it. I’d appreciate you filing t
Aug ’21
Reply to On devices running iOS 14.5.1, the app was force-quit immediately after deployment and could not be launched.
I went to Tools, clicked Options, and unchecked Enable My Code Only under General in the Debugging column, and now I can run it. I checked the Enable My Code Only checkbox again as a test, and confirmed that I could run the program. Maybe the options file was corrupted and prevented it from starting. Thanks for your valuable time.
May ’21