I am unable to install the above beta on an 2018 iPad Pro. Downloaded directly from this web site.Any ideas?Dan Uff
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
Hi,How would I go about using the standard WebKit delegates in SwiftUI, such as:func webView(_ webView: WKWebView, didCommit navigation: WKNavigation!)
{
activityView?.startAnimating()
self.title = "Loading...."
}Here's what I have so far:import SwiftUI
import UIKit
import Foundation
import WebKit
struct Support: View {
var body: some View {
NavigationView {
VStack {
WebView(request: URLRequest(url: URL(string: "https://www.connectingpeoplesoftware.com/iossupport")!))
}.navigationBarTitle(Text("Support"))
}
}
struct WebView: UIViewRepresentable
{
let request: URLRequest
func makeUIView(context: Context) -> WKWebView
{
return WKWebView()
}
func updateUIView(_ uiView: WKWebView, context: Context)
{
uiView.load(request)
}
}
struct Support_Previews: PreviewProvider {
static var previews: some View {
Support()
}
}
}Thanks in advance,Dan
Hi all,
I'm testing an app that uses AVFoundation for speech. It works in iOS 13 but not 14. Here's the terminal output:
2020-06-26 13:21:09.832216-0400 CPSpeak2Me[1428:34231] [plugin] AddInstanceForFactory: No factory registered for id <CFUUID 0x60000288c0c0> F8BB1C28-BAE8-11D6-9C31-00039315CD46
2020-06-26 13:21:09.863918-0400 CPSpeak2Me[1428:34268] Creating client/daemon connection: B41FDA39-C097-4773-BBEC-ACEDA0C43CB3
2020-06-26 13:21:09.912054-0400 CPSpeak2Me[1428:34268] Got the query meta data reply for: com.apple.MobileAsset.VoiceServicesVocalizerVoice, response: 0
2020-06-26 13:21:09.933646-0400 CPSpeak2Me[1428:34268] Consumed extension
2020-06-26 13:21:09.935578-0400 CPSpeak2Me[1428:34268] getLocalPath asset com.apple.MobileAsset.VoiceServicesVocalizerVoice bd610ebf3cdee47a506b603c116b87c052feb5e6 local path is '/tmp/com.apple.mobileassetd/AssetsV2/comappleMobileAssetVoiceServicesVocalizerVoice/bd610ebf3cdee47a506b603c116b87c052feb5e6.asset/AssetData', exists: NO, unable to update last access time 2 (MAOperationFailed)
2020-06-26 13:21:09.937481-0400 CPSpeak2Me[1428:34268] getLocalPath asset com.apple.MobileAsset.VoiceServicesVocalizerVoice bd610ebf3cdee47a506b603c116b87c052feb5e6 local path is '/tmp/com.apple.mobileassetd/AssetsV2/comappleMobileAssetVoiceServicesVocalizerVoice/bd610ebf3cdee47a506b603c116b87c052feb5e6.asset/AssetData', exists: NO, unable to update last access time 2 (MAOperationFailed)
2020-06-26 13:21:09.939390-0400 CPSpeak2Me[1428:34268] getLocalPath asset com.apple.MobileAsset.VoiceServicesVocalizerVoice b42ef77f9de60534a8f5a56d277d965771dead47 local path is '/tmp/com.apple.mobileassetd/AssetsV2/comappleMobileAssetVoiceServicesVocalizerVoice/b42ef77f9de60534a8f5a56d277d965771dead47.asset/AssetData', exists: NO, unable to update last access time 2 (MAOperationFailed)
2020-06-26 13:21:09.941170-0400 CPSpeak2Me[1428:34268] getLocalPath asset com.apple.MobileAsset.VoiceServicesVocalizerVoice bd76bcbd96e58eee5fd3549ef5351567ad7f7509 local path is '/tmp/com.apple.mobileassetd/AssetsV2/comappleMobileAssetVoiceServicesVocalizerVoice/bd76bcbd96e58eee5fd3549ef5351567ad7f7509.asset/AssetData', exists: NO, unable to update last access time 2 (MAOperationFailed)
2020-06-26 13:21:09.942848-0400 CPSpeak2Me[1428:34268] getLocalPath asset com.apple.MobileAsset.VoiceServicesVocalizerVoice e76e4f07eb38fe8dadb9fc4a617e9763d1db2604 local path is '/tmp/com.apple.mobileassetd/AssetsV2/comappleMobileAssetVoiceServicesVocalizerVoice/e76e4f07eb38fe8dadb9fc4a617e9763d1db2604.asset/AssetData', exists: NO, unable to update last access time 2 (MAOperationFailed)
2020-06-26 13:21:09.944485-0400 CPSpeak2Me[1428:34268] getLocalPath asset com.apple.MobileAsset.VoiceServicesVocalizerVoice 8174961b8c786e5a13efb7adec17fedf72bf6fc9 local path is '/tmp/com.apple.mobileassetd/AssetsV2/comappleMobileAssetVoiceServicesVocalizerVoice/8174961b8c786e5a13efb7adec17fedf72bf6fc9.asset/AssetData', exists: NO, unable to update last access time 2 (MAOperationFailed)
2020-06-26 13:21:09.946085-0400 CPSpeak2Me[1428:34268] getLocalPath asset com.apple.MobileAsset.VoiceServicesVocalizerVoice 3c2c67350365770ef4a3d9ae26435b97fad58d2d local path is '/tmp/com.apple.mobileassetd/AssetsV2/comappleMobileAssetVoiceServicesVocalizerVoice/3c2c67350365770ef4a3d9ae26435b97fad58d2d.asset/AssetData', exists: NO, unable to update last access time 2 (MAOperationFailed)
2020-06-26 13:21:09.947891-0400 CPSpeak2Me[1428:34268] getLocalPath asset com.apple.MobileAsset.VoiceServicesVocalizerVoice bd610ebf3cdee47a506b603c116b87c052feb5e6 local path is '/tmp/com.apple.mobileassetd/AssetsV2/comappleMobileAssetVoiceServicesVocalizerVoice/bd610ebf3cdee47a506b603c116b87c052feb5e6.asset/AssetData', exists: NO, unable to update last access time 2 (MAOperationFailed)
2020-06-26 13:21:09.949292-0400 CPSpeak2Me[1428:34268] getLocalPath asset com.apple.MobileAsset.VoiceServicesVocalizerVoice bd610ebf3cdee47a506b603c116b87c052feb5e6 local path is '/tmp/com.apple.mobileassetd/AssetsV2/comappleMobileAssetVoiceServicesVocalizerVoice/bd610ebf3cdee47a506b603c116b87c052feb5e6.asset/AssetData', exists: NO, unable to update last access time 2 (MAOperationFailed)
2020-06-26 13:21:10.021210-0400 CPSpeak2Me[1428:34268] Got the query meta data reply for: com.apple.MobileAsset.VoiceServices.VoiceResources, response: 0
2020-06-26 13:21:10.023477-0400 CPSpeak2Me[1428:34268] Consumed extension
2020-06-26 13:21:10.024774-0400 CPSpeak2Me[1428:34268] getLocalPath asset com.apple.MobileAsset.VoiceServices.VoiceResources a4a4fa16475de8a1e60dfe92582ddb15bb5fa013 local path is '/tmp/com.apple.mobileassetd/AssetsV2/comappleMobileAssetVoiceServicesVoiceResources/a4a4fa16475de8a1e60dfe92582ddb15bb5fa013.asset/AssetData', exists: YES
2020-06-26 13:21:10.235860-0400 CPSpeak2Me[1428:34296] HALBIOBufferManagerClient::GetIOBuffer: the stream index is out of range
2020-06-26 13:21:10.236138-0400 CPSpeak2Me[1428:34296] HALBIOBufferManager_Client::GetIOBuffer: the stream index is out of range
2020-06-26 13:21:10.248193-0400 CPSpeak2Me[1428:34296] [aqme] 255: AQDefaultDevice (1): output stream 0: null buffer
2020-06-26 13:21:10.248690-0400 CPSpeak2Me[1428:34296] [aqme] 1778: EXCEPTION thrown (-50): error != 0
Message from debugger: Terminated due to signal 15
```
Hi.
I've been trying to build a widget from the documentation and the WWDC 2020 code-along videos.
I've been trying to preview the widget in Xcode using the code from the WWDC Videos, but keep getting an "Unrecoverable error."
Is the preview working for Wigets, or is this planned for a future update?
BTW, I did try to get a copy of the error, but that doesn't seem to be working either.
Thanks,
Dan Uff
I'm trying to go by the example of the documentation "Keeping a widget up to date" by showing the current time and date, and am using the example below. It throws an error at the let futureDate statement that says, "Cannot use instance member 'components' within property initializer; property initializers run before 'self' is available"
Here's the section of code that's in the EntryView. BTW, the Widget is called CPCWidget.
var entry: Provider.Entry
let components = DateComponents(minute: 11, second: 14)
let futureDate = Calendar.current.date(byAdding: components, to: Date())!
var body: some View {
VStack(alignment: .center, spacing: 0) {
Text(futureDate, style: .relative)
.font(.largeTitle)
Text(entry.date, style: .relative)
.font(.custom("Times New Roman", size: 20))
}
}
Hi,
I am in the process of developing an add-on widget for one of my apps that must show a new date at midnight local time.
I've tried using the default widget code, and changing the line to:
let entry = SimpleEntry(date: entryDate)
entries.append(entry)
Could someone give me a "hint" on what to do?
Thanks,
Dan
Hi all,
I'm getting a new warning which says:
init(kind:provider:placeholder:content:)' is deprecated: use init(kind:provider:content:) instead
Which I changed according to the above, then got:
Incorrect argument label in call (have 'kind:provider:content:_:', expected 'kind:provider:placeholder:content:')
Tried to look in the Widget docs and they aren't updated yet.
Thanks,
Dan Uff
Hi all,
How can one show thew current day? I tried using the normal dateformatter option, but it doesn't seem to work. Below is my code:
static var dateformatter: DateFormatter =
{
// Get Current Date:
let dateformatter = DateFormatter()
dateformatter.dateStyle = .medium
// Get Day of Week:
let theWeekday = Calendar(identifier: .gregorian)
let currentDay = theWeekday.component(.weekday, from: Date())
return dateformatter
}()
var currentDate = Date()
var currentDay = Date()
var entry: Provider.Entry
var body: some View {
ZStack {
Color.black
.edgesIgnoringSafeArea(.all)
VStack {
Text("Today Is:")
.background(Color.black)
.foregroundColor(Color.white)
.font(.custom("DIN Alternate-Bold", size: 25))
.multilineTextAlignment(.center)
let dateTimeString = PlaceholderView.CPClockWidgetEntryView.dateformatter.string(from: currentDate)
Text("\(dateTimeString)")
.background(Color.black)
.foregroundColor(Color.white)
.font(.custom("DIN Alternate-Bold", size: 30))
.multilineTextAlignment(.center)
let dateTimeString2 = PlaceholderView.CPClockWidgetEntryView.dateformatter.string(from: currentDay)
Text("\(dateTimeString2)")
.background(Color.black)
.foregroundColor(Color.white)
.font(.custom("DIN Alternate-Bold", size: 30))
.multilineTextAlignment(.center)
}
}
}
}
Hi,
My widget has been working flawlessly until upgrading to the above beta. Now I get:
"Type 'Provider' does not conform to protocol 'TimelineProvider'"
But it has been until this version of Xcode. Attached is my code.
Thanks for the help
Dan Uff
Hi,
Is there anyway to remove (delete) a widget from a project? We would like to do so, so we can release an app without a widget until the GM version comes out.
Thanks,
Dan Uff
I just seen a discussion that had to do with App Groups. What’s the difference between App Groups and iCloud?
Thanks,
Dan Uff
Hi,
I have a json file that I have it printing to the terminal, but now I want to have the output go to an iPhone, iPad, and Apple Watch screen. Here's what I have in the viewDidLoad section....
override func viewDidLoad() {
super.viewDidLoad()
let data = GetData().$userData
print(data)
// Immediately get a quote upon app entry.
//getQuote()
}
The $userdata and data are defined in another file. Again, everything parses fine in the terminal.
If you need the other part of the code, please let me know.
Thanks,
Dan Uff
Hi,
I have a toolbar and a share button on the left side. The button isn't showing up on the canvas, but does show when the app is run in the simulator or a device. Is this normal behavior or a bug? This is a test button so please forgive the print statement.
Here's the code:
{
ToolbarItem(placement: .bottomBar)
{
Button(action: {
print ("Button Pressed!")
}
){
Image(systemName: "square.and.arrow.up")
}
}
}
Hi,
I am looking for opinions on the best way to handle a problem I'm having.
My client wants his app to show a list of math tables, such as 1+1 = 2, 2+2 = 4, and so on. I have a list view with said tables in an array, which I manually have to input in. He wants the list to go from 1 to 20.
I'd assume that I would need some sort of for....next loop, but how would I show that in a list?
Thanks for any help you can give.
This is what I have so far:
import SwiftUI
import UIKit
struct ATables: View {
var tables = ["Temporary","1 + 1 = 2","2 + 2 = 4"]
var body: some View {
NavigationView {
List {
ForEach(self.tables, id: \.self) { show in
HStack {
Image(systemName: "arrow.right")
.resizable()
.frame(width: 30, height: 20, alignment: /*@START_MENU_TOKEN@*/.center/*@END_MENU_TOKEN@*/)
Text(show)
.font(.custom("Chalkboard", size: 50))
}
}
}.navigationBarTitle(Text("Addition Tables (1 - 20)"))
.navigationBarTitleDisplayMode(.inline)
}
}
struct ATables_Previews: PreviewProvider {
static var previews: some View {
ATables()
}
}
}
Okay, I give up.
I am making a Flash card game where the app will randomize two numbers, then the user would enter the answer. The app will then tell the user if he/she is correct. But I cannot seem to figure out how to get it to add two numbers and check if the user's correct or not.
Any help is greatly appreciated!
Here's the code:
import UIKit
import AVFoundation
import Foundation
class YouSolveIt: UIViewController {
@IBOutlet var topProblem: UILabel!
@IBOutlet var botProblem: UILabel!
@IBOutlet var youAnswer: UITextField!
@IBOutlet var actualCard: UIImageView!
let speakit = AVSpeechSynthesizer()
var problem1 = Int(0)
var problem2 = Int(0)
var answer = 0
var ranA = 0
var ranB = 0
override func viewDidLoad() {
super.viewDidLoad()
// Load Flash Card image:
actualCard.image = UIImage(named: "FlashCard")
solveitproblem()
}
func solveitproblem()
{
let ranA = Int(arc4random_uniform(UInt32(9)))
let ranB = Int(arc4random_uniform(UInt32(9)))
topProblem.text = String(ranA)
botProblem.text = String(ranB)
youAnswer.text = String(answer)
let speakProblem = AVSpeechUtterance(string: "What is \(topProblem.text! + ", plus ," + botProblem.text!)")
speakit.speak(speakProblem)
}
@IBAction func btncheckAnswer(_ sender: Any)
{
if (ranA) + (ranB) == answer
{
correctAnswer()
}
else {
wrongAnswer()
}
}
func correctAnswer()
{
let right = [1,2,3,4,5]
let randomIndex = Int(arc4random_uniform(UInt32(right.count)))
switch(randomIndex)
{
case 1:
let speakRight = AVSpeechUtterance(string: "That is correct")
speakit.speak(speakRight)
youAnswer.text = ""
solveitproblem()
case 2:
let speakRight = AVSpeechUtterance(string: "You're right!")
speakit.speak(speakRight)
youAnswer.text = ""
solveitproblem()
case 3:
let speakRight = AVSpeechUtterance(string: "Correct! Let's try.")
speakit.speak(speakRight)
youAnswer.text = ""
solveitproblem()
case 4:
let speakRight = AVSpeechUtterance(string: "You are right! Next Try.")
speakit.speak(speakRight)
youAnswer.text = ""
solveitproblem()
case 5:
let speakRight = AVSpeechUtterance(string: "Great answer!")
speakit.speak(speakRight)
youAnswer.text = ""
solveitproblem()
default:
let speakRight = AVSpeechUtterance(string: "Very good!")
speakit.speak(speakRight)
youAnswer.text = ""
solveitproblem()
}
}
func wrongAnswer()
{
let wrong = [1,2,3,4,5]
let randomIndex = Int(arc4random_uniform(UInt32(wrong.count)))
switch(randomIndex)
{
case 1:
let speakRight = AVSpeechUtterance(string: "That is wrong")
speakit.speak(speakRight)
case 2:
let speakRight = AVSpeechUtterance(string: "You're wrong, please try again.")
speakit.speak(speakRight)
case 3:
let speakRight = AVSpeechUtterance(string: "No, that's not it. Please try again.")
speakit.speak(speakRight)
case 4:
let speakRight = AVSpeechUtterance(string: "No")
speakit.speak(speakRight)
default:
let speakRight = AVSpeechUtterance(string: "I'm sorry, no. Please try again.")
speakit.speak(speakRight)
}
}
}