Posts

Post not yet marked as solved
0 Replies
392 Views
My app uses UNMutableNotificationContent() to play a custom sound, and has a phrase as a message. I just got a vehicle with CarPlay. When my iPhone is connected to CarPlay, when the notification goes off at a time, it shows on the iPhone, but does not make any noise whatsoever. What I'd like to happen, is for CarPlay to announce the message when the notification goes off, like it does with Apple's messages app. As my phone is set right now, when I have my airPods in, it will announce the notification from my app. But not for CarPlay. What do I need to add to my app to allow CarPlay to announce the message that comes in from a notification (again, local, not a push notification).
Posted
by ShadowDES.
Last updated
.
Post not yet marked as solved
0 Replies
745 Views
I have just created a new business developer account, and I have transferred all of my apps to it. That was easy. The app id's are all in my new account. If I create a new Xcode project, I can install it on the actual device with no issues. My problem is when I try to update one of my apps that i've downloaded from the App store. I get the message "Unable to install 'appName'". I've been googling for 24 hours, trying to look into this. I found a post that stated that this isn't an issue for users when I finally get around to sending an update to the AppStore. I have made a provisional profile for the app, and after temporarily shutting off "Automatic Code Signing" I installed it. That didn't work either. No errors, just the "Unable to install" message.(I've switched back to "Automatic Code Signing" since that wasn't the problem.) So how do I update my app using the new developer account?
Posted
by ShadowDES.
Last updated
.
Post not yet marked as solved
0 Replies
905 Views
I'm trying to record a phrase using AVSpeechSynthesizer.write. It appears to save "something", but when I try to play that back, nothing is played. Not sure where I'm going wrong (wrong file type, not actually saving a file, I don't have the play portion set correctly). Any help would be greatly appreciated. The "speakPhrase" function is just to prove that the AVSpeech is set up properly. That works just fine. import AVFoundation import Foundation class Coordinator {     let synthesizer: AVSpeechSynthesizer     var player: AVAudioPlayer?     init() {         let synthesizer = AVSpeechSynthesizer()         self.synthesizer = synthesizer     }     var recordingPath:  URL {         let soundName = "Finally.caf"         // I've tried numerous file extensions.  .caf was in an answer somewhere else.  I would think it would be         // .pcm, but that doesn't work either.         // Local Directory         let paths = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask)         return paths[0].appendingPathComponent(soundName)     }     func speakPhrase(phrase: String) {         let utterance = AVSpeechUtterance(string: phrase)         utterance.voice = AVSpeechSynthesisVoice(language: "en")         synthesizer.speak(utterance)     }     func playFile() {         print("Trying to play the file")         do {             try AVAudioSession.sharedInstance().setCategory(.playback, mode: .default)             try AVAudioSession.sharedInstance().setActive(true)                          player = try AVAudioPlayer(contentsOf: recordingPath, fileTypeHint: AVFileType.caf.rawValue)             guard let player = player else {return}                 player.play()         } catch {             print("Error playing file.")         }     }     func saveAVSpeechUtteranceToFile() {         let utterance = AVSpeechUtterance(string: "This is speech to record")         utterance.voice = AVSpeechSynthesisVoice(language: "en-US")         utterance.rate = 0.50         synthesizer.write(utterance) { [self] (buffer: AVAudioBuffer) in             guard let pcmBuffer = buffer as? AVAudioPCMBuffer else {                 fatalError("unknown buffer type: \(buffer)")             }             if pcmBuffer.frameLength == 0 {                 // Done             } else {                 // append buffer to file                 do {                     let audioFile = try AVAudioFile(forWriting: recordingPath, settings: pcmBuffer.format.settings, commonFormat: .pcmFormatInt16, interleaved: false)                     try audioFile.write(from: pcmBuffer)                 } catch {                     print(error.localizedDescription)                 }             }         }     } }
Posted
by ShadowDES.
Last updated
.
Post not yet marked as solved
4 Replies
3.2k Views
Is there an issue with App Store Connect and Sales & Trends? It is January 13th 2:48pm EST and the latest information it will gather is for January 10th. If you click on the calendar (ending date of), January 11 and January 12 are grayed out. I've never had this issue before. I did a search and there is a website that states that reports were updated.
Posted
by ShadowDES.
Last updated
.
Post not yet marked as solved
1 Replies
659 Views
let nofiticationCenter = NotificationCenter.default notificationCenter.addObserver(self, selector: #selector(keyBoardWillShow(notification:)), name: UIResponder.keyboardWillShowNotification, object: nil) Doesn't appear to work with Xcode 12 beta 1. Has something replaced UIResponder for keyboard notifications?
Posted
by ShadowDES.
Last updated
.
Post not yet marked as solved
0 Replies
575 Views
I'm creating my first macOS SpriteKit game. I have it so it resizes properly, but what should I set its initial size to? The default size that comes with the template seems way too small for all devices. Also does it make sense to set a minimum size, and what is best for that?
Posted
by ShadowDES.
Last updated
.
Post marked as solved
3 Replies
9.5k Views
Now that we are on the GM of Xcode, I'm still not getting something basic with background color. Below is just a test app. The goal is to make the entire background green, and the "cells" red. When you click on a cell, it goes to a sample detail, and the entire background is the correct green color. I've found workarounds that will allow the Navigation view to be green, but when I add the List, it goes back to white. I was just going to get rid of List and call it good, but then the edit button doesn't work (Edit button not shown in this example).Is there a way to make this background green on the ContentView?struct ContentView: View { var body: some View { NavigationView { List { ForEach(1...3, id: \.self) { index in NavigationLink( destination: DetailView()) { ContentCell() } .frame(height: 100) } } .navigationBarTitle("My List") }.background(Color.green)// Not working } } struct ContentCell: View { var body: some View { GeometryReader { geometry in VStack { Text("An item to display.") } .frame(width: (geometry.size.width), height: geometry.size.height, alignment: .center) .background(Color.red)// Working } } } struct DetailView: View { var body: some View { VStack { Text ("At the detail view") } .frame(minWidth: 0, maxWidth: .infinity, minHeight: 0, maxHeight: .infinity) .background(Color.green)// Working .edgesIgnoringSafeArea(.all) } }
Posted
by ShadowDES.
Last updated
.
Post not yet marked as solved
1 Replies
3.6k Views
Working on a sample app. The goal is to have a list pulled up from CoreData in a MasterView, and then click on one to go to a DetailView where you can edit the information and save. When you edit the "name" in the DetailView, it not only updates the DetailView to reflect the change, but it also reflects the change on the MasterView as well. I've tried numerous ways to accomplish this, but so far have not come up with an answer.// Code generation is turned OFF in the xcdatamodeld file public class EntityName: NSManagedObject, Identifiable { @NSManaged public var name: String @NSManaged public var active: Bool } extension EntityName { static func allEntityNameFetchRequest() -> NSFetchRequest<EntityName> { let request: NSFetchRequest<EntityName> = EntityName.fetchRequest() as! NSFetchRequest<EntityName> request.sortDescriptors = [NSSortDescriptor(key: "name", ascending: true)] return request } } struct MasterView: View { @Environment(\.managedObjectContext) var managedObjectContext @FetchRequest(fetchRequest: EntityName.allEntityNameFetchRequest()) var allEntityNames: FetchedResults<EntityName> var body: some View { NavigationView { List { ForEach(self.allEntityNames) { entityName in NavigationLink(destination: DetailView(entityName: entityName)) { VStack(alignment: .leading) { Text(entityName.name) .font(.headline) Text(String(entityName.active)) .font(.subheadline) } } } } } .onAppear() { // Just want to populate the Core Data to have a few to work with if self.allEntityNames.count == 0 { for _ in 1...3 { let newEntry = EntityName(context: self.managedObjectContext) newEntry.name = "New Entry" try! self.managedObjectContext.save() } } } } } struct DetailView: View { var entityName = EntityName() @State private var name = "" @State private var booley = false var body: some View { VStack { Text("Name: \(entityName.name)") Text("Active: \(String(entityName.active))") // What I'd like to do now: //TextField("", text: $entityName.name) //Toggle(isOn: $entityName.active) } } }
Posted
by ShadowDES.
Last updated
.
Post marked as solved
11 Replies
24k Views
I downloaded the new XCode 11 Beta this afternoon, found this Apple Tutorial, figured I'd start to take a peek at it. Made the sample app, as instructed. The "Canvas" isn't showing. I've clicked Editor - Editor & Canvas (that is checked). The left side of the screen looks just like the tutorial, but there is no "preview" iphone sort of sumultor. Clicked on all the little buttons, but have found nothing. Anyone get it to work?https://developer.apple.com/tutorials/swiftui/creating-and-combining-views
Posted
by ShadowDES.
Last updated
.