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
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
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()
}
}
}
Hi,
I'm currently developing an Apple Watch app with Swift and Storyboards.
The main screen consists of three buttons going to three different view controllers. When I go to one view controller, it doesn't display the normal back "" button at the top-left corner, even though it works.
I tried this with an older project, with a similar setup and it works as it should.
I have no code to show because it works like it should. It seems to be with the storyboard.
Anyone else have this problem?
Thanks,
Dan Uff
The code is exactly the same in both projects, with
Topic:
App & System Services
SubTopic:
General
Tags:
Watch Connectivity
WatchKit
watchOS
Apple Watch
Hi,
I'm in the process of developing a weather app using WeatherKit. Everything seems to be working fine in the Simulator, but when I put it on the device (iPhone 13 Pro Max) the temperature displays wrong.
Example:
On Simulator: 34 F
On Device: 34.98 F
Anyone else have this problem?
Dan Uff
Hi,
I've been having problems with the AVFoundation and getting text to speech to work with iOS 16.
I have a button which activates the text to speech that says the time. It worked with iOS 15 but not 16. Anyone else having a problem?
Here's the code: (Note: dtd is coming from another Swift file).
import Foundation
import AVFoundation
struct SUINightMode: View {
@ObservedObject var dtd = DateTimeData()
@Environment(\.presentationMode) var presentationMode
@State private var date = Date()
var body: some View {
ZStack {
Color.black
.ignoresSafeArea()
GeometryReader { cen in
VStack (alignment: .center) {
Text("\(dtd.timeString(date: dtd.date))")
.foregroundColor(.green)
.font(.system(size: 120, weight: .bold, design: .rounded))
.alignmentGuide(VerticalAlignment.center, computeValue: { $0[.bottom] })
.position(x: cen.size.width / 2, y: cen .size.height / 2)
HStack(alignment: .center) {
Text("\(dtd.dayString(date: dtd.date)), ")
.foregroundColor(.green)
.font(.system(size: 50, weight: .bold, design: .rounded))
Text("\(dtd.dateString(date: dtd.date))")
.foregroundColor(.green)
.font(.system(size: 50, weight: .bold, design: .rounded))
}
}
Image(systemName: "speaker.wave.3.fill")
.resizable()
.foregroundColor(.green)
.frame(width: 50, height: 30)
.padding(10)
.position(x: 120, y: 40)
.onTapGesture {
let synthesizer = AVSpeechSynthesizer()
let speakTime = AVSpeechUtterance(string: "The time is, \(dtd.timeString(date: dtd.date))...., today is \(dtd.dayString(date: dtd.date)) \(dtd.dateString(date: dtd.date))")
synthesizer.speak(speakTime)
}
Image(systemName: "arrow.left")
.resizable()
.foregroundColor(.green)
.frame(width: 45, height: 30)
.position(x: 40, y: 40)
.onTapGesture {
presentationMode.wrappedValue.dismiss()
}
.onAppear(perform: {let _ = self.dtd.updateTimer})
}
}
}
}
struct SUINightMode_Previews: PreviewProvider {
static var previews: some View {
if #available(iOS 15.0, *) {
SUINightMode()
.previewInterfaceOrientation(.landscapeRight)
} else {
// Fallback on earlier versions
}
}
}
Hi,
I know its a simple thing, but I cannot figure it out.
I have a list of items going to another view using NavigationStack. Everything seems fine, but when I go into the list, I have two back buttons, the title is shifted down, and its just annoying.
Thanks for the help.
Here's my code:
struct ImportantNumbers: View {
var body: some View {
NavigationStack {
List(INDDataService.getAll(), id: \.id) { data in
NavigationLink(value: data)
{
HStack {
Image(systemName: "circle.fill")
.foregroundColor(.green)
Text(data.name)
.fontWeight(.bold)
.navigationTitle("Important U.S. ADA Numbers")
.navigationBarTitleDisplayMode(.inline)
}
.navigationDestination(for: INDData.self) { data in
Spacer()
Image(data.logo)
.resizable()
.frame(width: 200, height: 200)
Spacer()
Text(data.phone)
.font(.system(size: 30, weight: .bold, design: .rounded))
Spacer()
.navigationTitle(data.name)
}
}
}
}
}
}
struct ImportantNumbers_Previews: PreviewProvider {
static var previews: some View {
ImportantNumbers()
}
}
Hi,
I've revised some apps that work on WatchOS via iOS. The WatchOS app works fine in the simulator, but when I try and run it on an actual watch, it either crashes immediately or shows a blank screen.
I've enabled developer's mode.
Is anyone else having issues?
Thanks,
Dan Uff
Hi,
I'd like to work on adding support for an app for the Vision Pro, but am unable to install the simulator. Xcode tries to install it but comes up with a blank error box.
When I try and manually add it in the Devices & Simulators section, the Vision Pro isn't listed.
Is anyone else having this problem?
Xcode
Version 15.0.1 (15A507)
Thanks,
Dan Uff
Hi, I am receiving the above error after trying to upload it to the App Store.
I would know what to do IF Xcode would provide WHICH file is corrupt.
The error reads:
ITMS-90013: Corrupt Image File - The image file $[IconName] appears to be corrupt.
Again, I would know what to do if I had more information about which file(s) to fix.
Could anyone FROM APPLE help me or give me a hint?
Thanks, Dan Uff
Hi,
Lately, I've been getting the same window each time I install an app for testing. Anyone else?
Hi all,
I have WeatherKit working on iOS and watchOS, but am having problems getting it to work on macOS. I have all entitlements enabled and everything seems to checkout, but I get the following error:
"WARNING: error = 3→(76) INVALID_PERSONA; It is undefined behavior to look up a container with a persona other than personal or data separated. Please adopt a persona first. Assuming personal. given persona = (<MCMUserIdentity: 0xb3d0288c0; posixUser = (501|20|danuff|/Users/danuff), identifier = 501, personaType = unspecific, personaUniqueString = E90578C5-AAE4-44DD-9E41-CC3F97B34F0C, kernelPersonaID = 1001>)
Message from debugger: killed
Any ideas?
I discovered a disk space issue with Xcode on my 1TB hard disk. Xcode doesn’t delete old or unused Simulators, causing them to mix and consume valuable space. Deleting them from the Window > Devices & Simulators menu didn’t work, so I used Disk Utility to find and delete them. However, they persisted.
To regain disk space, I completely removed Xcode and the Developer Folder. After reinstalling Xcode, I regained about 80% of my disk space. Despite unmounting the Simulators, they remained.
For those unable or unwilling to do this, the Mac App Store offers DevCleaner, a utility that removes old Xcode Cache and Simulators.
Thanks. I hope I've helped someone else.
Dan Uff
Hi,
I've been running Xcode 26 beta ever since Beta 1 and haven't had rebooting problems. Now with Xcode beta (Version 26.0 beta 4 (17A5285i)) I'll be working on a project when the system (Mac mini 2025) suddenly reboots itself. This has been going on since beta 3. I am also running MacOS 26.0 Beta (25A5316i). I have filed a bug report.
Is anyone else having this problem?
Thanks,
Dan Uff
Hi,
I am writing this to WARN other developers about a problem that I have run into with Xcode 13.3 (13e113).
Ever since downloading this version, I have noticed that my apps have bloated in size. From 23mb to 55mb and above. After an investigation, I noticed that Xcode was duplicating project and other files. Such as [nameofproject] [nameofproject2], etc. Because of this, not only did my project get bloated, but when I try to delete some of the duplicate files (yes, I know what to delete and what NOT too) this would then allow Xcode to delete even MORE FILES each time I went into the project. There is nothing worse then going into a project that you've worked MONTHS on and seeing RED FILES inside the project (red files means not there).
So, I keep backups of all my apps. Restoring these backups cause the same problems.
This is a notice to all developers -> CHECK YOUR PROJECT FILES FROM THE FINDER so you don't experience this problem.
I would HOPE someone from Apple will see AND READ this and maybe even CONTACT ME so I can make DAMN sure this never happens again.
Thank you,
Dan Uff