I'm importing a csv file of 299 rows and creating a subset by filtering on one column value (24 rows). I want to Chart just the filtered values. However, when I print one column I get values from the original dataFrame. Any suggestions? Thanks, David The code: import SwiftUI import Charts import TabularData struct DataPoint: Identifiable { var id = UUID() // This makes it conform to Identifiable var date: Date var value: Double } struct ContentView: View { @State private var dataPoints: [DataPoint] = [] var body: some View { Text(Hello) Chart { ForEach(dataPoints) { dataPoint in PointMark( x: .value(Date, dataPoint.date), y: .value(Value, dataPoint.value) ) } } .frame(height: 300) .padding() .onAppear(perform: loadData) } func loadData() { print(In Loading Data) // Load the CSV file if let url = Bundle.main.url(forResource: observations, withExtension: csv) { do { let options = CSVReadingOptions(hasHeaderRow: true, delimiter: ,) var data0 = try DataFrame(contentsOfCSVFile: url, options: opti
Search results for
column
2,046 results found
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
I have a grid setup where I'm displaying multiple images which is working fine. Images are ordered by the date they're added, newest to oldest. I'm trying to set it up so that the user can change the sort order themselves but am having trouble getting the view to update. I'm setting the fetch request using oldest to newest as default when initialising the view, then when its appears updating the sort descriptor struct ProjectImagesListView: View { @Environment(.managedObjectContext) private var viewContext var project : Project let columns = [ GridItem(.flexible()), GridItem(.flexible()), GridItem(.flexible()), GridItem(.flexible()) ] @FetchRequest var pictures: FetchedResults var body: some View { ScrollView { LazyVGrid(columns: columns) { ForEach(pictures) { picture in NavigationLink(destination: ProjectImageDetailView(picture: picture)) { if let pictureData = picture.pictureThumbnailData, let uiImage = UIImage(data: pictureData) { Image(uiImage: uiImage) .resizable() .scaledToFit
Topic:
UI Frameworks
SubTopic:
SwiftUI
Hi I am building a simple multi column CollectionView here and trying to add 3 cell in a row. Well, in short the column and rows looks all fine if I comment the below code. which is no image and text assigned to cells. let framework = list[indexPath.item] cell.configure(framework) However, once uncommented, only a single cell is displayed per row and the image doesn't seem to be resizing automatically. Can you please advise. Below is the ViewController. import UIKit class FrameworkListViewController: UIViewController { @IBOutlet weak var collectionView: UICollectionView! let list: [AppleFramework] = AppleFramework.list override func viewDidLoad() { super.viewDidLoad() collectionView.dataSource = self collectionView.delegate = self } } extension FrameworkListViewController: UICollectionViewDataSource { func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { return list.count } func collectionView(_ collectionView: UICollectionView, cellForItemA
Topic:
UI Frameworks
SubTopic:
UIKit
Has anyone else noticed that macOS Sequoia 15.5 has a regression in SwiftUI Table scrolling performance? I have complex Tables in a SwiftUI app and they scroll adequately on macOS 15.4.1 but hang, beachball, and stutter while scrolling on macOS 15.5. The exact same build is running in both cases. (I've even reduced the table to three simple columns of text and STILL fail to get entirely smooth scrolling on macOS 15.5.) It's like someone just fundamentally broke Table on macOS. Has anyone else encountered this?
Topic:
UI Frameworks
SubTopic:
SwiftUI
Bringing my iPad app to Mac Catalyst as iPad idiom. Primary interface is a UISplitViewController. Two things I think are bugs unless someone replies with a fix. SplitViewController is setup in two column with left column as sidebar: split.setViewController(primary, for: .primary) split.setViewController(secondary, for: .secondary) split.preferredDisplayMode = .oneBesideSecondary split.preferredSplitBehavior = .tile split.presentsWithGesture = true #if targetEnvironment(macCatalyst) split.primaryBackgroundStyle = .sidebar split.displayModeButtonVisibility = .never #endif The displayMode button aligns vertically with the navigation bar and below the 3 window control buttons (close, minimize, full screen), whereas on other macOS apps using SplitViewController such as Apple Notes app, the displayMode button aligns vertically and just to the right of the the 3 window control buttons (close, minimize, full screen). I downloaded the Apple Example app called Menus that is supposed to be a prime exam
Hi Ziqiao, thank you for the suggestion. I tested using exclusionPaths instead and interestingly, the bug still occurs! I can send you the version of the project that uses exclusionPaths instead of different container sizes if you'd like to compile/run and see. For convenience, here is the changed code in question with exclusionPaths: setupLayout() changes to: func setupLayout() { var index = 0 for textViewData in PreviewTestData.textViewDataArray { self.ensureContainer(with: textViewData.frame.size, exclusionPath: textViewData.exclusionPath, at: index) index += 1 } } ensureContainer(...) changes to: @discardableResult private func ensureContainer(with size: CGSize, exclusionPath: NSBezierPath?, at index: Int) -> NSTextContainer { precondition(index >= 0 && index <= layoutManager.textContainers.count) if index == layoutManager.textContainers.count { let container = NSTextContainer(size: size) container.widthTracksTextView = false container.heightTracksTextView = false container.lineFragmentPa
Topic:
UI Frameworks
SubTopic:
AppKit
Tags:
Hi Ziqiao, thank you for looking at the project and for the feedback. My word processing app requires containers of differing width in order to fulfill its core functions. I know Apple's own Pages app supports documents that flow continuously with varying numbers of columns with widths that the user can set arbitrarily. And Apple's own documentation of NSLayoutManager / NSTextContainer mentions multi-column text (https://developer.apple.com/library/archive/documentation/TextFonts/Conceptual/CocoaTextArchitecture/TextSystemArchitecture/ArchitectureOverview.html#//apple_ref/doc/uid/TP40009459-CH7-SW4). Text Kit 2 doesn't yet support more than one text container, so that's not an option for me yet and I can't migrate to Text Kit 2 until they support container / page breaks. I would love for this issue to be elevated. This is an actual and serious bug in Text Kit!
Topic:
UI Frameworks
SubTopic:
AppKit
Tags:
hi When analyzing our game using Instruments, I've always been confused about the two items Drawable Present and Drawable Presented in the GPU column. The timing of Drawable Present seems to be when the CPU layer calls commandbuffer:present, rather than when the actual encoding is completed on the GPU. Also, what does drawable presented specifically mean? In our case, when a CPU stall occurs, it appears that the vsync interval changes in the next frame, and a surface that has already been calculated is not displayed. Why is this happening?
MusicKit isn’t gated by an entitlement. That’s why, when you enable it on an App ID, you enable it in the App Services column rather than the Capabilities column. Enabling it there grants that App ID access to that service without needing your app to be signed with any entitlement. Share and Enjoy — Quinn “The Eskimo!” @ Developer Technical Support @ Apple let myEmail = eskimo + 1 + @ + apple.com
Topic:
Code Signing
SubTopic:
Certificates, Identifiers & Profiles
Tags:
I'm sharing the code that parses my preview data here. I'm using an NSViewRepresentable and the call to - paginator.exhibitTheBug() - is within makeNSView(...). But note that this bug occurs whether I call paginator.exhibitTheBug() there, or in updateNSView(...), or from textStorage(:didProcessEditing:...) via a DispatchQueue.main.async closure. I.e., I thought at first that it was a threading/runtime issue, but it's not. class Paginator { let textStorage: NSTextStorage let layoutManager: NSLayoutManager init(textStorage: NSTextStorage, layoutManager: NSLayoutManager) { self.textStorage = textStorage self.layoutManager = layoutManager self.setupLayout() } /// Runs the functions that will exhibit the bug. func exhibitTheBug() { // Get char range to measure in container. let characterRangeToTest = self.getCharacterRangeOfFirstColumnType() // The bug occurs in this call: testMeasurement(for: characterRangeToTest) } /// Returns the effective range of the text storage over which the column type (`NSAttrib
Topic:
UI Frameworks
SubTopic:
AppKit
Tags:
I have tried multiple time through multiple channels and you have yet to respond to my request. I am developing an App on xcode APP Bundle ID: garymdmd.MediaPace Apple ID: 6740823496 Apple has granted me distribution use of the Family Control/Screentime module for my main app. According to your engineer's post here: https://developer.apple.com/forums/thread/764919 That permission should be extended to your extensions that are part of the app. When you try to setup the extension identifiers they do not show the added capabilities column that sow sup when getting permission for the main app so you are not able to endow the extension with these permissions which seem to be needed to work with the app. I am trying to add these bundle identifier extensions: garymdmd.MediaPace.ScreenTimeMonitorDuo garymdmd.MediaPace.DeviceActivityReport Can you please tell me how to get this to work or to add permissions to these extensions. I have sent in the request form multiple times (here - https://developer.apple.com
I'd like to persist the path on a sidebar selection, so when user comes back to the sidebar selection, they land where they were before. Unexpectedly, the path gets cleared when sidebarSelection is changed from the NavigationStack that uses the path to something else. Is this an intended behavior? How to workaround it? Using TabView is one way, but TabView has its own problems, so I'm wondering if there's a solution within NavigationSplitView first. Here is a minimal reproduce of the issue: struct Home2: View { private enum SidebarSelection: CaseIterable, Identifiable { var id: Self { self } case files, tags } @State private var sidebarSelection: SidebarSelection? = .files @State private var path: [Int] = [] var body: some View { NavigationSplitView { List(SidebarSelection.allCases, selection: $sidebarSelection) { selection in switch selection { case .files: Label(Files, image: custom.square.stack) case .tags: Label(Tags, systemImage: grid) } } } detail: { switch sidebarSelection { case .files: NavigationStac
Alright I'm back and I figured it out. Here my findings as it relates to my use case of trying to get screenshots I have saved as PNG attachments during UI tests: The .xcresult bundle uses a custom storage format for attachments and other test artifacts Within the result bundle's Data subdirectory, Image data (and presumably other attachment data) is stored in files whose names appear to be base64 encoded keys prefixed with data. These files are compressed using zstd. You can confirm this by running the file command on them. Direct decompression of these files using zstd reveals PNG image data. Hurray! As mentioned before, the filenames which are prefixed with data contain base64-encoded identifiers. The database.sqlite3 database which is present in the result bundle contains a table called Attachments which has rows for each attachment. Those rows have columns with the filename you provided the attachment in your test, as well as the encoded key which is appended to data to form the filename. Those
Topic:
Developer Tools & Services
SubTopic:
Xcode
Tags:
We are preparing builds using Xcode 16.0 given we have a large set of users on iOS 12. Now we have doubts wether we will run into issues if we ship using it (even if it compiles, archives and uploads successfully) given the table columns and content has changed since the last time we checked this table: https://developer.apple.com/support/xcode/. 1- Is the Deployment Targets range for Xcode 16 value correct for iOS? (On the 24th of February it had iOS 12-18, now it has iOS 15-18) 2- Are we OK to ship for iOS 12 using xcode 16.3? Thanks, Joao Garcia
@darkpaw: I have included snippet of my code below as reference. The 'width' parameter can be changed later ... However, same error would still show up: The compiler is unable to type-check this expression in reasonable time; try breaking up the expression into distinct sub-expressions ... struct ViewShelter: View { // TH: helps safely update UI. @State private var rowEven: Bool = true @State private var pathBlocked: Bool = true @State private var borderColorBackEnd: Color = Color.black @State private var borderColorBackEndOperation: Color = Color.black var body: some View { VStack (alignment: .leading){ ForEach(0...(ViewConstants.TARGET_STRING_BACK_0_DIMENSION-1), id:.self) { row in if let row_x = shelterViewModel.getShelter(row: row) as [RecommendationEntity]? { if let row_x_count = row_x.count as Int? { if row_x_count > 0 { let row_x_columns = Array(0...row_x_count-1) GeometryReader { geometry in HStack(alignment: .center) { ForEach(row_x_columns, id:.self){ column in self.rowEven = (row%2==0)
Topic:
Developer Tools & Services
SubTopic:
Xcode