Post

Replies

Boosts

Views

Activity

Reply to can't post a question on this forum.
So, you have written something that is considered (for good reason or not) as sensitive… I handle such a situation by dichotomy: I copy the post in Text Edit to save it. I keep only the first half in the post, to see if it is accepted. if it fails, you know where the problem is. If it works, then edit your post and copy half of the second half if it works, then edit to add the end. It should fail, but you know where is the sensitive language
Jul ’24
Reply to Using Older version of Xcode
It is possible to use Xcode on an older Mac (I do it on a 2015 iMac with Monterrey and Xcode 14.2). But I cannot publish on AppStore with it (you can with Xcode 15.2): as of April 2024 all iOS and iPadOS apps submitted to the App Store must be built with a minimum of Xcode 15 and the iOS 17 SDK. So, sooner or later you will unfortunately have to upgrade to a new Mac (which is a pity when the old one still working perfectly and there is no iMac 27" in the lineup). PS: I use this site to download any version of Xcode: https://xcodereleases.com
Jul ’24
Reply to Why can't SwiftUI state be changed in the middle of view updates?
What @MobileTen said. Plus what you hinted yourself. Authorising this could create infinite loop or a lot of other side effects. As it is impossible to predict and handle all the cases, it is forbidden. In addition, that's fundamentally contrary to SwiftUI principle (we like it or not is not the question) which building principles have been explained by MobileTen. Contracticting the fundamental principles of an architecture would have been the wrong way to go. However, depending on what you want to do exactly, there are several ways to achieve similar result. Here are some examples: struct ContentView: View { @State private var dummy = "OK" var body: some View { Text(dummy) .onAppear() { DispatchQueue.main.asyncAfter(deadline: .now() + 5) { dummy = "changed after 5s" } } Button(action: { self.dummy = "Changed" }) { Text("Change") } } }
Topic: UI Frameworks SubTopic: SwiftUI
Jul ’24
Reply to List Closure not displaying retrieved data in Simulator UI
Here is what I propose to test for onAppear var body: some View { NavigationStack { ZStack { List(NotionCaller.extractedContent) { block in ForEach(block.ExtractedFields, id: \.self) { field in Text(field) } } .onAppear { // <<-- EITHER HERE NotionCaller.makeAPIRequest() } ZStack { Color(hex: "#f9f9f9") .ignoresSafeArea() VStack { TextField(" Search keywords", text: $searchKeywords) //change font later .frame(height: 48) .overlay(RoundedRectangle(cornerRadius: 30).strokeBorder(style: StrokeStyle())) .foregroundColor(.white) .background(.white) .cornerRadius(30) .padding() .scaledToFit() .frame(maxHeight: .infinity, alignment: .top) } VStack { Spacer() Divider() .padding() HStack { Button(action: { //add functionality later }) { Image("menuButton") .frame(alignment: .bottom) .padding(.horizontal, 42) Spacer() } HStack { Button(action: { //add functionality later }) { Image("notificationButton") .frame(alignment: .leading) .padding(.leading, 30) Spacer() } } HStack { Button(action: { }) { Image("notionImportButton") .frame( alignment: .trailing) .padding(.horizontal) .padding(.horizontal) } } } // .onAppear { // <<-- NOT HERE // NotionCaller.makeAPIRequest() // } } } } .onAppear { // <<-- OR HERE NotionCaller.makeAPIRequest() } } } }
Topic: Community SubTopic: Apple Developers Tags:
Jul ’24
Reply to App Store Connect / Trends issue
I face the same problem and filed a bug report: Jul 10, 2024 at 11:14 AM – FB14261684 Here is FB content: I cannot access AppStoreConnect (Trends and sales, overview…) on some iMac: iMac mini Pro, macOS 14.5, Safari Technology Preview Release 197 (Safari 18.0, WebKit 19619.1.18) Same Mac, with Safari Version 17.5 (19618.2.12.11.6) I get the error message When I click on contact us, I get nothing as shown I tested on another iMac (27", 2015) with MacOS 12.7 and Safari Technology Preview Release 171 (Safari 16.4, WebKit 17616.1.15) It works as expected I tested on iPhone Xs, iOS 17.4 It works as expected
Jul ’24
Reply to Can't figure out why Toolbar is not conforming to view
Welcome to the forum. I tested your code (after completing missing parts and removing reference to unknown structure) and it works OK, both with Xcode 16.0ß2 and Xcode 15.0.1. Are you sure you have declared var as State vars ? Have you declared dismiss ? Aren't you missing a closing curly bracket somewhere ? Where exactly do you get the error ? Please show the exact and complete code, as well as your configuration (Xcode version, system version…) Here is the complete code I tested: struct ContentView: View { @State var companyName: String = "" @State var role: String = "" @State var location: String = "" @State var yearlySalary: Double = 0 @Environment(\.dismiss) var dismiss var body: some View { NavigationStack { Form { TextField("Company Name", text: $companyName) TextField("Role", text: $role) TextField("Location", text: $location) TextField("Yearly Salary", value: $yearlySalary, format: .currency(code: "USD")) .keyboardType(.decimalPad) } .navigationTitle("Add Application") .navigationBarTitleDisplayMode(.large) .toolbar { ToolbarItem(placement: .navigationBarLeading) { Button("back") { dismiss() } } ToolbarItem(placement: .navigationBarTrailing) { Button("Save") { // let appdata = ApplicationData( // companyName: companyName, // role: role, // location: location, // yearlySalary: yearlySalary, // dateApplied: dateApplied, // notes: notes) // // Save the application data dismiss() } } } } } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jul ’24