Hi everyone,
I’m working on my submission for the Swift Student Challenge and need some advice. I already have an existing app that’s live on the App Store, and I’d like to use the same app for my submission.
However, while creating the App Playground, I noticed that I’m unable to create additional targets. This is problematic because my app relies heavily on specific targets like ShieldAction, ShieldConfiguration, and DeviceActivityMonitor. Without these targets, the app’s core functionality won’t work as intended.
Is there a known limitation or workaround for this? How can I submit my app’s functionality within the constraints of the App Playground?
Thanks in advance for your help!
Dive into the vast array of tools, services, and support available to developers.
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
I’ve just tried to reply to a post and I get an “unauthorized” error page back.
I’m logged in. I’m posting from an iPad, which is unusual, I normally use my Mac.
This post is in part to see if I can post at all, or whether it was just that one reply that is. not working.
We've been having some troubles to create a new account for apple developer for the company i'm currently working for. The first feedback we got was that I could create my personal account and then transfer the Duns Number for the company account when the problem would be solved.
We have the Duns Number, but I can't create the Apple Developer Program because of the following warning: Tell us about your organization.
Legal Entity Name
The information you entered did not match your D&B profile. Before submitting your information, check your D&B profile. If you've recently changed your legal entity name, update your D&B profile.
We are from Brazil and the support for the apple developer is only USA or Canada.
Could you help us? We have a lot of questions.
We need to create the account so that we could publish our APP
But so far we couldn't create the account
When overriding the following seek functions in a custom subclass of AVPlayerItem, a "method does not override method from its superclass" error occurs, causing the build to fail. This issue only happens after updating to Xcode 16. Do you have any suggestions on how to fix it?
https://developer.apple.com/documentation/avfoundation/avplayeritem/seek(to:completionhandler:)-91gnw
https://developer.apple.com/documentation/avfoundation/avplayeritem/seek(to:tolerancebefore:toleranceafter:completionhandler:)
(This error disappears 3 seconds after the build fails or temporarily disappears when the function's position in the file is changed.)
I was invited to a new development team yesterday, and I can not choose that team under the Team drop down of Signing & Capabilities in Xcode. Also, when I first login to Apple Developer, this team is not in the main drop down (the teams dropdown). But if I go into "Apps", then I can see the team in the teams dropdown in the top right of the screen and switch to it. Anyone know what's going on?
I use the code below for a non-consumable in-app purchase in my apps. Has anybody worked out how to handle this without using any of the deprecated items?
SKPaymentQueue - deprecated,
SKPayment - deprecated,
SKProduct - deprecated,
transactionState - deprecated,
SKPaymentTransaction - deprecated,
finishTransaction - deprecated
func paymentQueue(_ queue: SKPaymentQueue, shouldAddStorePayment payment: SKPayment, for product: SKProduct) -> Bool
{
true
}
func paymentQueue(_ queue: SKPaymentQueue, updatedTransactions transactions: [SKPaymentTransaction])
{
for transaction in transactions
{
switch transaction.transactionState
{
case .purchasing:
break
case .purchased:
SKPaymentQueue.default().finishTransaction(transaction)
// Hide the restore button
navigationItem.setRightBarButton(nil, animated: true)
// Set the ProVerion in the Db to true
IAPHandler.setProVersionToPurchased()
// Also hide the Purchase button
UIView.animate(withDuration: 1.0, animations: { [weak self] in
self?.purchaseBtn_Outlet.alpha = 0
}) { [weak self] (success) in
if self!.theDevice.isOneOf(K.Device_Groups.SE_3_iPhone8) {
self?.segControlTop_Constraint.constant = 10
} else if self!.theDevice.isPhone {
self?.segControlTop_Constraint.constant = 30
}
}
case .failed:
if let error = transaction.error
{
let errorDescription = error.localizedDescription
print("Transaction failed due to error: \(errorDescription)")
}
case .restored:
SKPaymentQueue.default().finishTransaction(transaction)
// Hide the restore button
navigationItem.setRightBarButton(nil, animated: true)
// Set the ProVerion in the Db to true
IAPHandler.setProVersionToPurchased()
// Also hide the Purchase button
UIView.animate(withDuration: 1.0, animations: { [weak self] in
self?.purchaseBtn_Outlet.alpha = 0
}) { [weak self] (success) in
if self!.theDevice.isOneOf(K.Device_Groups.SE_3_iPhone8) {
self?.segControlTop_Constraint.constant = 10
} else if self!.theDevice.isPhone {
self?.segControlTop_Constraint.constant = 30
}
}
case .deferred:
break
@unknown default:
if let error = transaction.error
{
let errorDescription = error.localizedDescription
print("Transaction failed due to error: \(errorDescription)")
}
break
}
}
}
// Sets the purchase to true in the Db
class IAPHandler: NSObject {
//Get the ProVersion Status
static func isProVersionPurchased() -> Bool
{
let VC_String = "IAPHandler"
var theStatus = false
do {
let settings = try Database.shared.databaseConnection!.read { db in
try My_Settings.fetchOne(db)
}
let theStatusText = settings?.ProVersion ?? "false"
theStatus = theStatusText == "true" ? true : false
} catch {
print("Getting the ProVersion Status failed! \(VC_String) \(error)")
}
return theStatus
}
// Set ProVersion to true.
static func setProVersionToPurchased()
{
let VC_String = "IAPHandler"
do {
try Database.shared.databaseConnection!.write { db in
try db.execute(sql: "UPDATE My_Settings SET ProVersion = :proVersion WHERE Settings_ID = :id",
arguments: ["proVersion": "true", "id": 1])
}
} catch {
print("Update set pro version, failed! \(VC_String)s \(error)")
}
}
}// End of class
Hello,
I am brand new to development in Xcode. I have created a Mac app that I need to use XLSXWriter to export a workbook and sheet. Is GitHub the only place for this download or is there an apple developer specific area to get the library?
Thanks
Topic:
Developer Tools & Services
SubTopic:
Xcode
I've entered some code on Version 4.5.1 of Playgrounds on my iPad mini running iOS 18.1.1. The file is saved on iCloud and so is available on my Mac running OS 15.2. However, the file will not open in either Playgrounds v 4.5.1 on the Mac (error "Unable to get file wrapper for contents.xcplayground.") or Xcode 16.1 (error "Couldn't load settings from contents.xcplayground"). The file's type is .playgorund. Any thoughts?
until previous version of the Xcode, I can see the backtrace of view by edit scheme -> Diagnostics -> Logging -> check Malloc Stack and select All Allocation and Free History` but the option just gone in Xcode 16.
Have downloaded playgrounds 4.3 to my iPad Air running ipados 16.5.
Trying to use playground “Get started with Apps” but receiving message “Unsupported file format Get Started with Apps.swiftpm cannot be opened in Swift Playgrounds”.
I do not have Mac or windows PC so am stuck! Help ??
Topic:
Developer Tools & Services
SubTopic:
Swift Playground
Tags:
Swift
Swift Playground
Playground Support
struct viewdetail: View {
@State var text1:String = ""
@State var tip1:String = ""
@State var text23:String = ""
@State var tip23:String = ""
var body: some View {
Text(text1);Text(tip1);Text(text23);Text(tip23)
} }
func detailline(costa:inout [Double],tipa:inout [Double]) {
print(costa,tipa)
text1 = "125" Cannot find 'text1' in scope print("detail")
}
Topic:
Developer Tools & Services
SubTopic:
Xcode
I have developed a mobile app using SwiftUI. Now I am in the process of building a CarPlay application. I know how to test the CarPlay app using a simulator but here is my confusion,
Testing the iPhone app and CarPlay together (few scenarios like user login / logout, location enabled /disabled in the mobile app)
Kindly help me validate the above scenarios as I am getting black screen on iPhone whenever the CarPlay is launched. Below is the code snippet,
func application(_ application: UIApplication,
configurationForConnecting connectingSceneSession: UISceneSession,
options: UIScene.ConnectionOptions) -> UISceneConfiguration {
if connectingSceneSession.role == .carTemplateApplication {
let sceneConfiguration = UISceneConfiguration(name: "CarPlay Scene", sessionRole: connectingSceneSession.role)
sceneConfiguration.delegateClass = CarPlaySceneDelegate.self
return sceneConfiguration
}
// Configuration for other types of scenes
return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role)
}
struct MyApp: App {
@UIApplicationDelegateAdaptor(AppDelegate.self) var delegate
var body: some Scene {
WindowGroup {
ContentView()
.preferredColorScheme(.light)
}
}
}
Info.plist
<key>UIApplicationSceneManifest</key>
<dict>
<key>UIApplicationSupportsMultipleScenes</key>
<true/>
<key>UISceneConfigurations</key>
<dict>
<key>CPTemplateApplicationSceneSessionRoleApplication</key>
<array>
<dict>
<key>UISceneConfigurationName</key>
<string>CarPlay Scene</string>
<key>UISceneDelegateClassName</key>
<string>$(PRODUCT_MODULE_NAME).CarPlaySceneDelegate</string>
</dict>
</array>
</dict>
</dict>
I am getting this error in a couple of places in my code with Task closure after setting Swift 6 as Language version in XCode.
Passing closure as a 'sending' parameter risks causing data races between code in the current task and concurrent execution of the closure
Below is minimally reproducible sample code.
import Foundation
final class Recorder {
var writer = Writer()
func startRecording() {
Task {
await writer.startRecording()
print("started recording")
}
}
func stopRecording() {
Task {
await writer.stopRecording()
print("stopped recording")
}
}
}
actor Writer {
var isRecording = false
func startRecording() {
isRecording = true
}
func stopRecording() {
isRecording = false
}
}
While making the class Recorder as Actor would fix the problem, I fear I will have to make too many classes as Actors in the class and in my scenario, there could be performance implications where real time audio and video frames are being processed. Further, I don't see any race condition in the code above. Does the error talk about possible race conditions that could arise if I were to call other functions on the self in future, or the current code itself is not safe?
Hello Apple Developer Community,
I am encountering an issue while trying to pay the $119.99 Apple Developer Program fee through the Apple Developer app. I have linked a prepaid card to my Apple ID, which works perfectly fine for other purchases and subscriptions, but I am unable to complete the payment for the developer fee.
Here are the details of the issue:
Payment Method: Prepaid card connected to my Apple ID.
Amount: $119.99 (Apple Developer Program fee).
Location: Cameroon.
Other Transactions: All other purchases and subscriptions using the same prepaid card have been processed successfully without any issues.
When I attempt to pay for the developer fee, the payment doesn’t go through, and I receive an error message (Payment Failed). I’ve verified that my card has sufficient funds and that the information is correctly entered in my Apple ID account settings.
Has anyone else faced a similar issue, particularly with prepaid cards or payments in Cameroon? Any advice or guidance on how to resolve this problem would be greatly appreciated.
Thanks in advance for your help!
Ive been working on android studio and have my app put together and was gonna start thr apple process and everything I read says I'll need a Mac to do it. Can someone either point me in the right direction or could I send my code over and someone compile my code for me?
Topic:
Developer Tools & Services
SubTopic:
General
Hello.
We have a few iOS devices connected to CI macs. We test our 3D engine, so we really need hardware devices for that. The issue is that Xcode loses connection to the devices once in a while, mostly after mac reboot, which requires a human to enter test room and unplug and plug cable again. Even if device is visible and accessible in Finder, Xcode may still don't see it, and devicectl shows it as disconnected.
Are there any hacks to make connection stable? The best what we could achieve so far was to remove iOS device screen lock - otherwise mac reboot would in 100% cases require human interaction to reconnect the device.
Both iOS and mac are logged into the same Apple ID.
Mac is logged in automatically after reboot
iOS devices have no screen lock
Thank you.
I have an issue during enroll apple developer account there is a mes says “Enrollment through the Apple Developer app is not available for this Apple Account. Visit http:// developer.apple.com/programs/enroll/.”
if anyone can help me with my case .
i have been facing this issue for 6 months please help me out
Topic:
Developer Tools & Services
SubTopic:
Apple Developer Program
Good Hello,
I'm looking for the invoice for the developer account but I can't get my hands on it, does anyone know where it's hidden?
Topic:
Developer Tools & Services
SubTopic:
Apple Developer Program
After upgrading to XCode 16.2, I am not able to see apple watch in xcode. I was able to see in XCode 15.2.
Topic:
Developer Tools & Services
SubTopic:
Xcode
Hi everyone,
(I am running on an M2 MacBook Pro 14 inch with 96 GB of memory)
I've been profiling with Instruments to find out why program suddenly goes from full CPU usage (all of my threads active and all cores working) to about 33% CPU usage. An Instruments system trace is showing me a massive performance cliff where I suddenly get taken off the performance cores and only run on efficiency cores. The performance cores are then occupied by "kernel.release.t6020". What is this thing?
I have kernel callstacks enabled but I only get the instruction pointer and have no symbols for any of those callstacks. I'm accustomed to Windows development where kernel symbols are available so you can see deeply into the kernel to know why you're spending time there (for example, semaphore wait or thread scheduling). Is there a way for me to get a similar level of information or kernel symbols so I can see what the kernel is doing?
Around the time I observe the performance cliff, I also noticed in the narrative view some of the preemptions are done "because thread was balanced off CPU i (P Core) to optimize the system's CPU performance". What does this mean? Have I begun to hit some sort of thermal limit?
Here are some example screenshots of what I am seeing in Instruments:
Topic:
Developer Tools & Services
SubTopic:
Instruments