What should I do?
Post
Replies
Boosts
Views
Activity
How do you wait for a AVSpeechSynthesis text to speech to finish to change the state of a Control in SwiftUI?
https://www.hackingwithswift.com/forums/swift/xctest-is-not-documented-paul-s-page-on-xctest-is-unclear/17122
Does anyone have a step-by-step "official" guide to getting MusicKit working with iOS inside Xcode when developing an app in Swift?
Is there a working, sample code for GroupActivity API for all platforms?
This code doesn't work. What should I do when it stops prematurely?
import Foundation
import AVFoundation
print("Hello, World!")
var synthesizer = AVSpeechSynthesizer()
let utterance = AVSpeechUtterance(string: "Hello World!")
utterance.voice = AVSpeechSynthesisVoice(identifier: "com.apple.speech.synthesis.voice.samantha.premium")
utterance.rate = 0.5
synthesizer.speak(utterance)
print("Done.")
How do you package Screen Savers for App Store submission? I would like to put my screen savers on the App Store but I am unsure how to do so.Thanks!
The State variable that is used for the stiffness.@State private var stiffnessAmount: CGFloat = 1The Slider here sets the value, range, and step size.Slider(value: $stiffnessAmount, in: 1...10, step: 1)Text with modifier for the animation doesn't change its stiffnessAmount even though the Slider above: Text("Look here!")
.animation(
Animation.interpolatingSpring(stiffness: Double(stiffnessAmount), damping: 0)
.repeatCount(Int(animationCount), autoreverses: false)
)I changed the value using the Slider during runtime and then animation stiffness doesn't change.Why is it not working?
Do you have any examples for this on the Web or can you create one?
Are there any Apple or non-Apple examples of using SwiftUI with OAuth libraries (for Twitter access) on Github with MacOS instead of the ones already available for iOS?Thanks!
Anyone have have a step-by-step guide to create a Swift/Obj-C framework?
I have the following snippet of SwiftUI code using MapKit for iOS using MacOS Catalyst mode. The output of the code shows a large white box with the MapKit but that is not shown in the MacOS version using Cocoa with NS instead of UI. What is the problem?import SwiftUI
import MapKit
struct ContentView: View {
@State var date = Date()
var body: some View {
HStack {
NavigationView {
MapView()
.edgesIgnoringSafeArea(.all)
}
VStack(alignment: .leading) {
...
}
}
}
}
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ContentView()
}
}
struct MapView: UIViewRepresentable {
typealias NSViewType = MKMapView
// 1.
func makeUIView(context: UIViewRepresentableContext<MapView>) -> MKMapView {
MKMapView(frame: .zero)
}
// 2.
func updateUIView(_ uiView: MKMapView, context: UIViewRepresentableContext<MapView>) {
// 3.
let location = CLLocationCoordinate2D(latitude: 30.0,
longitude: 0.0)
// 4.
let span = MKCoordinateSpan(latitudeDelta: 0.05, longitudeDelta: 0.05)
let region = MKCoordinateRegion(center: location, span: span)
uiView.setRegion(region, animated: true)
// 5.
let annotation = MKPointAnnotation()
annotation.coordinate = location
annotation.title = "Big Ben"
annotation.subtitle = "London"
uiView.addAnnotation(annotation)
}
}
Where is a bank of examples for using each function in PDFKit?
What is going on?https://github.com/shyamalschandra/ARTetrisPlease help.
What is the purpose of functions being first-class types in Swift 5+?Where does this usage occur and in what hypothetical scenarios?The following example from The Swift Programming Language book on iBooks as follows:func makeIncrementer() -> ((Int) -> Int) {
func addOne(number: Int) -> Int {
return 1 + number
}
return addOne
}
var increment = makeIncrementer()
increment(7)