Search results for

“column”

2,085 results found

Post

Replies

Boosts

Views

Activity

Reply to Xcode 13.2.1 (13C100) Preview Not Working but Simulator Works!
I tested this code with Xcode 13.2.1. It runs perfectly. Which version of Xcode ? Did you inspect the disgnostics ? let columns: [GridItem] = [GridItem(.flexible()), GridItem(.flexible()), GridItem(.flexible())] struct ContentView: View { var body: some View { LazyVGrid(columns: columns) { ForEach(0..<9) { i in ZStack { Circle() .foregroundColor(.red) .opacity(3) } } } } } struct ContentView_Previews: PreviewProvider { static var previews: some View { ContentView() } } Here is screenshot (only difference is ContentView17 vs ContentView).
Topic: Programming Languages SubTopic: Swift Tags:
Jan ’22
2D-array 5rows X 5 columns matrix HELP
https://drive.google.com/file/d/1GWV9MYs_X4HG0XT4_-wDPPHdWOFwsRJs/view?usp=sharing Hi, everyone! So, I am trying to create an app that is like a survey app. I am new to coding by the way (less than a month) I have this long-ass code that I am trying to work. Well, it is working except for one more part of the code. I've been trying to make it work for days now and I cannot seem to figure it out. I uploaded it in a google drive link above. This is what it is: If you try to run this code in Xcode, you can see a thing like this: The app works like this, users select the pickers beside the Criteria and Relative Risk. The scores will show as: Score: 2,4 (just a sample score) criteria = row relative risk = column what I want to happen is that this score will immediately translate as a coordinate in the risk matrix below. There are 21 sets of pickers for this part of the app. The coordinates can have more than 1 value. so if there are 3 scores that have the same coordinate, such coordinate in the matrix sho
0
0
319
Jul ’23
Reply to NSSourceList not showing text
OK, I figured it out.The difference between the preconfigured outline view and the preconfigured source list (there isn't actually a NSSourceList, it's just a NSOutlineView with a different preconfiguration) is in the cell identifiers.In the outline view, there is only one cell in each column, and the cell identifier is left at the default, which means automatic. In this case, the cell identifier is actually the table column identifier, which is where you typically get the cell identifier from in your outlineView(:viewFor:item:) delegate method.In the source list, there is only one column, but it has two cells (one for the group header and one for the detail row), and they come preconfigured with cell identifiers HeaderCell and DataCell respectively. Set up that way, you can't follow the usual pattern of using the column identifier, since neither cell matches the column identifier.To fix this, you can just use the HeaderCell and DataCell identifiers directly in out
Topic: UI Frameworks SubTopic: AppKit Tags:
Aug ’18
Reply to How to remove all columns from NSOutlineView?
>> just remove all columns and start againFor that scenario, you can easily work around the issue by adding a new outline table column first, then delete all the other columns.FWIW, it's not obvious that there's a really good reason for this restriction, at the API level, so it probably reflects some implemention detail. It would be reasonable to file a bug report to allow deletion of the outline column, but I wouldn't hold my breath that it would be done any time soon. 🙂It would also be reasonable to file a bug report against the message.
Topic: UI Frameworks SubTopic: AppKit Tags:
Sep ’18
Reply to MPSMatrixDescriptor warning
The convenience initializer: init(dimensions rows: Int, columns: Int, rowBytes: Int, dataType: MPSDataType) ...has been deprecated. It looks like you should instead use: init(rows: Int, columns: Int, rowBytes: Int, dataType: MPSDataType) This seems to be the same, since the deprecated initializer replaces dimensions with rows anyway.
Topic: Graphics & Games SubTopic: Metal Tags:
Feb ’22
Reply to Make method less repetative
Although not understand the purpose of your code (which makes it difficult to propose any improvement), try this:private func generateLoserLocationFunction(numberOfPlayers: Int) -> (column: Int, row: Int) -> (column: Int, row: Int) { switch numberOfPlayers { case 8,16,32: return { row, column in let newCol = -2 * column switch column { case 0: return (newCol, row / 2) case 1 where numberOfPlayers == 8: return (newCol, row ^ 1) case 1 where numberOfPlayers == 16: return (newCol, 3 - row) case 1 where numberOfPlayers == 32: return (newCol, (row + 4) % 8) case 2 where numberOfPlayers == 16: return (newCol, row ^ 1) case 2 where numberOfPlayers == 32: return (newCol, row) case 3 where numberOfPlayers == 32: return (newCol, row ^ 1) default: return (newCol, 0) } } default:abort() } }You also can combo some cases like this:case 1,2 where numberOfPlayers < 32: return (newCol, row ^ 1)But only you can tell whats make sense for your code.
Topic: Programming Languages SubTopic: Swift Tags:
Sep ’15
Reply to vLookup In App?
Thank you, I'll be sure to check out the documentation. Now, again, I'm new to Swift, so forget the silly questions, but can you generate array numbers based upon other array inputs?Basically, I want to have people input 3 numbers (which will be a part of the arrays), and have the rest of the array numbers generate in a certain manner from there. For example, if I want the user to input row 1, column 1, and from there, it would make, say, row 2, column 1 two more, and row 2, column 2 one more, could I do something like that?I assume I can.
Topic: Programming Languages SubTopic: Swift Tags:
Sep ’16
Reply to If parent Node will be moved, childnodes will followed.
I did. But when I use hitTest.first.node, the childnode will be touch, not all parts of the object. Can you look at my code?Here is my code when touching: let location = recognizer.location(in: sceneView) var hitTestOptions = [SCNHitTestOption: Any]() hitTestOptions[SCNHitTestOption.boundingBoxOnly] = true let hit=sceneView.hitTest(location, options: hitTestOptions).first print(You're dragging) guard let selectedNode=(hit?.node) as SCNNode? else { return } let transform = arHitTestResult.last?.worldTransform let newPosition = float3((transform?.columns.3.x)!, ((transform?.columns.3.y)!), (transform?.columns.3.z)!) selectedNode.simdPosition = newPosition sceneView.scene.rootNode.addChildNode(selectedNode)
Topic: Spatial Computing SubTopic: ARKit Tags:
Apr ’18
Reply to swipeActions on macOS?
I have to admit though, I'm still a bit curious about why this doesn't seem to work for me in a two-column layout. The Messages app on macOS is an example of a swipe action occurring without having three columns. So, I'm still not certain about the conditions under which the .swipeAction modifier will work.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Aug ’21
What does the "Restricted" column in Activity Monitor display?
Some quick testing showed that it does not seem to be the hardened runtime.
Replies
0
Boosts
0
Views
503
Activity
Nov ’23
Preview crashes when adding a pdf to thumbnail column
Preveiw app unexpectedly quits when adding a pdf to the thumbnail coulumn.
Replies
0
Boosts
0
Views
154
Activity
Aug ’16
Reply to Xcode 13.2.1 (13C100) Preview Not Working but Simulator Works!
I tested this code with Xcode 13.2.1. It runs perfectly. Which version of Xcode ? Did you inspect the disgnostics ? let columns: [GridItem] = [GridItem(.flexible()), GridItem(.flexible()), GridItem(.flexible())] struct ContentView: View { var body: some View { LazyVGrid(columns: columns) { ForEach(0..<9) { i in ZStack { Circle() .foregroundColor(.red) .opacity(3) } } } } } struct ContentView_Previews: PreviewProvider { static var previews: some View { ContentView() } } Here is screenshot (only difference is ContentView17 vs ContentView).
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Jan ’22
Reply to What's the unit in NSView coordinate system
Have you considered that there may be space between columns? See the intercellSpacing property.
Topic: UI Frameworks SubTopic: AppKit Tags:
Replies
Boosts
Views
Activity
Mar ’24
Reply to Managing UISplitViewController displayMode with orientation change & multitasking in iOS 14?
I should note that I'm not referring to .compact column mode (I have that working great). I'm referring to when the app is wide enough that the width class is still regular, so the triple column style is shown, but the screen is narrower due to portrait orientation or when another app is multitasked next to your app.
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Jul ’20
2D-array 5rows X 5 columns matrix HELP
https://drive.google.com/file/d/1GWV9MYs_X4HG0XT4_-wDPPHdWOFwsRJs/view?usp=sharing Hi, everyone! So, I am trying to create an app that is like a survey app. I am new to coding by the way (less than a month) I have this long-ass code that I am trying to work. Well, it is working except for one more part of the code. I've been trying to make it work for days now and I cannot seem to figure it out. I uploaded it in a google drive link above. This is what it is: If you try to run this code in Xcode, you can see a thing like this: The app works like this, users select the pickers beside the Criteria and Relative Risk. The scores will show as: Score: 2,4 (just a sample score) criteria = row relative risk = column what I want to happen is that this score will immediately translate as a coordinate in the risk matrix below. There are 21 sets of pickers for this part of the app. The coordinates can have more than 1 value. so if there are 3 scores that have the same coordinate, such coordinate in the matrix sho
Replies
0
Boosts
0
Views
319
Activity
Jul ’23
Reply to NSSourceList not showing text
OK, I figured it out.The difference between the preconfigured outline view and the preconfigured source list (there isn't actually a NSSourceList, it's just a NSOutlineView with a different preconfiguration) is in the cell identifiers.In the outline view, there is only one cell in each column, and the cell identifier is left at the default, which means automatic. In this case, the cell identifier is actually the table column identifier, which is where you typically get the cell identifier from in your outlineView(:viewFor:item:) delegate method.In the source list, there is only one column, but it has two cells (one for the group header and one for the detail row), and they come preconfigured with cell identifiers HeaderCell and DataCell respectively. Set up that way, you can't follow the usual pattern of using the column identifier, since neither cell matches the column identifier.To fix this, you can just use the HeaderCell and DataCell identifiers directly in out
Topic: UI Frameworks SubTopic: AppKit Tags:
Replies
Boosts
Views
Activity
Aug ’18
Reply to How to remove all columns from NSOutlineView?
>> just remove all columns and start againFor that scenario, you can easily work around the issue by adding a new outline table column first, then delete all the other columns.FWIW, it's not obvious that there's a really good reason for this restriction, at the API level, so it probably reflects some implemention detail. It would be reasonable to file a bug report to allow deletion of the outline column, but I wouldn't hold my breath that it would be done any time soon. 🙂It would also be reasonable to file a bug report against the message.
Topic: UI Frameworks SubTopic: AppKit Tags:
Replies
Boosts
Views
Activity
Sep ’18
Reply to MPSMatrixDescriptor warning
The convenience initializer: init(dimensions rows: Int, columns: Int, rowBytes: Int, dataType: MPSDataType) ...has been deprecated. It looks like you should instead use: init(rows: Int, columns: Int, rowBytes: Int, dataType: MPSDataType) This seems to be the same, since the deprecated initializer replaces dimensions with rows anyway.
Topic: Graphics & Games SubTopic: Metal Tags:
Replies
Boosts
Views
Activity
Feb ’22
Reply to NSTableView viewfor row, not working ?
You need to set a column name through Interface Builder.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Mar ’17
Reply to Where to review and agree the newly updated agrement??
Just to add up. Shouldn't the Action column contain any button??
Replies
Boosts
Views
Activity
Jan ’22
Reply to Make method less repetative
Although not understand the purpose of your code (which makes it difficult to propose any improvement), try this:private func generateLoserLocationFunction(numberOfPlayers: Int) -> (column: Int, row: Int) -> (column: Int, row: Int) { switch numberOfPlayers { case 8,16,32: return { row, column in let newCol = -2 * column switch column { case 0: return (newCol, row / 2) case 1 where numberOfPlayers == 8: return (newCol, row ^ 1) case 1 where numberOfPlayers == 16: return (newCol, 3 - row) case 1 where numberOfPlayers == 32: return (newCol, (row + 4) % 8) case 2 where numberOfPlayers == 16: return (newCol, row ^ 1) case 2 where numberOfPlayers == 32: return (newCol, row) case 3 where numberOfPlayers == 32: return (newCol, row ^ 1) default: return (newCol, 0) } } default:abort() } }You also can combo some cases like this:case 1,2 where numberOfPlayers < 32: return (newCol, row ^ 1)But only you can tell whats make sense for your code.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Sep ’15
Reply to vLookup In App?
Thank you, I'll be sure to check out the documentation. Now, again, I'm new to Swift, so forget the silly questions, but can you generate array numbers based upon other array inputs?Basically, I want to have people input 3 numbers (which will be a part of the arrays), and have the rest of the array numbers generate in a certain manner from there. For example, if I want the user to input row 1, column 1, and from there, it would make, say, row 2, column 1 two more, and row 2, column 2 one more, could I do something like that?I assume I can.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Sep ’16
Reply to If parent Node will be moved, childnodes will followed.
I did. But when I use hitTest.first.node, the childnode will be touch, not all parts of the object. Can you look at my code?Here is my code when touching: let location = recognizer.location(in: sceneView) var hitTestOptions = [SCNHitTestOption: Any]() hitTestOptions[SCNHitTestOption.boundingBoxOnly] = true let hit=sceneView.hitTest(location, options: hitTestOptions).first print(You're dragging) guard let selectedNode=(hit?.node) as SCNNode? else { return } let transform = arHitTestResult.last?.worldTransform let newPosition = float3((transform?.columns.3.x)!, ((transform?.columns.3.y)!), (transform?.columns.3.z)!) selectedNode.simdPosition = newPosition sceneView.scene.rootNode.addChildNode(selectedNode)
Topic: Spatial Computing SubTopic: ARKit Tags:
Replies
Boosts
Views
Activity
Apr ’18
Reply to swipeActions on macOS?
I have to admit though, I'm still a bit curious about why this doesn't seem to work for me in a two-column layout. The Messages app on macOS is an example of a swipe action occurring without having three columns. So, I'm still not certain about the conditions under which the .swipeAction modifier will work.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Aug ’21