Hi, i´m trying to get a menu with three rows. The top one should be a HStack with three RoundedRectangle (Red, Yellow and Green). The second row and the third one (both separated with a Divider from the top one) are for edit and delete. But I get five rows, three empty rows plus the edit row and the delete row. The three first rows are empty but they execute the moveTask function correctly. I don't know how to solve this. Can anybody help please? struct TaskView: View { @EnvironmentObject var viewModel: BoardViewModel @EnvironmentObject var languageManager: LanguageManager @State private var isEditing = false let task: Task var body: some View { HStack(alignment: .center, spacing: 8) { Text(task.title) .font(.system(size: 16, weight: .medium)) .foregroundColor(.primary) .lineLimit(4) .multilineTextAlignment(.leading) .fixedSize(horizontal: false, vertical: true) Spacer(minLength: 0) Menu { ColorButtonsView(task: task, viewModel: viewModel) Divider() Button(action: { self.isEditing = true }) { Label(languageMa
Search results for
column
2,048 results found
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
Ditto here. All the other advice on the subject of struct-typed model attributes asserts the struct must be Codable and it stored in a single column. The evidence shows the struct's properties are stored as individual columns, spreading the structure out and using some truly unexpected Encoder/Decoder that's not JSON. For instance, I defined struct ComplexNumber: Codable { var real: Double var imaginary: Double } and @Model final class Item { var timestamp: Date var number1: ComplexNumber var number2: ComplexNumber and got this in SQLite: This works fine when fetching the records, but in my app it fails to decode when some of the struct's properties are Optional. I can write decoder() to deal with the optionals, but apparently SwiftData's Decoder can't cope. I suppose there's some similar limitation for Dictionary properties.
Topic:
App & System Services
SubTopic:
iCloud & Data
Tags:
[quote='763281021, aynas, /thread/763281, /profile/aynas'] I wanted to get my hands dirty with objective-c [/quote] You have chosen a very difficult task for My First Objective-C Project™ (-: Specifically… [quote='763281021, aynas, /thread/763281, /profile/aynas'] I created a simple command line project with xcode and tried to load this extension [/quote] That’s not supported. In general, only the NE provider’s container app can configure the NE provider. [quote='763281021, aynas, /thread/763281, /profile/aynas'] I don't have a developer license yet [/quote] That’s a showstopper. If you’re using a Personal Team — aka free provisioning — you can only use a limited set of capabilities. See the Apple Developer column in Developer Account Help > Reference > Supported capabilities (macOS). Notably, Network Extension is not on that list. Share and Enjoy — Quinn “The Eskimo!” @ Developer Technical Support @ Apple let myEmail = eskimo + 1 + @ + apple.com
Topic:
App & System Services
SubTopic:
Networking
Tags:
Try this: In Script Editor, create a new script like so: display dialog Hello Cruel World! buttons {OK} default button OK Save it as an application. Launch it from the Finder. Run Activity Monitor and, in the CPU tab, look for the value in the Kind column. It should show Apple (for Apple silicon). What do you see? Share and Enjoy — Quinn “The Eskimo!” @ Developer Technical Support @ Apple let myEmail = eskimo + 1 + @ + apple.com
Topic:
Programming Languages
SubTopic:
General
Tags:
Bug in iOS 18 beta? .onAppear of a NavSplitView-DetailView is called repeatedly after dismissing the view. The app gets unresponsive and can only be killed and cold-restartet. What happens: I update a Binding property in .onAppear of a NavigationSplitView-DetailView. Whenever I leave the DetailView going back to the ListView (the NavSplitView’s first column), the DetailView's .onAppear get’s triggered in an endless loop. This blocks the main thread and freezes the app. This behaviour is only appearing in iOS 18 betas (simulators and devices) and not on iOS 17.x releases. If I remove the code updating the Binding, the .onAppear loop does not happen. Another way of triggering the same unexpected behaviour is by updating an OberservedObject appState.shared singleton, e.g. by a timer. Has anybody come across this type of behaviour? Is this a know change of iOS 18 behaviour or a bug even?
I have an iPad app using the new UITabBarController on iPadOS18, which is suffering from a new issue from the new layout. Within my tabs, I have a UISplitViewController, with a 2 column layout. If I load the app, it works ok, but if I put the app in the background, and then bring it to foreground, the navigation bar buttons and title just disappear from the splitView controller’s primary view controller. Before going to background: After coming back from background: I also get the following layout issues posted in the debugger consoler: Unable to simultaneously satisfy constraints. Probably at least one of the constraints in the following list is one you don't want. Try this: (1) look at each constraint and try to figure out which you don't expect; (2) find the code that added the unwanted constraint or constraints and fix it. ( , , , = UILayoutGuide:0x600003b00a80'TabBarGuide(0x103d18810)'.trailing (active)>, , ) Will attempt to recover by breaking constraint Make a symbolic breakpoint at UIVie
Xcode prompts the error at var body: some View. I cannot understand what's wrong here because there was no changes after the last successful build. To solve I have already done: Clean Build Folder for several times Restart Xcode Nothing worked. import SwiftUI struct HomeView: View { @StateObject private var viewModel = HomeViewModel() @State var tabSelection: Int = 0 var body: some View { TabView { NavigationStack { Group { if viewModel.entries.isEmpty { EmptyStateView() } else { EntriesGridView(entries: viewModel.entries, tags: viewModel.tags, selectedTag: $viewModel.selectedTags) } } } .tabItem { Label(Saved, systemImage: bookmark) } SettingsView() .tabItem { Label(Settings, systemImage: gear) } } .onAppear { viewModel.fetchTags() viewModel.fetchEntries() } } } #Preview { HomeView() } Other related parts without any errors: HomeViewModel.swift import SwiftUI import Firebase import FirebaseFirestore import FirebaseFirestoreSwift import os.log @MainActor class HomeViewModel: ObservableObject { @Published var
@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:
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:
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:
We use the triple column layout and when running our app under Sequoia Beta, the Secondary view controller's navigation bar is not shown initially. If a view is pushed inside the secondary (which contains a UINavigationController), and then popped again, the navigation bar is shown.
I have the same issue but need to know a way to avoid this automatic grouping at all. Would like each column has it all accessibility value (similar to the activities chart on health app)
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags:
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
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:
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