Hi I'm new to Swiftui.
I want to show a sheet and pass a var to it.
In the case below when I tap on a list view it will popup then disappear. But subsequent taps will work as intended.
Main view:
struct ContentView: View {
@State private var selectedMonth = 1
@State private var selectedYear = "2024"
let months = [1,2,3,4,5,6,7,8,9,10,11,12]
@State private var isShowing = false
var body: some View {
List {
ForEach (months, id: \.self) { month in
HStack {
ViewList(month: month, year: selectedYear)
}
.onTapGesture {
isShowing = true
selectedMonth = month
}
.sheet(isPresented: $isShowing){
PopupView(month: selectedMonth, year: selectedYear)
.presentationDetents([.large])
}
}
}
.listRowSpacing(2)
.listStyle(.grouped)
}
}
ViewList:
struct ViewList: View {
var month: Int
var year: String
@State private var selectedMonthText = "Jan"
var body: some View {
VStack (alignment: .leading) {
Text(selectedMonthText + " / " + year)
.font(.headline)
}
.onAppear {
switch month {
case 01:
selectedMonthText = "Jan"
case 02:
selectedMonthText = "Feb"
case 03:
selectedMonthText = "Mar"
case 04:
selectedMonthText = "Apr"
case 05:
selectedMonthText = "May"
case 06:
selectedMonthText = "Jun"
case 07:
selectedMonthText = "Jul"
case 08:
selectedMonthText = "Aug"
case 09:
selectedMonthText = "Sep"
case 10:
selectedMonthText = "Oct"
case 11:
selectedMonthText = "Nov"
case 12:
selectedMonthText = "Dec"
default:
selectedMonthText = "All"
}
}
}
}
Then my popup:
struct PopupView: View {
@Environment(\.dismiss) var dismiss
var month: Int
var year: String
@State private var selectedMonthText = "Jan"
@State private var imageText = "plus"
@State private var items = ["Cat", "Dog", "Bird", "Snake"]
var body: some View {
Button("Dismiss"){
dismiss()
}
Text(selectedMonthText + " / " + year)
List {
ForEach(items, id: \.self) {item in
HStack {
Text(item)
Text("Fed on: ")
Text(selectedMonthText)
}
}
}
.listRowSpacing(0)
.listStyle(.inset)
.onAppear {
switch month {
case 01:
selectedMonthText = "Jan"
case 02:
selectedMonthText = "Feb"
case 03:
selectedMonthText = "Mar"
case 04:
selectedMonthText = "Apr"
case 05:
selectedMonthText = "May"
case 06:
selectedMonthText = "Jun"
case 07:
selectedMonthText = "Jul"
case 08:
selectedMonthText = "Aug"
case 09:
selectedMonthText = "Sep"
case 10:
selectedMonthText = "Oct"
case 11:
selectedMonthText = "Nov"
case 12:
selectedMonthText = "Dec"
default:
selectedMonthText = "All"
}
}
}
}
Apple Developers
RSS for tagThis is a dedicated space for developers to connect, share ideas, collaborate, and ask questions. Introduce yourself, network with other developers, and foster a supportive community.
Post
Replies
Boosts
Views
Activity
How Can I do for this?At the second point in the next step, does it mean I should keep the accurate metadata as same as current fortune telling? or change the accurate to the old type 'informational app'?
Help, help~~~~
Guideline 2.3 - Performance - Accurate Metadata
The app concept was drastically changed since the last approval.
Specifically, the app was previously approved as a informational app. However, the app is now a fortune telling app.
Note that changing an existing app into an entirely different app is not appropriate, as it creates a poor experience for users who have already downloaded the app.
Next Steps
If you wish to submit a new app, it would be appropriate to create a new app record in App Store Connect.
If you are updating the branding on your app, it would be appropriate to do so in accordance with the accurate metadata requirements in guideline 2.3.
New crash occur in iOS 17.4.1 and 17.5.1, is there a resolution for this crash ?
Thread 77 name:
Thread 77 Crashed:
0 Network 0x000000018f2218a8 nw_socket_internal_error(nw_socket*, int) + 72 (protocol_socket.cpp:373)
1 Network 0x000000018ec1570c invocation function for block in nw_socket_init_socket_event_source(nw_socket*, unsigned int) + 4000 (protocol_socket.cpp:4351)
2 libdispatch.dylib 0x0000000196405dd4 _dispatch_client_callout + 20 (object.m:576)
3 libdispatch.dylib 0x00000001964092d8 _dispatch_continuation_pop + 600 (queue.c:321)
4 libdispatch.dylib 0x000000019641d1c8 _dispatch_source_latch_and_call + 420 (source.c:596)
5 libdispatch.dylib 0x000000019641bd8c _dispatch_source_invoke + 832 (source.c:961)
6 libdispatch.dylib 0x000000019640f284 _dispatch_workloop_invoke + 1756 (queue.c:4570)
7 libdispatch.dylib 0x0000000196418cb4 _dispatch_root_queue_drain_deferred_wlh + 288 (queue.c:6998)
8 libdispatch.dylib 0x0000000196418528 _dispatch_workloop_worker_thread + 404 (queue.c:6592)
9 libsystem_pthread.dylib 0x00000001eb3b7934 _pthread_wqthread + 288 (pthread.c:2696)
10 libsystem_pthread.dylib 0x00000001eb3b40cc start_wqthread + 8 (:-1)
Issue:
I am facing a situation where multiple reviews from some users display the same titles, body, and author names in my admin panel, but they have different review IDs and review submission dates. For example, User A might have a review titled "Great App!" with the same content and author name, but different review IDs (123 and 456) and submission dates (June 1st and June 15th). This inconsistency appears when users update their reviews in the app or when reviews are deleted and then resubmitted through the App Store.
Reason:
When users update their feedback or delete and resubmit their reviews in the app or through the App Store, each action creates a new review entry in our database due to the different review IDs assigned by the platform, leading to these discrepancies.
Technical Details:
Fetching Reviews: I fetch the latest reviews from the App Store using a scheduled task that retrieves up to 200 reviews per hour. These reviews are retrieved using the App Store Connect API: https://api.appstoreconnect.apple.com/v1/apps/{id}/customerReviews?include=response&sort=-createdDate&limit=200.
Admin Panel Technology: My admin panel is developed using the Laravel framework (PHP).
Our Concern:
I want to ensure that our database stores only unique reviews and that our admin panel displays only unique reviews to avoid confusion and maintain data integrity.
I'm seeking guidance on how to handle this scenario correctly within my admin panel to ensure accurate representation of user reviews. Any insights or best practices on how to manage and display user reviews under these circumstances would be greatly appreciated.
Thank you.
HI,
for my needs I have to install Sequoia on an external disk.
From the first beta, I was able to install it without problems and I was also very happy because everything works perfectly and I could verify my apps with XCode.
Unfortunately, a few days the external disk decided to abandon me and after purchasing a new one I tried installing Sequoia on the external disk again but this time I started from beta 2.
The problem is that I can't install it.
It tells me that there are 28 minutes left but after a few minutes the disc is ejected and even if I try to start with the power button, it doesn't start...
I'm exhausted....I don't understand what I'm doing wrong....
I also tried to download the Beta 1 version but unfortunately without success, in fact I must say that it's even worse because it tells me that there is no space on the external disk and I don't know what to do.
Do you have any ideas?
Today I believe BETA 3 will be released and I will try to install that version but I am skeptical that I will be able to install.
I add the screenshot and the error log
Installer Log 8-Jul-2024.txt
Hi !
On my iPhone 12 Pro with iOS 18, I don't know why but I have problems :
The battery go fast down
I can't charge full, I can only charge 80% of the battery
The % are not realistic and funny I show my battery level 30%, I want to change the song and what 18% ???
This night I downgrade to iOS 17.5.1 and the battery is fine again I can charge to 100%.
A bug on iOS 18 ???
Hello Apple team,
I would like to request a feature to display the past temperature data (e.g., last 7 days) for each place in the Weather app(Especially past 24 hours of data for any given city ). Just like how it shows future 7-10 days of data. This would allow users to quickly view temperature trends and patterns for users like us to re-member how that day was like,etc,etc.
Please consider adding a 'Past Weather' section or a graph that shows the temperature fluctuations over the past week.
Thank you for considering my request!
I would like to request two enhancements to the Weather app:
Add a Celsius/Fahrenheit conversion option directly on the home page, rather than requiring users to access it through the three-dot menu.
Consider displaying both Celsius and Fahrenheit scales side by side, without requiring users to choose a conversion option(only if its feasible for your team). This would be particularly helpful for users who are familiar with both scales, such as Asians living in America.
Thank you for considering my request!
Hello Apple team,
I would like to request a feature to include a search option within each folder in the Notes app, both on MacBook and iPhone. Currently, the global search function searches all notes, which can be overwhelming when dealing with a large number of notes (I have over 700+ notes).
A folder-level search option would allow users to quickly find specific notes within a designated folder, making organization and retrieval more efficient. This feature would be a valuable addition to the Notes app, and I believe it would benefit many users who rely on the app for note-taking and organization.
Thank you for considering my request!"
Additionally, you can also mention the benefits of this feature, such as:
Improved note organization and management
Enhanced productivity and time-saving
Better user experience and satisfaction
By providing clear and concise feedback, you can help Apple understand the value of this feature and consider implementing it in future updates.
I want to use syscall to call SYS_recvmsg_x for udp socket program, can I do that?
I have backend API caller file that retrieves and displays unwrapped JSON data via URLRequest(). All the data is printed to my console when I build the project but it's not being displayed in the actual UI of my iOS simulator.
I have a class in my ContentView that updates the UI and filters the extracted fields shown here below:
class NotionCall: ObservableObject {
@Published var extractedContent: [BlockBody.Block] = []
func makeAPIRequest() {
makeRequest { results in
let extractedData = results.map { block -> BlockBody.Block in
var extractedBlock = block
extractedBlock.ExtractedFields = block.paragraph?.textFields.compactMap { textField in
textField.PlainText ?? textField.RichText ?? textField.content //iterate over PlainText, RichText, and Content fields and return the non nill values
} ?? [] //validate objects even if they are nil
return extractedBlock
}
DispatchQueue.main.async {
self.extractedContent = extractedData
}
}
}
}
@StateObject var NotionCaller = NotionCall() //manage lifecycle of instance
And then below here is my SwiftUI structure that contains List(NotionCaller.extractedContent) { block in ForEach(block.ExtractedFields, id: \.self) { field in Text(field) meant to display the extracted data to the UI:
var body: some View {
NavigationStack {
ZStack {
List(NotionCaller.extractedContent) { block in
ForEach(block.ExtractedFields, id: \.self) { field in
Text(field)
}
}
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 {
NotionCaller.makeAPIRequest()
}
}
}
}
}
}
}
Starting in the last week or two the daily forecast returned by weatherkit rest api changed to 9 days instead of 10 days if I don't pass in the dailyStart and dailyEnd paramters.
Now, if I pass in those parameters to get me anything more than 9 days then I get 400 error. 9 days or less works.
Obviously something changed in the api.
Apple, please fix this asap!!!
iMessage has flipped to SMS randomly, I have tried everything short of actually going to Apple and or resetting my phone completely. I am on the iOS 18 beta, I don’t think this has anything to do with it, but I could be wrong. Somebody feel free to help, thanks
I'm trying to create a custom domain email in iCloud, but an error message appears stating that the email cannot be created. As the email was already associated with an AppleID, the system did not allow me to associate the email with my account. So I deleted the AppleID with the associated email, but it still won't allow it. Does anyone know how I can do this? Is there any way to clear this email on Apple's database?
I'm looking for someone who can make me such a design. I just want this large text to work as a preview for pictures and videos at the top and the comment field at the bottom has the same design as in the picture and that it is together with the keyboard and that should all be only for the post-constitution. Maybe someone can do something like in this picture with exactly the same design and in the comment field there should also be this small Siri icon from Apple Intelligence. It doesn't have to work, but it just looks chic. In addition, I would like that on the main page where post is displayed like on TikTok and Instagram, is with a 3-D floating postcard and I have a sketch (see picture)
My Iphone is connected to the car via wireless carplay. Technically, the onboarding works via bluetooth, then via the car's hotspot (SSID from the car).
I have noticed that an SSID appears under the "known networks" that has no name.
The SSID can no longer be deleted, not even with a network reset on the Iphone. I asked my car dealer if he could reproduce the problem with his Iphone and another car. And he can! So it's not my device, it's an Apple problem. To be precise: The fact that you can no longer delete the SSID is Apple's problem, why the car stores an SSID without a name on the Iphone when connecting is possibly the problem of the car manufacturer. Here are a few more screens on this case.
"bug_type":"210","timestamp":"2024-06-01 14:21:43.00 +0400","os_version":"iPhone OS 16.7.4 (20H240)","roots_installed":0,"incident_id":"2D658 A3E-807D-4239-A262-1560CDB5A77F"}
{
"build" : "iPhone OS 16.7.4 (20H240)",
"product" : "iPhone10,6",
"socId" : "8015",
"socRevision" : "11",
"incident" : "2D658A3E-807D-4239-A262-1560CDB5A77F",
"crashReporterKey" : "b9deae4c29b808d36d6d04c34edc95561cd25808",
"kernel" : "Darwin Kernel Version 22.6.0: Tue Nov 7 21:41:17 PST 2023; root:xnu-8796.142.1.702.91/RELEASE_ARM64_T8015",
"date" : "2024-06-01 14:21:43.37 +0400",
"panicString" : "panic(cpu 2 caller 0xfffffff01d52a4fc): userspace watchdog timeout: no successful checkins from thermalmonitord\nservice returned not alive with context : is_alive_func returned unhealthy : current 7fffffffeff, mask 67fffffffff, expected 67fffffffff. SD: 0 BC: 0 RC: 0 BS: 0, Missing sensor(s): TP0Z \nservice: backboardd, total successful checkins in 225 seconds: 17, last successful checkin: 0 seconds ago\nservice: SpringBoard, total successful checkins in 176 seconds: 15, last successful checkin: 0 seconds ago\nservice: mediaserverd, total successful checkins in 225 seconds: 17, last successful checkin: 0 seconds ago\nservice: logd, total successful checkins in 225 seconds: 19, last successful checkin: 0 seconds ago\nservice: thermalmonitord, no successful checkins in 225 seconds\nservice: runningboardd, total successful checkins in 225 seconds: 19, last successful checkin: 0 seconds ago\nservice: wifid, total successful checkins in 225 seconds: 19, last successful checkin: 0 seconds ago\nservice: configd, total successful checkins in 225 seconds: 18, last successful checkin: 0 seco\nDebugger message: panic\nMemory ID: 0x6\nOS release type: User\nOS version: 20H240\nKernel version: Darwin Kernel Version 22.6.0: Tue Nov 7 21:41:17 PST 2023; root:xnu-8796.142.1.702.91/RELEASE_ARM64_T8015\nKernelCache UUID: 52E07559182379151E59E4DE1C565312\nKernel UUID: C5429369-571A-3EAE-9CFB-8985A9637045\nBoot session UUID: 2D658A3E-807D-4239-A262-1560CDB5A77F\niBoot version: iBoot-8422.142.2.700.1\nsecure boot?: YES\nroots installed: 0\nPaniclog version: 14\nKernel slide: 0x0000000016954000\nKernel text base: 0xfffffff01d958000\nmach_absolute_time: 0x142240dd9\nEpoch Time: sec usec\n Boot : 0x665adb4d 0x00079646\n Sleep : 0x665af29e 0x00084228\n Wake : 0x665af60f 0x0008bd33\n Calendar: 0x665af616 0x0000b21a\n\nZone info:\n Zone map: 0xffffffdc007dc000 - 0xffffffe20
Hey, currently working on my first SwiftUI app in college and would appreciate any help. I have an issue where when dates are loaded from firebase into the "selectedDates" array of my MultiDatePicker, the onChange function does not recognize dates that are already in the "selectedDates" array, instead re-adding them to the array. I.e. if I have loaded July 19th into the multidatePicker, it displays on the calendar, but clicking July 19th on the multidatepicker calendar view doesn't remove it from the "selectedDates" array. This is the code for the view:
VStack {
MultiDatePicker("Select dates", selection: $selectedDates)
.padding()
.onChange(of: selectedDates) { oldValue, newValue in
saveDates(dates: selectedDates)
}
List(savedDates, id: \.self) { date in
Text("\(date, formatter: dateFormatter)")
}
.listStyle(.plain)
}
.onAppear {
loadSavedDates()
}
Where selectedDates is a state variable:
@State var selectedDates: Set<DateComponents> = []
If nothing is on Firebase, the selection and deselection of dates happens fine, but if I am loading dates from firebase then the multidatepicker doesn't detect de-selection of dates. Here's my code for loading the dates from firebase:
func loadSavedDates() {
let db = Firestore.firestore()
let uid = try! AuthenticationManager.shared.getAuthenticatedUser().uid
print("User ID: \(uid)")
print(widget.id.uuidString)
db.collection("spaces")
.document(spaceId)
.collection("dates")
.document(widget.id.uuidString)//widget.id.uuidString
.getDocument {document, error in
if let document = document {
if let dateStrings = document.data()?[uid] as? [String] {
let dateFormatter = DateFormatter()
dateFormatter.dateStyle = .medium
self.savedDates = dateStrings.compactMap {
dateFormatter.date(from: $0) }.sorted().
let calendar = Calendar.current
self.selectedDates = Set(self.savedDates.map {
calendar.dateComponents([.year, .month, .day], from: $0) }).
for component in selectedDates {
print(component.isValidDate)
}
}
} else {
print("Document does not exist")
}
}
As you can see, I believe I am setting the selectedDates array correctly with datecomponents. Is there a problem with my code or is there just no way to pass dates from Firebase into multidatepicker?
Hello everyone,
I am currently trying to implement and test the latest SwiftUI changes with Xcode 16 Beta 3. Now I wanted to create, like in FreeForm, that I have a grid in the detail column with tiles in a NavigationSplitView. If you now press on the tile, a DetailView (in my code its an EmptyView) should open with the zoom effect and in fullscreen so that the NavigationSplitView disappears and the NavigationBar is no longer there.
In FreeForm the desired effect is when you create a new board.
any tips or hints?
struct CanvasGrid: View {
@Namespace var namespace;
var body: some View {
if let project = project {
if viewMode == .grid {
ScrollView{
LazyVGrid(columns: columns, spacing: 10) {
ForEach(sortedCanvases) { canvas in
NavigationLink {
EmptyView()
.navigationTransition(
.zoom(sourceID: canvas.id, in: namespace)
)
} label: {
CanvasTile(canvas: canvas)
}
.matchedTransitionSource(id: canvas.id, in: namespace)
}
}
.searchable(text: $searchText)
.navigationTitle(project.name)
}
}
#Preview {
NavigationStack{
CanvasGrid(project: SampleData.shared.project)
}
}
......
struct ContentView: View {
var body: some View {
NavigationSplitView {
List(selection: $selectedProject) {
ForEach(projects, id: \.self) { project in
HStack {
NavigationLink(project.name, value: project)
Spacer()
Button(action: {
showingEditSheet.toggle()
}) {
Image(systemName: "pencil")
.foregroundColor(.blue)
}
.buttonStyle(BorderlessButtonStyle())
}
}
}
} detail: {
NavigationStack(path: $path)
{
CanvasGrid(project:selectedProject).padding(.leading, 10)
}
}
.navigationSplitViewStyle(.balanced)
.onAppear() {
selectedProject = projects.first
}
}
......
}
#Preview {
ContentView()
.modelContainer(SampleData.shared.modelContainer)
}
For those Android developers who use MacBook Air for their day-to-day work. Will 24GB worth of RAM be sufficient enough?