Search results for

column

2,050 results found

Post

Replies

Boosts

Views

Activity

Reply to Make method less repetative
Not only does this seem like premature optimization, but I suspect that it's actively counterproductive.When you structure the code using a function-returning function, you're preventing the compiler from doing any inlining. The compiler can't assume that theMethodToUse points anywhere in particular, because its value is calculated at run-time. So any reference to theMethodToUse() will probably result in an actual function call. I suspect you'd be better off from a performance standpoint doing an inlined switch on the number of players, even if that value is constant.But you really can't say for sure without doing some testing. And regardless of the answer, this code is highly unlikely to ever be a performance bottleneck. You just shouldn't be worrying about performance in this context until you've been able to prove that it's an issue in the environment of the completed application.As far as brevity, I don't think you can do much better than Wallacy's revised version with the tuple-valued switch. But that co
Topic: Programming Languages SubTopic: Swift Tags:
Sep ’15
Reply to controlTextDidEndEditing for View Based NSTableView
Yes, I usually set tags: func tableView(_ tableView: NSTableView, viewFor tableColumn: NSTableColumn?, row: Int) -> NSView? { // … code cellView.textField!.tag = row + 256 * column. // If less than 256 rows ; otherwise cellView.textField!.tag = row + 256 * column This is a multiplexed value of row and col. I attach an IBAction to the tableViewCell: @IBAction func cellContentDidChange(_ sender: NSTextField) { // Let's find row and coll by demuxing the tag let rowIndiv = highWordTag % 256 let colVar = (sender.tag - rowIndiv) / 256 (that's Swift, but easily adaptable to objC)
Topic: UI Frameworks SubTopic: AppKit Tags:
Nov ’21
Reply to Side-by-side sections in UICollectionViewCompositionalLayout?
I was able to achieve side by side column sections by setting the scroll direction. let config = UICollectionViewCompositionalLayoutConfiguration() config.scrollDirection = .horizontal layout.configuration = config return layout The downside being that the orthogonal scrolling was a pretty choppy since my columns were long lists. I don't think this will work for your layout though, since your layout has sections flowing in both axes. I believe you will need to use a single section with multiple groups. This will make syncing to the datasource more complicated since we can't use the section index, but it should be possible.
Topic: UI Frameworks SubTopic: UIKit Tags:
Jul ’20
Cannot create a SwiftUI Table with more than 10 columns, attempts to use Group do not work .... HELP
Trying to overcome the 10 columns limit of Table in SwiftUI, I am trying to use Group to split the number of Views by group of 10. This generate a compiler error: The compiler is unable to type-check this expression in reasonable time; try breaking up the expression into distinct sub-expressions Here is the 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 ) ) } } } } } } //---------------------------------------------------
0
0
1.8k
Sep ’22
Reply to Are your app's controls rendering wrong now?
Not sure if I'm seeing the same issue as you, but there is an odd offset with the UIPickerView in iOS 14 that wasn't there with iOS 13... Can't seem to post a screen shot or a link to the image I posted on twitter, but I'll try to describe it. I've got 3 components (columns) in a single UIPickerView. and it looks like everything is aligned to the right of the picker, except that the center to center distance of the selected item for each component is different then the center to center distance of each of the unselected item columns. And they get further out of sync the closer you get to the left.
Sep ’20
Reply to Question About Swift
I suggest you start by describing what solution you want, that would solve the problem. If a data item is longer than the width of the column, then I want to … do what? … to make sure the alignment stays correct. If you can describe in words what would solve the problem, you're more than half way to the solution.For example, you might say, If a data item is longer than the width of the column, then I want to warp the fabric of space-time to squeeze the data into the space allowed to make sure the alignment stays correct. Then you'd know you had to go into a physics lab and start inventing.OK, so that's not a practical solution, so what is?
Topic: Programming Languages SubTopic: Swift Tags:
Mar ’18
Reply to "Field 'recordName' is not marked queryable" error when accessing cloud kit data
In the Dashboard:1) Select your container. Then choose Schema.2) In the sidebar select the record you want.3) With the record selected in the sidebar you should see a list of System fields and Custom fields. Scroll to the bottom and click the Edit Indexes.4) You'll now see a pop up button appear in the Fields column. Choose recordName (if it isn't already selected in the pop up button) then choose Queryable in the pop up button in the Index Type column. Click Add Index.5) Click Save Changes to save.
Dec ’19
Reply to give developer account to programmer?!
List the steps you take to sign in to your developer account. What you are seeing is what someone without a developer account would see if they signed in to Apple. When I sign in to my developer account, I see a Program Resources section with the following columns: App Store Connect, Certificates, IDs, and Profiles, and Additional Resources. Each of these columns has a list of links. Do you see these columns when you sign in? Are you able to click the Users and Access link I mentioned in Step 2 in my earlier answer? When I click the Users and Access link under App Store Connect, I see the following links at the top of the page: People, Sandbox, Keys, Shared Secret, and Xcode Cloud. The People link is the initially selected link. There is a Users sidebar with a list of categories. Selecting the All items shows all the users on my team with an Add button above the list of users. Clicking the Add button lets me add someone to my team. I am not an Apple employee so I cannot provide more
Topic: App & System Services SubTopic: General Tags:
Nov ’23