When I go to Settings and tap on the account, choose iCloud>manage account storage and try to delete the storage associated with an app id developer mode, it doesn't give me the option to delete the data. I have tried using the CloudKit Console to delete the container data, but the entry for the app is still there. How do I delete it?
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
My code was working perfectly well until the latest Xcode update. Suddenly the DisclosureGroup stopped working, causing the app to freeze. Also there seems to have been a change to the way SwiftUI tracks view updates because some of my code went into a screaming loop thinking a view was constantly changing.
Developing code is hard enough without these problems coming out of nowhere.
I created an app using Playgrounds and added a Package from GIt. When I try running the app it fails saying the it doesn't support dynamic libraries. So, my question is why did it allow me to add the package in the first place?
I'm trying to build a Multiplatform app for Mac but get this incomprehensible error. Anyone any idea what this means and how to fix it?
"Driver threw Swift requires a minimum deployment target of iOS 7.0.0 without emitting errors."
I am trying to update the EditButton after deleting rows in a List, but its title doesn't change. I have sent an update event via a publisher that applies the mode change based on the number of items remaining in the list. Here's the update event handler:
.onReceive(updateViewPublisher, perform: { _ in
self.editMode?.wrappedValue = textFileData.textFiles.count == 0 ? .inactive : .active
update += 1
})```
The edit mode is changed to inactive when the list is empty, but the button continues to display 'done'. If I adda new list item it remains set to 'done' and the delete control is displayed against the new item.
I have seen loads of posts about this on various sites, but no solutions. I am trying this on Xcode 16.2 and IOS 18.2. If someone from Apple sees this, a reply would be most welcome.
I managed to lose my password in a mixup with my password manager. It has taken me a few hours to work out how to reset it. Following the forgotten password link on the sign in page only takes you to a point where you are asked to reset the password on your iCloud user id. If they are one and the same that's ok. Mine aren't.
I eventually found the answer:
in the settings app choose developer
2 scroll to the end and choose the sandbox apple account
3. choose this and reset
The following code compiles ok in one function:
let stop:UnsafeMutablePointerObjCBool
stop.initialize(to: false)
text.enumerateAttribute(kStyleKey,
in: NSRange(location: 0, length: text.string.count),
options: []) { (value, range, stop) in
but the following code which is virtually the same fails the initialise with the error "Constant 'stop' being used before being initialised" :
let stop:UnsafeMutablePointerObjCBool
stop.initialize(to: false)
attributedText.enumerateAttribute(kStyleKey,
in: NSRange(location: selectedRange.location, length: selectedRange.length),
options: []) { (value, range, stop) in
Any suggestions - looks like a compiler issue to me.
When I assign an NSMutableAttributedString to a NSAttributedString I am getting error
[UICTFont textBlocks]: unrecognized selector sent to instance
There must be something wrong with the string but I cannot find any documentation that might explain this. Does anyone know what the error means?
If I call
let font = UIFont.preferredFont(forTextStyle:.body)
Then font.pointSize has value 17
If, however, I call this with a font such as Arial
let font = UIFont.fontWithNameAndTraits(fontName,
size: styleAttributes.fontSize ?? 12,
bold: styleAttributes.bold ?? false,
italic: styleAttributes.italic ?? false)
let fontMetrics = UIFontMetrics(forTextStyle: .body)
let scaledFont = fontMetrics.scaledFont(for: font)
Then scaledFont.pointSize has value 12. I was expecting 17, so I must be doing something wrong. Any suggestion?
The function fontWithNameAndTraits is:
class func fontWithNameAndTraits(_ name:String, size:CGFloat, bold:Bool, italic:Bool)-UIFont {
let fontRef = UIFont.getFontRefForNameAndTraits(name, size:size, bold:bold, italic:italic)
let fontNameKey = CTFontCopyName(fontRef , kCTFontPostScriptNameKey)! as String
return UIFont(name: fontNameKey as String, size:CTFontGetSize(fontRef ))!
}
I am trying to upload app previews for iPad having done so successfully for iPhone. No matter how hard I try the store rejects them claiming "Your app preview contains unsupported or corrupted Audio". I am using Mac OS Ventura. Has anyone else hit this issue?
I'm suddenly getting this error when distributing an app that uploaded ok a couple of days ago. Nothing had changed. The associated message is: Profile doesn't include the selected signing certificate. I've checked the certificates and they are OK. I am using automatic signing. Any ideas?
I tried coding along with the WWDC23 'Dive Deeper into SwiftData' video but can't get the sample code to compile.
For example the Card class fails with lots of errors associated with @Model. The first of these is: Type 'Card' does not conform to protocol 'PersistentModel'
import SwiftUI
import SwiftData
@Model
final class Card {
var front: String
var back: String
var creationDate: Date
init(front: String, back: String, creationDate: Date = .now) {
self.front = front
self.back = back
self.creationDate = creationDate
}
}
On the other hand the following stand alone code (in it's own project) compiles without error. So I am confused and a little fed up with Apple publishing sample code that doesn't compile.
import SwiftData
@Model
final class Card {
var front: String
var back: String
var creationDate: Date
init(front: String, back: String, creationDate: Date = .now) {
self.front = front
self.back = back
self.creationDate = creationDate
}
}
struct ContentView: View {
var body: some View {
VStack {
Image(systemName: "globe")
.imageScale(.large)
.foregroundStyle(.tint)
Text("Hello, world!")
}
.padding()
}
}
#Preview {
ContentView()
}
I have encountered an issue with nested view updates that I don't understand. Maybe someone can explain what is happening.
In the code below the ContentView loads 2 views in succession. MyView1 followed by MyView2. MyView displays a button while MyView2 displays the value of its first argument. When the button is pressed MyView1 changes the value of its bound first argument. The ContentView is reloaded because of the change to its first argument. This results in MyView1 and MyView2 both being loaded again. Looked at from a procedural point of view this isn't what I was expecting.
import SwiftUI
@main
struct MyApp: App {
var body: some Scene {
WindowGroup {
ContentView()
}
}
}
struct ContentView: View {
@State var mydata1:Int = 0
@State var mydata2:Int = 1
var body: some View {
VStack {
Text("Hello world \(mydata1)")
MyView1(v1:$mydata1, v2:$mydata2)
Text(" myData1 = \(mydata1) myData2 = \(mydata2) ")
MyView2(v1:$mydata1, v2:$mydata2)
Text("Bye bye \(mydata1)")
}
}
}
struct MyView1:View {
@Binding var v1:Int
@Binding var v2:Int
var body: some View {
Text("MyView1")
if $v1.wrappedValue == 0 {
Button(action: {
$v1.wrappedValue = 10
}, label: {
Text("OK")
})
}
}
}
struct MyView2:View {
@Binding var v1:Int
@Binding var v2:Int
var body: some View {
Text("MyView2")
if $v1.wrappedValue == 0 {
Text("v1 = \(v1) v2 = \(v2) ")
}
else {
Text("???")
}
}
}
Where can I download the code for this app? I know its listed on the video page, but I would like a link to somewhere to download it
I'm getting a fatal error in a preview:
fatalError in Environment+Objects.swift at line 34.
Anyone any idea how to find this file