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 team,
I am trying to enroll my company, in the Apple Developer Program - I am repeatedly receiving a rejection from Apple’s system. It shows in review and when I continue to enrollment, nothing happens. It submits as a new request.
I have:
✅ Verified my business name and address with D&B (matches exactly).
✅ Checked that my business is a legal entity (LLP).
✅ Ensured all details match across D&B, UPIK, and Apple’s lookup tool.
✅ Attempted re-submission multiple times without success.
However, despite these steps, I am still unable to proceed.
Please help.
The Bluetooth on my iPhone 14 hasn’t been working for a week now. Everything was fine until, at some point, it started endlessly turning on and off by itself. I’ve tried resetting the settings, doing a hard reset, updating to iOS 18.3—none of these helped. I even deleted all VPN profiles just in case (I saw this suggested on forums), but that didn’t work either. According to forums, this bug has existed since September and affects thousands of people. The constant cycling causes the Bluetooth settings to freeze. Please help! My watch, headphones, car—everything has turned into a pumpkin!
The following is my code, which runs successfully and is recommended to succeed, but it still does not show Siri's suggestion to users in the system sharing in Safari
import AppIntents
import Contacts
import CoreSpotlight
import Intents
import UIKit
class TestViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
self.view.backgroundColor = UIColor.white
DispatchQueue.global().async {
self.donateMessageInteraction(recipientName: "张三", phoneNumber: "+8613812345678")
}
}
func donateMessageInteraction(recipientName: String, phoneNumber: String) {
INPreferences.requestSiriAuthorization { status in
guard status == .authorized else { return }
// 1. 创建接收者
let recipientHandle = INPersonHandle(value: phoneNumber, type: .phoneNumber)
let recipient = INPerson(
personHandle: recipientHandle,
nameComponents: nil,
displayName: recipientName,
image: nil,
contactIdentifier: nil,
customIdentifier: "com.yourapp.recipient.\(phoneNumber)"
)
// 2. 创建发送者(你的应用身份)
let senderHandle = INPersonHandle(value: "15210639372@163.com", type: .emailAddress)
let sender = INPerson(
personHandle: senderHandle,
nameComponents: nil,
displayName: "我的应用",
image: nil,
contactIdentifier: nil,
customIdentifier: "com.yourapp.sender"
)
// 3. 创建消息意图
let intent = INSendMessageIntent(
recipients: [recipient],
outgoingMessageType: .outgoingMessageText,
content: "最近怎么样?", // 常用消息内容
speakableGroupName: nil, // 群组名称(一对一设为nil)
conversationIdentifier: "com.yourapp.conversation.\(phoneNumber)", // 唯一会话ID
serviceName: "My Chat Service", // 你的消息服务名称
sender: sender, // 发送者身份
attachments: nil
)
// 4. 配置意图参数
intent.setImage(INImage(named: "user0"), forParameterNamed: \.sender)
// 5. 创建并捐赠交互
let interaction = INInteraction(intent: intent, response: nil)
interaction.direction = .outgoing
interaction.donate { error in
error.map { print("捐赠失败: \($0)") }
}
print("捐赠代码执行完成")
}
}
}
When trying to activate the VPN in the Settings menu of 18.4 beta (22E5200s) an error message pops up: ”The connection failed due to an irrecoverable error” The VPN works as expected with iOS and iPadOS 18.3.1 (22D72) and earlier releases.
I installed iOS 18.4 on Friday evening, all worked well during Saturday and Sunday, Monday morning the Phone rebooted and appeared to have installed an Update, I didn´t notice, I was about to answer a WhatsApp and the TestFlight beta didn´t start up, a renew of the App was not possible due to TestFlight not being available. So I thought a reboot would help, but I did a reset, since then BOOT LOOP.
I brought in recovery mode, updated with the 18.4 ipsw, no change - BOOT LOOP
Hi Apple.I‘m currently using iPhone SE2 and Today I damaged my Finger with which I’m using Touch ID and now I cannot get access to password even I cannot delete fingerprint because I need to use my finger to delete fingerprint. Please help
Hello,
I've just installed the iOS 18.4 beta but I can't access features like Genmojis or others. I don't understand why knowing that I have the iPhone 16.
Could someone help me?
Hello,
I've just installed the iOS 18.4 beta but I can't access features like Genmojis or others. I don't understand why knowing that I have the iPhone 16.
Could someone help me?
best regars
I have been waiting for a week for subscription confirmation, the money was withdrawn from my card, invoice came, but for a week already the status is pending, and also on the site writes complete your purchase now. What to do?
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
Hi,
I want to write a workflow in XCode cloud which will perform analysis on the PRs. PRs will be dynamic, so my workflow must get the name of branch from the PR and perform sonar analysis on it. It must check the unit tests coverage on new lines. The scope of the workflow will be only inside the PR not on the complete develop branch.
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
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?
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 updated my Apple Watch Series 6 before Apple withdrew beta 11.4 as an option. I see on forums that I am not alone with this issue. Many series 6 watches are now stuck in a boot loop. I hope Apple can resolve the issue for those of us that pushed the update to our watches before the issue was identified. Support were unable to assist.
I installed the iOS 18.4 developer beta on my iPhone 12 last night, and it ended up sending my phone into a boot loop—at least that's what it looks like. Phone alternates between totally black screen and the Apple logo screen every 5 seconds or so. The phone isn't responding to force restart, isn't showing up in Finder to try to factory reset, etc. My guess is the update was corrupted in some way?
Did this happen to anyone else? Any ideas about what's going on?
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?
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!
There’s only the page where I can see my email notification checklist or enrolling developer program.