Search results for

“column”

2,091 results found

Post

Replies

Boosts

Views

Activity

Reply to SwiftUI LazyVGrid Positioning
Hi, I saw your question a few hours ago and I don't know if you are still looking for an answer at this time. Anyways, here is the solution with an explanation for anyone who might be interested in it. You have a LazyVGrid with two columns which is what you are seeing in the screenshot you've provided. UnitView(), TemperatureView() and CurrencyView() form the first column, whereas DistanceView() and TimeView() form the second column. Since you did not specify the alignment property, it assumed its default value, which is HorizontalAlignment.center in the case of LazyVGrid. If you specify alignment as HorizontalAlignment.leading, then the view would look somewhat like how you want it to look. But, it doesn't look good because the cards are not in the middle of the screen. To solve this, you would have to embed LazyVGrid into a LazyVStack, take the CurrencyView() out of the LazyVGrid, and place it outside LazyVGrid but within LazyVStack. struct ContentView: View { let columns
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Apr ’23
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 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
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 SwiftUI LazyVGrid Positioning
Hi, I saw your question a few hours ago and I don't know if you are still looking for an answer at this time. Anyways, here is the solution with an explanation for anyone who might be interested in it. You have a LazyVGrid with two columns which is what you are seeing in the screenshot you've provided. UnitView(), TemperatureView() and CurrencyView() form the first column, whereas DistanceView() and TimeView() form the second column. Since you did not specify the alignment property, it assumed its default value, which is HorizontalAlignment.center in the case of LazyVGrid. If you specify alignment as HorizontalAlignment.leading, then the view would look somewhat like how you want it to look. But, it doesn't look good because the cards are not in the middle of the screen. To solve this, you would have to embed LazyVGrid into a LazyVStack, take the CurrencyView() out of the LazyVGrid, and place it outside LazyVGrid but within LazyVStack. struct ContentView: View { let columns
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Apr ’23
Reply to UISplitViewController and iOS14
Same also here. What I personally would like is to be able to specify in the storyboards that I want to use the classic system for split view controllers and not the new columns based system.
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Aug ’20
Reply to Should Face Tracking Position and Depth Map 3D Point Be in the Same Space?
Ugh, I'm a moron. It seems... float principleX = thisPhoto.intrinsicMatrix.m20; float principleY = thisPhoto.intrinsicMatrix.m21;Should have been... float principleX = thisPhoto.intrinsicMatrix.m02; float principleY = thisPhoto.intrinsicMatrix.m12;The column/row seems to be swapped.
Topic: Spatial Computing SubTopic: ARKit Tags:
Replies
Boosts
Views
Activity
Jul ’19
Reply to Swift Charts Accessibility Grouping
I have the same issue but need to know a way to avoid this automatic grouping at all. Would like each column has it all accessibility value (similar to the activities chart on health app)
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Aug ’24
Reply to Launch screen not rendering correctly on iPad
Does your app use column-style layouts(for iOS 14 and later) of UISplitViewController or a classic interface style? I guess the classic interface style might be the problem.
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Dec ’22
Reply to Replace ViewControllers in Column?
The context of this question is setting ViewControllers into the secondary column when in a compact environment. It appears as if it always retains the first view controller no matter how many additional ones I set.
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Jul ’20
Reply to Apple Documentation Icons and their meanings
When I open the documentation I'm looking at Apple's docs here: https://developer.apple.com/documentation/swift ...but I don't see the icons/columns you're seeing - do you have a link that demos your example, thanks.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Sep ’20
Reply to How to frozen a few columns for NSTableView
Thank you very much ,but my min3 is NSTableView's first Column can scroll with tableView scroll up and down but can't scroll with tableView scroll left and right like the table's index of i,2,3
Topic: UI Frameworks SubTopic: AppKit Tags:
Replies
Boosts
Views
Activity
Mar ’16
Reply to Populating a Table translate to Swift ?
As I mentioned before... I set up an ident for the column but the rest of the hierarchy items are default. Where is the ident being called from ?Is it referring to the NSTableColumn / NSTableCellView / NSTextField or NSTextFieldCell ?I haven't setup a nib.
Topic: UI Frameworks SubTopic: AppKit Tags:
Replies
Boosts
Views
Activity
Feb ’19
Reply to App Store doesn't display English among available languages for my new app
The rows in the English column all contain black text, which is the text passed as the value argument to NSLocalizedString(_:value:comment:). The app also runs in English if I select it in the Xcode scheme editor.
Replies
Boosts
Views
Activity
Jan ’26
Reply to 'ColumnNavigationViewStyle' initializer is inaccessible due to 'internal' protection level
Swift 5.5 introduced a new dot leaded notation. SE-0299Extending Static Member Lookup in Generic Contexts Please try this: .navigationViewStyle(.columns)
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Oct ’21
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:
Replies
Boosts
Views
Activity
Sep ’15
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:
Replies
Boosts
Views
Activity
Jul ’20
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:
Replies
Boosts
Views
Activity
Nov ’21
Reply to Hide/Show tableview columns?
Yes, I was thinking to allow multiple selections in the popup, then setting the columns to zero width which are not selected. Why do you say this is not the best UI option? I am understanding you correctly? Thanks
Replies
Boosts
Views
Activity
Aug ’20