Any help will be greatly appreciated.
Trying to build a calendar/planner app for public school teachers. Classes are held on multiple dates so there is a need for swiftdata to save multiple dates.
There are lots of tutorials demonstrating a multidatepicker but none of the tutorials or videos save the dates, via swiftdata.
My goal is to save multiple dates.
Step 1 is to initialize mockdata; this is done a class called ToDo.
var dates:Set = []
Step 2 is the view containing a multidatepicker and other essential code
Step 3 is to save multiple dates using swiftdata.
Lots of tutorials, code snippets and help using a single date.
But after almost 2 weeks of researching youtube tutorials, and google searches, I have not found an answer on how to save multiple dates via swiftdata.
Also, I don't know how how to initialize the array of for the mockdata.
Here are some code snippets used but the initialization of the array of DateComponenets doesnt work. And saving multiple dates doesn't work either
@MainActor
@Model
class ToDo {
var dates:Set<DateComponents> = []
init(dates: Set<DateComponents> = []) {
self.dates = dates
}
}
//view
struct DetailView: View {
@State var dates: Set<DateComponents> = []
@Environment(\.modelContext) var modelContext
@State var toDo: ToDo
@State private var dates: Set<DateComponents> = []
MultiDatePicker("Dates", selection: $dates)
.frame(height: 100)
.onAppear() { dates = toDo.dates }
Button("Save") {
//move data from local variables to ToDo object
toDo.dates = dates
//save data
modelContext.insert(toDo)
}
}
}
#Preview {
DetailView(toDo: ToDo())
.modelContainer(for: ToDo.self, inMemory: true)
}
This is a dedicated space for developers to connect, share ideas, collaborate, and ask questions. Introduce yourself, network with other developers, and join us in fostering a supportive community.
Post
Replies
Boosts
Views
Activity
Hi guys,
I am looking for some help from anyone very desperate
I am being hacked at the system level
dealing with
Malious 3rd party TVapp
Exhibited ksophicisted container based persistence
Possible Zero Day exploration
Active Network connection to cloud infrastructure
resistance to standard removal
I did attempt to report to apple security and have not had an update but fear loss of account access even with 2fa since they have ability
Currently I can't access internet/wifi(EVEN with ethernet cable)
Honestly any help from anyone
Greetings Apple Communithy,
Caraveo here, I am attempting to create an node-based diagram app... this is my first app. I am want to create an app that will help me personally organize my career, ideas, and projects.
Its a document based app.... that allows users to store files into a .memory extension.
For example users will be able to create a file called "myBook.memory"
I am attempting to create a work-flow where users can "clone" files into each node. PDFs, Documents, Audio, Video, Media, etc. They can then just work with their .memory file and share it, back it up, manage it...
To me this is very important..... it will help me immensely... its a new super simple way to manage your ideas.
Please learn more here.... MemoryProApp.com
I need a co-coder, alpha testers, and anyone that is interested in working on this project.
I am having issues with the file attachements and the documentation saving is failing on me for some reason. Thank you everyone!
I have tried everything. Different addresses, different credit cards, then it appears pending, but the credit card is never charged and then it "resets", meaning I can do the whole process again as if nothing had happened. I have already sent an email to Apple and I have not had a response either. How can I move forward? Some help. Greetings!
There’s only the page where I can see my email notification checklist or enrolling developer program.
A month ago I was listening to music in Apple Music but then I saw a song, not anything weird, then I wanted to download it but it took a longer than usual and then an error apeared, I cant upload the picture of the text but it says, "The Song Name / Album / Artist 0% - Stopped (err = -12884)", I uninstall the app and then install it and it fixes, but when i want to enable Lossless Audio, the error appears, the error still aprearing until today and Im tired of uninstalling and installing the app so much times, can anyone help me?
I am attempting to use the AVSpeechSynthesizer to include text to speech in my Swift Playgrounds project, but when I attempt to use it on my IPhone i get the following errors:
It works just fine on the simulator, but no audio is produced when I run it on-device. Is there a way to set this "bundle display name" within Swift Playgrounds, or are there any workarounds?
My code:
import AVFoundation
class Speaker {
let synthesizer = AVSpeechSynthesizer()
func speak() {
let utterance = AVSpeechUtterance(string: "Test, I am the speaker")
synthesizer.speak(utterance)
}
}
My phone Apple ID not log in type for log in failed
Hi!
I have a concern for the SSC:
I worked on the Playground app, but on MacOS. My app has been developped to be firstly used on a mac, as the playground app let you directly download your app on you mac and act as a real one.
When i wanted to submit, I noticed there is nowhere to specify whether your app should be tested on iPad or on MacBook.
I saw Playground apps would be tested on an iPad, does it mean I have to refactor my app to work on one, or i can mention on a comment that it is a MacOS app, and should therefore be tested on a mac?
Thanks for your help on this
I have learned that the Swift Student Challenge will be reviewed by judges within three minutes of interaction. What I want to know is whether the three-minute limit is strictly enforced or if there is some flexibility for an extension. This is because I am creating an interactive game with different scenarios, and I need to manage the duration of my game accordingly. I hope to receive your reply as soon as possible.
Hey everyone! I’m currently working on my Swift Student Challenge app and exploring ways to enhance its visuals. I was wondering—does anyone know if images generated by Apple Intelligence Image Playground can be used in the app?
Can anyone tell me why "Classroom (System Settings)" is running on my Mac?
I found this post, but the author never fully explained what was going on: https://developer.apple.com/forums/thread/734270
Clicking on "inspect" tells me it was launched by launchd.
xin chào tôi muốn mã sử dụng Testflight hoặc một số trợ giúp để tôi có thể sử dụng testflight
I’m having trouble downloading my yahoo emails. I use the Mail function for all my email accounts. The Comcast emails seem to be downloading fine. I get the posix96 error. Is there a fix for this yet??
I am trying to create a phone app that can receive incoming call notifications using CallKit, as described in Apple's CallKit documentation.
Added the com.apple.developer.calling-app entitlement in my .entitlements file. Implemented CXProvider and set up the delegate methods (provider:perform: and providerDidReset). Added UIBackgroundModes with voip in Info.plist. Configured CXProviderConfiguration to support phone numbers.
I expected to receive incoming call notifications when my app was set as the default calling app. However, I am not receiving any notifications when an incoming call arrives.
How can I properly detect and handle incoming calls in my default calling app? Is there any additional configuration required for iOS 18.2+?
Dear Apple,
I am sending this review to tell you that with my new update. I am not a fan of the photos set up. I find it very confusing and find myself getting irritated very often and giving up after searching for an image… which is frustrating for many reasons including I need my camera roll for work often. please make adjustments with the newest update… please.
thank you, if anyone took the time to read this.
Ashton, a very sad customer
When using a VStack containing two TextFields inside a ScrollView on an iPad running iOS 18.0, the FocusState of the topmost TextField does not trigger, while the second TextField's FocusState works correctly. Adding an invisible TextField on top resolves the issue, but it appears to be a bug specifically in iOS 18.0 on iPads. This issue does not occur on iOS versions below or above 18.0 (including iOS 18.1).
Code that is not working
struct ContentView: View {
@State var text: String = ""
@FocusState
private var focusState: Bool
var body: some View {
ScrollView(.vertical, content: {
VStack(spacing: 0) {
TextField(text: $text) {
Text("Hello, World!")
}
.border(focusState ? Color.red : Color.gray)
.focused($focusState)
.onChange(of: focusState) { oldValue, newValue in
print(newValue)
}
.onChange(of: text) { oldValue, newValue in
focusState = true
}
}
})
.padding()
}
}
Code that is working
struct ContentView: View {
@State var text: String = ""
@FocusState
private var focusState: Bool
var body: some View {
ScrollView(.vertical, content: {
VStack(spacing: 0) {
// Invisible Text Field
TextField("", text: .constant(""))
.frame(height: 0)
TextField(text: $text) {
Text("Hello, World!")
}
.border(focusState ? Color.red : Color.gray)
.focused($focusState)
.onChange(of: focusState) { oldValue, newValue in
print(newValue)
}
.onChange(of: text) { oldValue, newValue in
focusState = true
}
}
})
.padding()
}
}
I am a startup founder based in India. Recently the iOS developer we were working with left the company in some what acrimonious circumstances.
Post his departure from the company, he has made it clear that he will try to cause damage to our iOS app to the extent that it starts to crash.
Even though we have removed his access, as a non tech founder, I am not sure what ways he can edit or hamper our iOS app and what measures we can take to protect the same.
Please advise us with steps for us to secure our code and ensure no one can edit the same or hamper our iOS app on the app store.
Thank you
I have the following questions that need official answers:
1: Whether the Bluetooth scanning cycle can be controlled through the software level. If it can be controlled, please tell me how to control it.
2: Now the IOS mobile phone scanning strategy, how long is the scanning cycle, and what is the scanning duty cycle in this scanning cycle
Hello guys,
I have a question regarding the submission requirements. My app uses ARKit and requires Metal files for shaders, which are not supported by Swift Playgrounds. Therefore, I developed my app using Xcode.
(swift playgrounds returning error for metal file)
Since my app relies on a real device for proper functionality, I would like to know if, under these circumstances, the scene build is performed by Xcode. If the build were instead done by Swift Playgrounds, my scene would not function correctly.
I'm asking that because of this note
Thank you for your time and assistance.