Post

Replies

Boosts

Views

Activity

How can I enable HTTP exceptions in Xcode 15?
Before Xcode 15, when I could access the info.plist file, I was able to add exceptions to the App Transport Security Settings so I could connect with my home server, which has no HTTPS, just HTTP. But in Xcode 15 I have no idea, not can I buy a clue with google, on how to do this. Please help! Thanks p.s. I should probably add that one site mentioned going to the Target section of your project allows easy access to info.plist. Yet for some strange reason, there is no item in Targets, which is odd, as I can debug my. project.
1
0
388
Jun ’24
How can I enable HTTP exceptions in Xcode 15?
Before Xcode 15, when I could access the info.plist file, I was able to add exceptions to the App Transport Security Settings so I could connect with my home server, which has no HTTPS, just HTTP. But in Xcode 15 I have no idea, not can I buy a clue with google, on how to do this. Please help! Thanks p.s. I should probably add that one site mentioned going to the Target section of your project allows easy access to info.plist. Yet for some strange reason, there is no item in Targets, which is odd, as I can debug my. project.
0
0
833
Jun ’24
Need help understanding a piece of logic in a piece of code involving ".background"
Am new enough to SwiftUI that I that are still some concepts that confuse me. Case in point: .background The code below is meant to detect when the user drags their finger over different areas, in this case three different size circles placed over each other. The code works, but I get lost trying to figure out how the logic works. .background calls a function that's a view builder, yet doesn't an actual view? Unless Color.clear is the view it's returning? I have more questions, but might as well start with .background since it comes first? I think? Thanks import SwiftUI struct ContentView: View { @State private var dragLocation = CGPoint.zero @State private var dragInfo = " " @State private var secondText = "..." private func dragDetector(for name: String) -> some View { GeometryReader { proxy in let frame = proxy.frame(in: .global) let isDragLocationInsideFrame = frame.contains(dragLocation) let isDragLocationInsideCircle = isDragLocationInsideFrame && Circle().path(in: frame).contains(dragLocation) Color.clear .onChange(of: isDragLocationInsideCircle) { oldVal, newVal in if dragLocation != .zero { dragInfo = "\(newVal ? "entering" : "leaving") \(name)..." } } } } var body: some View { ZStack { Color(white: 0.2) VStack(spacing: 50) { Text(dragInfo) .padding(.top, 60) .foregroundStyle(.white) Text(secondText) .foregroundStyle(.white) Spacer() ZStack { Circle() .fill(.red) .frame(width: 200, height: 200) .background { dragDetector(for: "red") } Circle() .fill(.white) .frame(width: 120, height: 120) .background { dragDetector(for: "white") } Circle() .fill(.blue) .frame(width: 50, height: 50) .background { dragDetector(for: "blue") } } .padding(.bottom, 30) } } .ignoresSafeArea() .gesture( DragGesture(coordinateSpace: .global) .onChanged { val in dragLocation = val.location secondText = "\(Int(dragLocation.x)) ... \(Int(dragLocation.y))" } .onEnded { val in dragLocation = .zero dragInfo = " " } ) } } #Preview { ContentView() }
1
0
548
Aug ’24
Strange error in com.apple.speech.localspeechrecognition that doesn't affect output?
While running Swift's SpeechRecognition capabilities I get the error below. However, the app successfully transcribes the audio file. So am not sure how worried I have to be, as well, would like to know that if when that error occurred, did that mean that the app went to the internet to transcribe that file? Yes, requiresOnDeviceRecognition is set to false. Would like to know what that error meant, and how much I need to worry about it? Received an error while accessing com.apple.speech.localspeechrecognition service: Error Domain=kAFAssistantErrorDomain Code=1101 "(null)"
0
0
778
Oct ’24
Is there anywhere to get precompiled WhisperKit models for Swift?
If try to dynamically load WhipserKit's models, as in below, the download never occurs. No error or anything. And at the same time I can still get to the huggingface.co hosting site without any headaches, so it's not a blocking issue. let config = WhisperKitConfig( model: "openai_whisper-large-v3", modelRepo: "argmaxinc/whisperkit-coreml" ) So I have to default to the tiny model as seen below. I have tried so many ways, using ChatGPT and others, to build the models on my Mac, but too many failures, because I have never dealt with builds like that before. Are there any hosting sites that have the models (small, medium, large) already built where I can download them and just bundle them into my project? Wasted quite a large amount of time trying to get this done. import Foundation import WhisperKit @MainActor class WhisperLoader: ObservableObject { var pipe: WhisperKit? init() { Task { await self.initializeWhisper() } } private func initializeWhisper() async { do { Logging.shared.logLevel = .debug Logging.shared.loggingCallback = { message in print("[WhisperKit] \(message)") } let pipe = try await WhisperKit() // defaults to "tiny" self.pipe = pipe print("initialized. Model state: \(pipe.modelState)") guard let audioURL = Bundle.main.url(forResource: "44pf", withExtension: "wav") else { fatalError("not in bundle") } let result = try await pipe.transcribe(audioPath: audioURL.path) print("result: \(result)") } catch { print("Error: \(error)") } } }
0
0
99
Jun ’25
Xcode can't find prepareCustomLanguageModel
I have Xcode 16 and am setting everything to a minimum target deployment to 17.5, and am using import Speech Never the less, Xcode doesn't can't find it. At ChatGPT's urging I tried going back to Xcode 15.3, but that won't work with Sequoia Am I misunderstanding something? Here's how I am trying to use it: if templateItems.isEmpty { templateItems = dbControl?.getAllItems(templateName: templateName) ?? [] items = templateItems.compactMap { $0.itemName?.components(separatedBy: " ") }.flatMap { $0 } let phrases = extractContextualWords(from: templateItems) Task { do { // 1. Get your items and extract words templateItems = dbControl?.getAllItems(templateName: templateName) ?? [] let phrases = extractContextualWords(from: templateItems) // 2. Build the custom model and export it let modelURL = try await buildCustomLanguageModel(from: phrases) // 3. Prepare the model (STATIC method) try await SFSpeechRecognizer.prepareCustomLanguageModel(at: modelURL) // ✅ Ready to use in recognition request print("✅ Model prepared at: \(modelURL)") // Save modelURL to use in Step 5 (speech recognition) // e.g., self.savedModelURL = modelURL } catch { print("❌ Error preparing model: \(error)") } } }
1
0
118
Jul ’25
Looking for book recommendations for game development
New to Macs and still learning Swift. My first goal is a game so I actually am looking for TWO recommendations:Is there an advantage to Swift vs. Objective C when programming game apps?Can anyone recommend a decent book for beginners? I'm not a beginner, however my last heavy experience was with Perl, C, and the WindowsSDK. So am behind the times.Thank you
6
0
1.3k
Feb ’21
Did Xcode 12.4 get rid of "storyboards" by default?
Haven't touched Xcode since it upgraded to 12.4. Just started a new app, which I planned to create without storyboards. But the default files I am used to deleting or manipulating aren't there anymore. I don't even see AppDelegate.swift. So did Xcode 12.4 get rid of "storyboards" by default? And if so, where do I go to relearn how to start? Thanks.
5
0
3.3k
Feb ’21
Problem again with user-defined setting
This was something I needed so much help with in this post https://developer.apple.com/forums/thread/666997 I want to add a user defined setting. As I did (from the answer in the previous post, I made sure I was adding in SWIFTACTIVECOMPILATION_CONDITIONS I added MYDEBUG01, which does not work. This is in Xcode 12.4 I put up both projects in a picture, the one where it does work is the bottom one, MYSCENES. This was in Xcode 11.x The screens do look a little different, but can't figure out where my error is. Here is the screenshot http:// 98.7.37.117/index.html
2
0
1.8k
Feb ’21
How can I execute animations for multiple SKSprintNodes at once?
I already know how to run multiple animations on the same SKSpriteNode at once: createPaths() let myIcon1 = MyIcon(wIcon: "screen", iSize: iSize) let move = SKAction.follow(iconPath[0], asOffset: false, orientToPath: false, duration: 1) let shrink = SKAction.resize(byWidth: -iSize.width/2, height: -iSize.width/2, duration: 1) let blur = SKAction.fadeAlpha(to: 0.6, duration: 1) let group = SKAction.group([shrink, move, blur]) myIcon1.run(group) But I have two more icons I would like to animate at the same time. Granted, with just 3 icons total I can't see any lag if I do something like this: myIcon1.run(group1) myIcon2.run(group2) myIcon3.run(group3) But surely there is a proper way to do this?
1
0
577
Feb ’21