Search results for

column

2,061 results found

Post

Replies

Boosts

Views

Activity

Reply to How can I change the background color of a focused item of a NSTableView?
Here is a more simplified example of the app: import SwiftUI struct NSTableViewWrapper: NSViewRepresentable { class Coordinator: NSObject, NSTableViewDataSource, NSTableViewDelegate { var parent: NSTableViewWrapper init(parent: NSTableViewWrapper) { self.parent = parent } func numberOfRows(in tableView: NSTableView) -> Int { 1 } func tableView(_ tableView: NSTableView, viewFor tableColumn: NSTableColumn?, row: Int) -> NSView? { return NSTextField(labelWithString: Item) } func tableView(_ tableView: NSTableView, rowActionsForRow row: Int, edge: NSTableView.RowActionEdge) -> [NSTableViewRowAction] { return [NSTableViewRowAction(style: .destructive, title: Delete) { _, _ in }] } } func makeCoordinator() -> Coordinator { return Coordinator(parent: self) } func makeNSView(context: Context) -> NSScrollView { let scrollView = NSScrollView() let tableView = NSTableView() let column = NSTableColumn(identifier: NSUserInterfaceItemIdentifier(Column)) tableView.addTableColumn(column
Topic: UI Frameworks SubTopic: AppKit Tags:
Mar ’25
Remove bottom border in a row in AppKit's NSTableView
I just made a simple AppKit app, but don't know how to remove borders of rows when they're swiped. SwiftUI's list does not have this problem though. Attaching gif demo and code: import SwiftUI struct NSTableViewWrapper: NSViewRepresentable { @State var data: [String] class Coordinator: NSObject, NSTableViewDataSource, NSTableViewDelegate { var parent: NSTableViewWrapper weak var tableView: NSTableView? init(parent: NSTableViewWrapper) { self.parent = parent } func numberOfRows(in tableView: NSTableView) -> Int { self.tableView = tableView return parent.data.count } func tableView(_ tableView: NSTableView, viewFor tableColumn: NSTableColumn?, row: Int) -> NSView? { let cell = tableView.makeView(withIdentifier: NSUserInterfaceItemIdentifier(Cell), owner: nil) as? NSTextField ?? NSTextField(labelWithString: ) cell.identifier = NSUserInterfaceItemIdentifier(Cell) cell.stringValue = parent.data[row] cell.isBordered = false return cell } func tableView(_ tableView: NSTableView, rowActionsForRow row: Int, edge
Topic: UI Frameworks SubTopic: AppKit Tags:
1
0
214
Mar ’25
Reply to List does not move the view into focused element, when changing it with a keyboard
NSTableView from AppKit works just as expected, while List from SwiftUI does this weird cropping. Here is the code for the NSTableView: import SwiftUI struct NSTableViewWrapper: NSViewRepresentable { class Coordinator: NSObject, NSTableViewDataSource, NSTableViewDelegate { var parent: NSTableViewWrapper init(parent: NSTableViewWrapper) { self.parent = parent } func numberOfRows(in tableView: NSTableView) -> Int { return parent.data.count } func tableView(_ tableView: NSTableView, viewFor tableColumn: NSTableColumn?, row: Int) -> NSView? { let cell = tableView.makeView(withIdentifier: NSUserInterfaceItemIdentifier(Cell), owner: nil) as? NSTextField ?? NSTextField(labelWithString: ) cell.identifier = NSUserInterfaceItemIdentifier(Cell) cell.stringValue = parent.data[row] return cell } } var data: [String] func makeCoordinator() -> Coordinator { return Coordinator(parent: self) } func makeNSView(context: Context) -> NSScrollView { let scrollView = NSScrollView() let tableView = NSTableView() let column
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Mar ’25
I found SwiftUI SF Symbols bug from WWDC24
Summary: At WWDC24, a new transition was introduced by the Apple Design team (.contentTransition(.symbolEffect(.replace))) I was writing a post about it on my LinkedIn (https://www.linkedin.com/in/alex-fila/), and out of curiosity I tried multiple symbols with slashes. Many of them were not well center aligned during a new symbol effect. Some of the examples are: speaker.fill : speaker.slash.fill”, eye.fill : eye.slash.fill”. Please check the attached Swift file for more details and full SwiftUI View with issues. Steps to Reproduce: Create a new IOS App project in XCode. Create a new SwiftUI File. Initiate state variable: @State private var isSpeakerOn = true. Create a new image with transition: Image(systemName: isSpeakerOn ? speaker.fill : speaker.slash.fill) .contentTransition(.symbolEffect(.replace)). 5. Create a switcher or set a timer with a constant variable to toggle isSpeakerOn value (see attachment file). 6. Toggle isSpeakerOn value. 7. Observe the issue (2 symbols are not well center aligned during
2
0
325
Mar ’25
NavigationSplitView hide sidebar toggle button
I'm trying to implement the same UI used by the Settings app on iPad: a split view with two columns that are visible at all times. This code produces the layout i want, but I would like to hide the toggle sidebar visibility button that the system introduces. Is there a SwiftUI API I can use to hide this button? Maybe an alternate way to setup views that tells the system that the button is not necessary? struct SomeView: View { var body: some View { NavigationSplitView( columnVisibility: .constant(.all), sidebar: { Text(sidebar) }, detail: { Text(detail) } ) .navigationSplitViewStyle(.balanced) } }
7
0
8.2k
Mar ’25
Reply to Process with equal instances but unequal identities
IMPORTANT The following contains a lot of implementation details. Don’t encode this knowledge into a product that you ship to a wide range of users. It has changed in the past and will likely change again in the future. Let’s start with the runningboardd man page. That’s not super helpful, but it does at least tell you that it’s responsible for managing processes. It started on iOS and has since moved to macOS. [quote='776288021, jaikiran, /thread/776288, /profile/jaikiran'] I suspect the identity it is talking about is the one explained as designated requirement [in TN3127] [/quote] That’s not the case. Rather, this is an internal identity used by runningboardd to classify the processes it knows about based on how they got started. For example, an application process has a description that starts with app. You can see these littered throughout the system log: type: default time: 13:12:54.328208+0000 process: runningboardd subsystem: com.apple.runningboard category: monitor message: Calculated state for app…
Topic: App & System Services SubTopic: Core OS Tags:
Mar ’25
Reply to "Network Extension" does not appear in the Capability section in Xcode
I recommend that you bookmark the Developer Account Helper > Reference > Supported capabilities (iOS) page (or the equivalent for the actual platform you’re targeting). It has a table that shows which capabilities are available to which team types. I suspect you’re using a Personal Team (the Apple Developer column) and that’s why you can’t use NE. If you are using a Personal Team, be aware that it has other significant limitations. For the details, see Developer > Support > Choosing a Membership. Share and Enjoy — Quinn “The Eskimo!” @ Developer Technical Support @ Apple let myEmail = eskimo + 1 + @ + apple.com
Topic: Code Signing SubTopic: Entitlements Tags:
Mar ’25
Reply to SwiftUI subview .frame ignored on parent view appear, MacOS
[quote='776126021, pikes, /thread/776126, /profile/pikes'] Is there a better way to handle a collapsing subview in an HSplitView? Why is the .frame not respected? [/quote] Have you checkout out inspector? Since you're using a NavigationSplitView, an inspector would present as a trailing column and by default, trailing column inspectors have their presentation state restored by the framework.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Mar ’25
Missing "Download Size" column in "App Store File Sizes" in iTunes Connect
In documentation and online discussions, everyone refers to a Download Size column in the popup that appears when, in iTunes Connect, we click on Activity > [build number] > App Store File Sizes (under Compressed File Size). However, I only have the Installation Size column in my version.Has anyone else experienced this? Does anyone know why?Thanks.
8
0
2.5k
Feb ’17
Table view with dynamic content - is it possible?
Hi, How can I use a Table view to build a data grid for a dynamic set of data? Say, I have a 2D collection of data elements (a matrix, basically) with variable number of columns, and a 1D collection of column labels (a vector). For the sake of simplicity, let's assume that all data elements are Strings. let data: [[String]]; let columnLabels: [String] How can I build TableColumn definitions without key paths? Thanks!
6
0
2.8k
May ’22
Reply to Table view with dynamic content - is it possible?
It's now possible in SwiftUI with TableColumnForEach [1] But don't use it. I tried and I got crashes when reloading data using Observable, I got crashes when changing columns. My app hung and needed killing when switching away from the table view and back. It crashes if there are zero columns. It's also really slow. Unusably so with about 200 rows and 150 columns. I tried with a release build and no difference was noticable. NSTable on the other hand handles everything admirably. [1] https://developer.apple.com/documentation/swiftui/tablecolumnforeach
Topic: UI Frameworks SubTopic: UIKit Tags:
Mar ’25
Exploring VoiceOver Accessibility for UITableView
I’m currently exploring VoiceOver accessibility in iOS and looking for the best way to reduce the number of swipes required to navigate a UITableView. I’ve come across a couple of potential solutions but am unsure which is preferred. Solution 1: Grouping Subviews in Each Cell Combine all subviews inside a UITableViewCell into a single accessibility element. Provide a concise and meaningful accessibilityLabel. Use custom actions (UIAccessibilityCustomAction) or accessibilityActivationPoint to handle interactions on specific elements within the cell. Solution 2: Using UIAccessibilityContainerDataTableCell & UIAccessibilityContainerDataTable Implement UIAccessibilityContainerDataTable for structured table navigation. Make each cell conform to UIAccessibilityContainerDataTableCell, defining its row and column positions. However, I’m finding this approach a bit complex, and I need guidance on properly implementing these protocols. Additionally, in my case, VoiceOver is not navigating to Section 2—I’m
3
0
681
Mar ’25
Reply to Tensor Flow Metal 1.2.0 on M2 Fails to converge on common toy models
@txoof import numpy as np import pandas as pd import matplotlib.pyplot as plt from sklearn.preprocessing import MinMaxScaler from tensorflow.keras.models import Sequential from tensorflow.keras.layers import Input, LSTM, Dense, Dropout import tensorflow as tf from tensorflow.keras.callbacks import EarlyStopping import logging # Suppress warnings logging.getLogger(tensorflow).setLevel(logging.ERROR) logging.getLogger(urllib3).setLevel(logging.ERROR) # Verify GPU availability physical_devices = tf.config.list_physical_devices('GPU') print(fGPUs Available: {bool(physical_devices)}) # Load data with flexible features def load_data(filename, features=['Close']): df = pd.read_csv(filename, parse_dates=['DateTime']) df['DateTime'] = pd.to_datetime(df['DateTime'], format='%Y.%m.%d %H:%M:%S') required_columns = ['DateTime'] + features df_cleaned = df[required_columns].dropna().sort_values('DateTime') if df_cleaned.empty: raise ValueError(Dataset is empty after cleaning!) return df_cleaned, features # Example using mul
Topic: Machine Learning & AI SubTopic: Core ML Tags:
Mar ’25
Reply to NavigationSplitView sidebar animation lag with minimum width
@captmagnus You should try using navigationSplitViewColumnWidth(min:ideal:max:) to set the preferred width for the column and .windowResizability(.contentSize) for the resizability strategy. For example: WindowGroup { ContentView() } .windowResizability(.contentSize) struct ContentView: View { @State private var columnVisibility = NavigationSplitViewVisibility.all var body: some View { NavigationSplitView(columnVisibility: $columnVisibility) { Text(Sidebar) .navigationSplitViewColumnWidth(min: 300, ideal: 300) } detail: { Text(Detail) .navigationSplitViewColumnWidth( min: 600, ideal: 600, max: 900) } .onChange(of: columnVisibility) { print(columnVisibility) } } } It's also worth filling a bug report for the animation hitch. Bug Reporting: How and Why? has tips on creating your bug report. Post the FB number here once you file the bug report.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Mar ’25
Adding ‘Test diamonds’ to Xcode with a macro
I'm currently writing a macro which outputs Swift Testing code: // Macro code ... @MainActor @SnapshotSuite struct MySuite { func makeView() -> some View { Text(a view) } } which expands to... // Expanded macro code ... @MainActor @Suite struct _GeneratedSnapshotSuite { @MainActor @Test(.tags(.snapshots)) func assertSnapshotMakeView() async throws { let generator = SnapshotGenerator( testName: makeView, traits: [ .theme(.all), .sizes(devices: .iPhoneX, fitting: .widthAndHeight), .record(false), ], configuration: .none, makeValue: { MySuite().makeView() }, fileID: #fileID, filePath: #filePath, line: 108, column: 5 ) await __assertSnapshot(generator: generator) } } In short, this macro creates snapshot tests from a function. This all works but I'm finding a couple of limitations, potentially with how Macros are expanded in Swift. Xcode diamonds are not visible The snapshots tag isn't discovered There are a couple of things worth noting though: The suites and tests are discovered in Xcode's Test Navi
1
0
281
Mar ’25