Search results for

column

2,071 results found

Post

Replies

Boosts

Views

Activity

Reply to Unexpected Transparency in .fullScreenCover(isPresented:) Background in SwiftUI iOS 18 Beta
@marudavid I am not able to reproduce your issue using the following sample code. There is a default background color always on both Xcode 15 and Xcode 16.1 Beta. It is possible you are using some type of ViewModifier that is causing this. The following works fine. import SwiftUI struct Icon: Identifiable { var id: String var color: Color } struct ContentView: View { let icons = [ Icon(id: figure.badminton, color: .red), Icon(id: figure.fencing, color: .orange), Icon(id: figure.gymnastics, color: .green), Icon(id: figure.indoor.cycle, color: .blue), Icon(id: figure.outdoor.cycle, color: .purple), Icon(id: figure.rower, color: .indigo), ] @State private var selected: Icon? var body: some View { LazyVGrid(columns: [.init(.adaptive(minimum: 100, maximum: 300))]) { ForEach(icons) { icon in Button { selected = icon } label: { Image(systemName: icon.id) } .foregroundStyle(icon.color.gradient) .font(.system(size: 100)) } } .fullScreenCover(item: $selected, content: { icon in DestinationView(icon: icon, anim
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Aug ’24
.presentationBackground ViewModifier doesn’t render correctly when used with new zoom transitions API
In SwiftUI, when using the .presentationBackground modifier in combination with the new zoom transitions API, the background does not interpolate or render correctly during or after the transition. This issue is observed when using .fullScreenCover and .sheet with .presentationBackground modifier set for the presenting content. In the case of using sheet, the modifier does not work at all, and in the case of using .fullScreenCover, the modifier does render the background correctly, but only after a delay. Sample code: struct Icon: Identifiable { var id: String var color: Color } struct ContentView: View { let icons = [ Icon(id: figure.badminton, color: .red), Icon(id: figure.fencing, color: .orange), Icon(id: figure.gymnastics, color: .green), Icon(id: figure.indoor.cycle, color: .blue), Icon(id: figure.outdoor.cycle, color: .purple), Icon(id: figure.rower, color: .indigo), ] @Namespace var animation @State private var selected: Icon? var body: some View { LazyVGrid(columns: [.init(.adaptive(minimum:
0
0
369
Aug ’24
iPadOS 18 TabView conflicts with NavigationSplitView
If you use the new TabView in conjunction with .tabViewStyle(.sidebarAdaptable) and have a NavigationSplitView in the tabs, the result is a very confusing user experience. When the TabView is displayed as tabs, there are two sidebar buttons. The left one closes/opens the sidebar of the view of the selected tab. The sidebar button of the Top-TabView closes/opens the sidebar for customizing the tabbar. However, this sidebar overlays the sidebar of the selected tab. To be able to use the underlying sidebar again, the user must actively close the TabView sidebar again (turn it into the top tabbar) Has anyone found ways to improve this behavior, or is this wrong by design? My expected behavior would be: If you use the new TabView with .tabViewStyle(.sidebarAdaptable) and have a two column NavigationSplitView in a tab, it automatically becomes a three column view when the top tabbar becomes a sidebar. import SwiftUI struct ContentView: View { var body: some View { TabView { Tab(Home, systemImage:
5
0
1.4k
Aug ’24
Payment not completed error
I am using a sandbox account, and I set United States in the region column (Settings>General>Language & Region>Region to US). I added test cards like (American Express and Visa) and the cards added successfully. But I am trying to pay then I get an error like Payment Not Completed. Note: I am trying from India. Please let me know what exactly i am doing mistake here Following code i am using. function onApplePayButtonClicked() { if (!ApplePaySession) { return; } // Define ApplePayPaymentRequest const request = { countryCode: US, currencyCode: USD, merchantCapabilities: [ supports3DS ], supportedNetworks: [ visa, masterCard, amex, discover ], total: { label: Demo (Card is not charged.), type: final, amount: 1.99 } }; // Create ApplePaySession const session = new ApplePaySession(3, request); session.onvalidatemerchant = event => { // Call your own server to request a new merchant session. var merchantSession = merchantValidation(event.validationURL); session.completeMerchantValidation(m
1
0
1.1k
Aug ’24
Reply to Swiftui Table statement conditional table columns
So here is all the code Table(artViewModel.filteredArtPieces, selection: $selection, sortOrder: $sortOrder, columnCustomization: $columnCustomization) { TableColumn(Image) { artPiece in if let imageData = artPiece.artImage.first, let image = UIImage(data: imageData!) { Image(uiImage: image) .resizable() .frame(width: 50, height: 50) } else { Image(systemName: photo) .resizable() .frame(width: 50, height: 50) } } .customizationID(Image) TableColumn(Name, value: .artName) .customizationID(Name) TableColumn (Art ID, value: .artPieceID) { artPiece in Text(String(artPiece.artPieceID)) } .customizationID(Art ID) TableColumn (Price, value: .artPrice) { artPiece in Text (formatMoneyDouble(artPiece.artPrice)) } .customizationID(Price) TableColumn (Date, value: .artcreateDate) { artPiece in Text (artPiece.artcreateDate, style: .date) } // .resizable() .customizationID(Date) TableColumn(Artist, value: .artistName) .customizationID(Artist) TableColumn(Meduim, value: .artMedium) .customizationID(Meduim) TableColumn(Type,
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Aug ’24
Swiftui Table statement conditional table columns
Is it possible to have conditional table columns for a swifui Table statement? Like for this code TableColumn(Image) { artPiece in if let imageData = artPiece.artImage.first, let image = UIImage(data: imageData!) { Image(uiImage: image) .resizable() .frame(width: 50, height: 50) } else { Image(systemName: photo) .resizable() .frame(width: 50, height: 50) } } .customizationID(Image) TableColumn(Name, value: .artName) .customizationID(Name) TableColumn (Art ID, value: .artPieceID) { artPiece in Text(String(artPiece.artPieceID)) } .customizationID(Art ID) have a conditional TableColumn for this part of my SWIFTDATA model var artDefinedFields: [ArtDefinedFields] = [] or if I change the variable string array to this var artDefinedFields: [ArtDefinedFields] = Array(repeating: ArtDefinedFields(), count: 10), initialize the array with None and only create a TableColumn when there is aArtDeginedFields value other than None
3
0
654
Aug ’24
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.2k
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
446
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
611
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