Search results for

column

2,061 results found

Post

Replies

Boosts

Views

Activity

Reply to Help with a script to automate data entry
It would be much easier to debug if you provided your document, your explanation of what you are trying to achieve is not super clear to me. I assume you start with no data in sheet 2 and you don't care that I'm overwriting data in sheet 2 - is this true? Anyway, please go through this code and read the comments. It takes maybe 2-3 minutes on my computer to finish the script. tell application Numbers activate -- the following code is just to show you how do I think your document looks like make new document tell front document -- there should already be one sheet, let's rename it to GAMES set name of active sheet to GAMES -- create sheet TRIALS2 -- this should also create table 1 make new sheet set name of active sheet to TRIALS2 -- making sure table 1 has at least 67 rows, otherwise we cannot access row 67 if (row count of table 1 of sheet GAMES < 67) then set row count of table 1 of sheet GAMES to 67 end if -- making sure table 1 has at least 2 columns, otherwise we cannot access column
Mar ’24
Context Menu Destructive Actions, SwiftUI
I'm trying to add a delete action in a context menu, however it just gets displayed as the default black color. The Photos app uses a red color for its delete action as well. I've seen in some spaces online that this is not a functionality currently provided of contextMenu, however I have also seen it used in third party apps in the wild from developers such as Steve Troughton-Smith in his Broadcast app (It's not letting me link to his tweet, however he has a video showing a red item in a context menu). Does anyone know how to accomplish this? Also, looking on Apple's documentation - https://developer.apple.com/documentation/swiftui/contextmenu for contextMenu it says that they have been deprecated for everything except for macOS. I find it strange that they deprecated it just one year after introducing it. Was this replaced by another component that I should be using? var body: some View { ttttScrollView { ttttttLazyVGrid(columns: columns, spacing: 20) { ttttttttForEach(photos) { photo in t
7
0
4.4k
May ’22
Reply to What's the unit in NSView coordinate system
Maybe my question is too general. I have a need to calculate all width of an NSTableView. However, I found that total width of all columns is far less than NSTableView.bound.width: let width = tableView.tableColumns.reduce(0) { ac, col in ac + col.width } print(width, tableView.bounds.width) This is true even I manually adjust last column so that it fills the gap between the column and tableview right border. -----------| <- table right border last column| -----------| So I assume NSTableColumn.width and NSView.bounds.width are using different units.
Topic: UI Frameworks SubTopic: AppKit Tags:
Mar ’24
Sorting of isometric SKTileMapNode incorrect?
Im programmatically using SKTileMapNode. The code is C# (Xamarin.iOS) but should be readable by every Swift/ObjC developer.The problem is that the sorting of tiles in isometric projection seems to be incorrect and I cannot see why. To test, the map has 1 row and 5 columns. See the screenshot:https://dl.dropboxusercontent.com/u/111612273/SVhjD.pngThe tiles at 0|0 and 2|0 are in front of the others. The pyramid styled tile at 4|0 however, is drawn correctly in front of the one at 3|0.I'm using two simple tiles: The first one has a resolution of 133x83px and the second one is 132x131px:https://dl.dropboxusercontent.com/u/111612273/bcIvP.pngandhttps://dl.dropboxusercontent.com/u/111612273/wzCZV.pngThis is what it looks like in Tiled and what I am trying to reproduce: https://dl.dropboxusercontent.com/u/111612273/66G6p.pngThe tile map is setup and added to the scene using the following code:var tileDef1 = new SKTileDefinition (SKTexture.FromImageNamed (landscapeTiles_014)); var tileDef2 = new SKTileDefini
7
0
2.1k
Jul ’23
Reply to CFBundleShortVersionString of an app extension must match that of its containing parent app
Xcode 15 does not show Version and Build settings for app extensions in Project > Targets > target > General any more. In Xcode 14 I have been manually changing those versions to keep them in sync (and avoid warnings or errors). Moving the setting from target level to project level as suggested by Eskimo from Apple fixed the problem (and simplifies the workflow so that I do not need to manually keep the versions in sync). How to move the settings? Go to Project > main target > Build Settings. Enable Levels. Enter CURRENT_PROJECT_VERSION into Filter. Edit the value for the project level (double click on the empty value in the project column). Remove the value for the main target level (single click the value in the target column, press Delete key on keyboard). Similarly for the MARKETING_VERSION. Enter it into Filter, enter the value for the project level, remove it from target level. Then, for each app extension target (Project > an app extension target > Build Settings)
Topic: App & System Services SubTopic: General Tags:
Mar ’24
Same content in 2 cards
Hello there! I'm trying to create something in SwiftUI, but there's a problem: I can't have 2 cards with the same content, does anyone know a way to have the same emojis in 2 separate cards? Here's my code: import PlaygroundSupport import SwiftUI struct ContentView: View { var emojis: [String] = [🐶, 🐱, 🐱, 🦊, 🦁, 🐝, 🐼, 🐷, 🐮] var body: some View { LazyVGrid(columns: [GridItem(), GridItem(), GridItem()]) { ForEach(emojis, id: .self, content: { emoji in emojiView(content: emoji) }) } } struct emojiView: View { var content: String = var body: some View { ZStack { RoundedRectangle(cornerRadius: 20) .frame(width: 90, height: 120) .foregroundColor(.yellow) Text(content).font(.largeTitle) } } } } PlaygroundPage.current.setLiveView(ContentView())
2
0
3.6k
Mar ’22
Reply to Help with a script to automate data entry
Someone on another forum tried to help by writing a macro for Excel but I failed to tell him I was using Numbers so, of course, it doesn't work but they did give me a clue in their attempt. I need to write a script that: (I can change the names later) -calls up the document XXX -calls up Sheet1 -copies the value of Sheet1, cell B67 -calls up sheet Sheet2 -pastes the result in cell A3 of Sheet2 -inserts a new column (or row) A on Sheet2 (preserving previous result) -recalculates Sheet1 -copies the result from Sheet1, cell B67 to column A of Sheet2 in cell A3 and do that 2000 times Can any good apple script writers out there help me achieve this? Thanks in advance
Mar ’24
How to customize the selected row's color in a Table in SwiftUI
I'm making a macOS app using SwiftUI. I have a Table view. I have selection enabled but I can't find any way to customize the selection color - it's always blue. My table looks something like this: Table(of: MyObj.self, selection: $selectedID, sortOrder: $sortOrder) { TableColumn(Column Name) { obj in // do some custom view } . . . } rows: { Foreach (model.items) { obj in TableRow(obj) } }
3
0
1.4k
Mar ’24
How to reference a button created using three different forEach loops
Hi there, I'm working on an app that provides the user a prompt. They have to select the matching button. These butttons are created in three separate rows using three forEach loops acting on a customised button made from a Struct. ForEach(0..<10) { column in AlphabetButton( gameViewModel: gameViewModel, letter: String(alphabetTop[column]), borderColor: $borderColor.wrappedValue, onTap: buttonTapped) }} alphabetTop is an array storing letters used as the buttons label and value, and there are two other arrays with the other letters. What I'm wondering, is if the user presses a button that doesn't match the prompt. How can I make reference to the button that does match the prompt. For example, I want to make the border of that correct button flash Orange if the wrong button is pressed. I am making a keyboard app as a bit of practise in learning SwiftUI, so any assistance you can provide would be most helpful. One potential solution I've thought of, do I make the buttonTapped function, chec
1
0
761
Feb ’24
Reply to macOS SwiftUI Table Performance Issue
I've commented out much of the code and reduced the table to one column. With approx 1000 items in the table it takes about 900 msec to change the selected item. Measurment is between the time I click on the item and the UI is ready to process the next click. Instruments shows: every time I select an item the foreach loop runs for every row in the table. That accounts for about 200 msec. the remaining portion of the hang is in SwiftUI code. None of my instrumented code is called. I don't know what SwiftUI is doing, but it is doing it slowly.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Feb ’24
Reply to Crashing when going from Compact to Two Over Secondary in UISplitViewController on iPadOS 17
This is something I've been struggling with for some time. The hierarchy of my app makes this harder to diagnose. But like you, it was working fine for years. In my case, this app supported three column-layouts prior to the release of column-based split views. In order to do so, we have a concept of a NestedSplitViewController -- which is a UIViewController that owns a UISplitView. We're running into the same issue with Xcode 15 – and can't seem to pin it down.
Topic: UI Frameworks SubTopic: UIKit Tags:
Feb ’24
NavigationStack not working correctly in sheet
I am currently trying to build a NavigationManager with programmatic navigation. For that I'm using the NavigationPath combined with NavigationDestination. Sadly facing the following issue: navigationDestionation is not being recognised when located in sheet. Im receiving the following message when trying to update the path of the NavigationStack within the sheet. A NavigationLink is presenting a value of type “PathType” but there is no matching navigationDestination declaration visible from the location of the link. The link cannot be activated. Note: Links search for destinations in any surrounding NavigationStack, then within the same column of a NavigationSplitView. Here is some simplified code snipped of the implementation. struct RootView: View { @State private var isPresented: Bool = true var body: some View { Button(Open Modal, action: { self.isPresented.toggle() }) .sheet(isPresented: self.$isPresented, content: { ModalContent() }) } } private struct ModalContent: View { @State private var p
1
0
2.2k
May ’23