Would like to be able to bring up the iOS keyboard in a SwiftUI view without having to use a TextField? The goal would be to capture each keyup, or keydown, using .onKeyPress
While I thought I could create a TextField not visible to the user, was hoping there was a cleaner way.
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
Is there any app out there that lets you browse through a CoreData database? When I first started to learn Swift, an app called Liya seemed to work. But alas, no longer.
it would just make it easier if there was anything out there that let you browse the data directly.
Thanks
Can I open two separate Xcode windows with the same project ?
I have multiple monitors, so would love to be able use them to view different files of the same project.
Is there a way?
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.
Topic:
Developer Tools & Services
SubTopic:
Xcode
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.
Is there a Finder type app that will read through my iPhone files?
I’m working on a app that records audio files to my iPhone, and it would be much easier if I could find an app where I could scroll through the files on my iPhone from my desktop as opposed to doingit on the iPhone itself.
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()
}
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)"
I find Xcode's Debugging Variable View to be to cluttered, even when just watching "local" variables.
Is there anyway to set it so that it only shows the variables I want to watch? Would make debugging so much easier.
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)")
}
}
}
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)")
}
}
}
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
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.
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
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?