Search results for

column

2,048 results found

Post

Replies

Boosts

Views

Activity

CSV File Load Into Swift
Hi, I am fairly new Xcode/Swift and am trying to load a CSV File for use in my development. I have placed the CSV file in my Assets folder but when I try to create my Data Model and load the CSV file. I run into the error: No exact matches in call to initializer. Below is the code. I have attached CSV File. Any help fixing this error would be greatly appreciated. Thanks in advance for your help. Brian Hospital_Demographic_Data_Sample.csv import Foundation import CSV struct HospitalData: Codable { let providerNumber: String let hospital: String let address: String let city: String let state: String let zip: String let wageIndex: Double let caseMix: Double let averageCharge: Double let discharges: Int let totalCharges: Double let adjTotalCharges: Double // Add other fields as needed based on the columns in your CSV file } func loadHospitalData() -> [HospitalData]? { guard let filePath = Bundle.main.path(forResource: Hospital_Demographic_Data, ofType: csv) else { print(File not found) return nil } do
3
0
1.1k
Aug ’24
UICollectionViewLayout unexpected animations when cells contain AutoLayout views with custom height
The code for the issue is attached below. Hello, I am trying to implement a custom UICollectionViewLayout that does the following: Everything works great for the most part, however I have encountered some unexpected animations when applying a new snapshot: As you can see, any cell that contains a custom view with a height set with AutoLayout is scaled vertically before animating to it's intended height. Here is a simple Xcode project that demonstrates the issue. Tap on the plus sign in the top right corner and watch the cells. Example project: https://we.tl/t-9Y25NHzxiI Custom UICollectionViewLayout code: final class CustomLayout: UICollectionViewLayout { struct PMCardContainerLayoutCell: Equatable { var column: Int var row: Int } // Configurable properties public var numberOfColumns: Int = 6 public var cellHeight: Double = 100 public var cellSpacing: Double = 20 public var rowSpacing: Double = 20 public var sectionInsets: NSDirectionalEdgeInsets = .zero public var layoutAttributes: [IndexPath: UICol
Topic: UI Frameworks SubTopic: UIKit Tags:
1
0
406
Aug ’24
Promotional Offer ID column is empty in Subscriber report for redeemed offer code
When redeeming a custom offer code, I'm not able to see the actual offer code ID in the Subscriber report - only the subscription offer name is present. I'm going off of the documentation for the Promotional Offer ID column: A code that you create for customers to enter and redeem the subscription offer. https://developer.apple.com/help/app-store-connect/reference/subscriber-report Is the documentation wrong? How are we supposed to measure the performance of our offer codes beyond the initial redemption? For example, with the offer name I can see how my Holiday Promos offer is doing but can't see the actual performance of BLACKFRIDAY30 vs MOTHERSDAY30.
1
0
551
Aug ’24
Reply to VoIP push notifications may not be received
I tried grep apsd[131:, 15:45:11.000+0900,15:34:22.998+0900, and 09:06:19.991+0900 for *.txt *.log in all sysdiagnoses, but there were no hits. How can I read sysdiagnose? Do I need to do any further processing on the resulting files after decompress tar? Also, is it OK for developers to read sysdiagnose? A sysdiagnose archive is a standard zip archive with a bunch of files it. Of those files, the largest and most useful file is by FAR the file named system_logs.logarchive. In the vast majority of cases, sysdiagnose analysis actually means open the console logarchive and try to figure out what happened. The post Your Friend the System Log has some good background on how else that file can be processed and manipulated but most of the time you'll be opening an viewing the file with Console.app. That's what will open it by default if you just double click on the archive. The actual analysis process isn't easy to quickly summarize, as it relies as much on becoming familiar with how the system operates and logs, a
Jul ’24
iOS 18 on iPad not honouring default 'Send from' account
Running iOS 18 beta on iPad 9th Gen. I have two email accounts set up in Mail - an iCloud account which is the default account in 'Settings>Apps>Mail>Default Account'. I also have a Gmail account - which gets most of my mailing list, digests and general 'junk' etc. I use the Mail app & the 'All inboxes' view to read my emails on my iPad. I want to send all new messages from my iCloud account but, despite it being the default, this does not happen. Whenever I start a new message, the sending account selected depends on the highlighted message in the left column. So, when I start a new email to my wife, if I happen to have a mailing list message selected from my Gmail account, the email gets sent from my Gmail address. Unfortunately I have more mail sent to my Gmail account than my iCloud so it is more likely that the non-default account is chosen. On macOS, the default sending address is honoured whatever email is selected. This is inconsistent behaviour between the two systems.
0
0
381
Jul ’24
No place to update license agreement
When I login to my Dev account, I get a banner that says The updated Apple Developer Program License Agreement needs to be reviewed. In order to update your existing apps and submit new apps to the App Store, the Account Holder must review and accept the updated agreement. However, when I go to Agreements, Tax, and Banking, I see both Free Apps and Paid Apps agreement, but when I click on View, there's nothing for me to accept. It's a pop-up window with a list of countries and a button at the end that says Close. And that's it. No other action is possible. No other option either under the Action column.
1
0
600
Jul ’24
Photos Picker Selection
Hi! I am having a bit of trouble with the Photos Picker. In my app, users are able to select photos to appear in a grid, right in the app. I am using the new Photos Picker with SwiftUI. I want to be able to have my users select the images after they have been added to the View. So I want there to be a select button in the top toolbar on the leading side, and then once the user hits the select button, they can select the photos they want to remove on the grid, just like in the photos app, and then where the button to add photos originally is, there will be a trash icon to remove the selected photos from the grid. How would I do this? I have attached my code below for my view, as well as my PhotoPicker: import PhotosUI struct LifestyleImagePicker: View { @StateObject var imagePicker = ImagePicker() @State private var showingDetail = false @State private var selectedIndex = 0 @State private var isSelecting = false @State private var isAddingPhoto = false let columns = [GridItem(.adaptive(minimum: 100))]
1
0
988
Jul ’24
UICollectionView
I have 12 cells in a collection view. I am trying to find Swift code to make it display (4 rows x 3 columns) when the device is portrait, and then (2 rows by 6 columns) when in landscape. I need each cell to evenly layout within the view and to fill it.
Topic: Design SubTopic: General
0
0
415
Jul ’24
Reply to -34018 A required entitlement isn't present. from command line swift program and more
[quote='795793022, alfred_eisenberg, /thread/759481?answerId=795793022#795793022, /profile/alfred_eisenberg'] I am trying to create/manage identities. [/quote] Thanks for confirming that. [quote='795793022, alfred_eisenberg, /thread/759481?answerId=795793022#795793022, /profile/alfred_eisenberg'] it seems that certs in this keychain aren't visible with the keychain access app or apparently security find-certificate [/quote] Yep. Both of those are a common source of confusion, which I call out in the User interface section of TN3137. I usually work around this by adding a small test UI to my app that lets me do keychain-related stuff, like dump all the items in my keychain access group, delete those items, and so on. In terms of how you handle multiple certificates for the same key, the trick here is to work in ‘identity space’. If there are multiple certificates for the same key, you’ll get an identity for each one. It’s trivial to get the certificate and key from each identity (SecIdentityCopyCertificate and
Topic: Privacy & Security SubTopic: General Tags:
Jul ’24
iPadOS 18 TabView / NavigationSplitView title
I have a TabView with individual tabs containing NavigationSplitViews. On iPadOS 18, when moving the new UI into a sidebar, the title of the first column in the current split view randomly spins its way in and out of view. Is this just a beta bug, or am I doing something wrong? Hard to convey without a recording, but hopefully the screenshots will show what I mean. Thanks.
1
0
665
Jul ’24
SwiftUI hierarchical table - how to control which column contains expander arrows
I have a SwiftUI macOS hierarchical table with 'children' initializer argument. Everything is working fine but I'd like to have expander arrows in different column. TableColumn definition order doesn't seem to have any effect nor has the order of properties in the model. Is there a way how to define which column should contain expander arrows?
0
0
297
Jul ’24
SwiftUI: View is not rendered properly
Problem: When clicking on an item, it will be (un-)completed. When it's completed then ChildView should show GroupsView. However, that's not the case. The logs are like this: init, group Fruits - items not completed false - showItems false body, group Fruits - items not completed false - showItems true init, group Fruits - items not completed false - showItems false init, group Fruits - items not completed false - showItems false import SwiftUI import SwiftData @main struct MainApp: App { var body: some Scene { WindowGroup { SomeView() } .modelContainer(appContainer) } } struct SomeView: View { @Query private var items: [AItem] var body: some View { ParentView(items: items) } } struct ParentView: View { private var groupedItems: [GroupedAItems] = [] init(items: [AItem]) { Dictionary(grouping: items) { $0.categoryName } .forEach { let groupedItems = GroupedAItems(categoryName: $0.key, items: $0.value) self.groupedItems.append(groupedItems) } } var body: some View { ScrollView { VStack(spacing: 15) { ForEach(gr
1
0
467
Jul ’24