Search results for

column

2,071 results found

Post

Replies

Boosts

Views

Activity

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
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
supplementarySidebarTrackingSeparatorItemIdentifier
I'm developing an iOS 14 Catalyst app and I'm trying to setup the window toolbar. I created a NSToolbar and assigned to the scene window titlebar property. var toolbarDelegate = ToolbarDelegate() func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { #if targetEnvironment(macCatalyst) guard let windowScene = scene as? UIWindowScene else { return } let toolbar = NSToolbar(identifier: main) toolbar.delegate = toolbarDelegate toolbar.displayMode = .iconOnly if let titlebar = windowScene.titlebar { titlebar.toolbar = toolbar titlebar.toolbarStyle = .unified titlebar.titleVisibility = .hidden } #endif } I then assigned some items to the toolbar via the toolbarDefaultItemIdentifiers delegate method. func toolbarDefaultItemIdentifiers(_ toolbar: NSToolbar) -> [NSToolbarItem.Identifier] { let identifiers: [NSToolbarItem.Identifier] = [ .toggleSidebar, .print, .flexibleSpace, .print ] return identifiers } This work as expected. Now, let's say that
1
0
1.6k
Aug ’24
NavigationLink double click on List for MacOS
I need the whole row (including space without content) within the NavigationLink to accept a double click gesture as well as the standard single click that will activate the row and display in the Detail View. If I use an onTapGesture(count:2) or simultaneousGesture(TapGesture(count:2) it doesn't quite work as expected. The content of the row will trigger the double click action but not the normal single click behaviour of the NavigationLink and requires clicking in an unpopulated area of the row. I have tried another onTapGesture with count:1 after the first to explicitly tell it to display the detail view which works but does not highlight the now selected row. I'd like to be able to double or single click anywhere in the list row, with a single click highlighting the row and displaying the detail view and a double click should do the same as the single click plus trigger an action. Similar to how Finder's column view works. If anyone could help with this it would be greatly appreciated.
3
0
1.3k
Apr ’22
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
iOS18 beta enterprise certificate trust issue
When I trusted my certificate in 'Setting'->'VPN & Device Management', my device reboot automatically. After reboot, it showed that developer of My Team is not trusted in this iPhone, but the app is verified in the second column. The UI looks like: iOS18 beta: First Col: Trust My Team Second Col: MyApp Verified Other versions: First Col: Delete App Second Col: MyApp Verified What's more, my app has plugins(extensions), my app can run normally while the extension is not able to be pulled up on iOS18 beta.
2
0
1.7k
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
SwiftUI Scrollview with both axes enabled produces layout mess
The Problem In our brand new SwiftUI project (Multiplatform app for iPhone, iPad and Mac) we are using a ScrollView with both .horizontal and .vertical axes enabled. In the end it all looks like a spreadsheet. Inside of ScrollView we are using LazyVStack with pinnedViews: [.sectionHeaders, .sectionFooters]. All Footer, Header and the content cells are wrapped into a LazyHStack each. The lazy stacks are needed due to performance reasones when rows and columns are growing. And this exactly seems to be the problem. ScrollView produces a real layout mess when scrolling in both axes at the same time. Tested Remedies I tried several workarounds with no success. We built our own lazy loading horizontal stack view which shows only the cells whose indexes are in the visible frame of the scrollview, and which sets dynamic calculated leading and trailing padding. I tried the Introspect for SwiftUI packacke to set usesPredominantAxisScrolling for macOS and isDirectionalLockEnabled for iOS. None of this works as
5
0
5.5k
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
631
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
1k
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
711
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
Really High Energy Use
I'm developing an app where users can select items to add to a screen, similar to creating a Canva presentation or choosing blocks in Minecraft. However, I'm encountering an issue with energy usage. When users click the arrows to browse different items, the energy use spikes significantly. Although it returns to normal after a while, continuous clicking causes the energy use to skyrocket. The images I'm using are 500x500 pixels. Ideally, I would like to avoid caching all the images, as the app might have up to 500 items and caching them all would consume too much memory. I have tried numerous way to avoid this but I just can’t seem to make it work. Would anyone know how to avoid such problem? I have included a picture of the energy use when just opened, and one after like 10 seconds of continuously clicking on an arrow to see more items. Also a picture of how the app looks. struct ContentView: View { struct babyBackground { var littleImage = } @State var firstSet: [babyBackground] = [ babyBackground(littleIm
1
0
799
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
487
Jul ’24