Hi,
I'm trying to run.a project in Xcode 14 and I keep getting this warning::
warning build: Skipping duplicate build file in Copy Bundle Resources build phase: /Users/danuff/Documents/CPS/CPS-iOS/iOS 16/Projects (Current)/iPhone : iPad/SwiftUI/General/CAI/CAI/Databases/Phone List Data/JSON Data/UKPhoneNumbersList.json
and the project won't run. How can I resolve this?
Thanks,
Dan Uff
P.S. If this is in the wrong forum, I tried to find the Beta one but couldn't. Thanks.
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
Hi,
I'm in the process of writing my first Mac Menu Bar app. I must include a way to quit the app by the normal [Command+Q] option. I got the below code from a YouTube video and it works on the video, but not in my app. I am also using SwiftUI.
The code's filename is ApplicationMenu.swift and is written in Swift. According to the video (which I cannot include in this message) the below example shows the menu appearing at the bottom of the window, but when I do it, it doesn't show up.
Thank you.
Here's the code:
import SwiftUI
class ApplicationMenus: NSObject
{
let menu = NSMenu()
func createMenu() -> NSMenu
{
let clockView = ActualClock()
let topView = NSHostingController(rootView: clockView)
topView.view.frame.size = CGSize(width: 255, height: 255)
let customMenuItem = NSMenuItem()
customMenuItem.view = topView.view
menu.addItem(customMenuItem)
menu.addItem(NSMenuItem.separator())
let aboutMenuItem = NSMenuItem(title: "About",
action: #selector(about),
keyEquivalent: "")
aboutMenuItem.target = self
menu.addItem(aboutMenuItem)
return menu
}
@objc func about(sender: NSMenuItem)
{
NSApp.orderFrontStandardAboutPanel()
}
@objc func support(sender: NSMenuItem)
{
NSApp.orderFrontStandardAboutPanel()
}
}
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,
This is my first time using a list with different sections. I am using an example from a documented video that I found on the Internet.
I'm getting some weird results. Could someone point me in the right direction?
Here's the code:
import Foundation
struct History: Identifiable, Hashable
{
var id = UUID()
var hist: String
}
struct Titles: Identifiable, Hashable
{
var id = UUID()
var Titl: String
}
struct Library: Identifiable, Hashable
{
var id = UUID()
var lib: String
}
// Main Menu Options:
var commandsA: [History] = [History(hist: "History"),
History(hist: "Overview")]
var commandsB: [Titles] = [Titles(Titl: "Title 1: Employment"),
Titles(Titl: "Title 2: Public Service" ),
Titles(Titl: "Title 3: Public Accommidations"),
Titles(Titl: "Title 4: Telecommunication"),
Titles(Titl: "Title 5: Miscellous")]
var commandsC: [Library] = [Library(lib: "2010 Accessibilty Standards"),
Library(lib: "2008 ADA Amendments"),
Library(lib: "Phone Numbers"),
Library(lib: "More Information")]
struct MainMenu160: View {
@State private var path = NavigationPath()
var body: some View {
NavigationStack(path: $path) {
List {
Section(header: Text("Overview")) {
ForEach(commandsA) { secA in
HStack {
Image(systemName: "folder")
Text("\(secA.hist)")
}.font(.system(size: 20, weight: .bold, design: .rounded))
}
}
}
List {
Section(header: Text("Titles:")) {
ForEach(commandsB) { secB in
HStack {
Image(systemName: "folder")
Text("\(secB.Titl)")
}.font(.system(size: 20, weight: .bold, design: .rounded))
}
}
}
List {
Section(header: Text("Library:")) {
ForEach(commandsC) { secC in
HStack {
Image(systemName: "folder")
Text("\(secC.lib)")
}.font(.system(size: 20, weight: .bold, design: .rounded))
}
}
}.navigationTitle("ADA 1990")
.navigationBarTitleDisplayMode(.automatic)
}
}
struct MainMenu160_Previews: PreviewProvider {
static var previews: some View {
MainMenu160()
}
}
}
And here's the output:
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 have an existing iPhone/iPad app that I'm considering for Vision Pro. It's an informational app that shares info. with the watch.
What would be better:
To add a target for the vision pro.
Make a separate app so I can use all of the VP's features.
What are YOU doing to support the Vision Pro?
Thanks,
Dan
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,
On my company's website, I like to provide a direct app store link to an app that's currently listed using the official App Store buttons.
Will Apple be providing such access for Vision Pro apps? If so, where can I find this?
Thanks,
Dan Uff
Hi.
I am getting an error each time Xcode installs or upgrades itself.
The simulator goes through the download process and them I get another error that says "Disk Image Not Available". I got this with the Beta over the summer and now.
Anyone else have this problem?
Thanks,
Dan Uff
Hi,
Lately, I've been getting the same window each time I install an app for testing. Anyone else?
Hi,
This maybe somewhat confusing, but please bear with me.
I currently have an app in the App Store that supports iOS and tvOS. But the tvOS version was a separate app during the development process. I'd like to combine the iOS and tvOS app into one project so its easier to handle and keep track of internally.
Can I upload the new Apple TV version to the same place where the current one is, or would I have to delete the current Apple TV version before uploading the newly combined version?
I hope I made that clear enough :-)
Thank you,
Dan Uff
Hi,
This problem had gone away with the previous version, but its back with 16.3.
When I first go into Xcode, it normally shows me a list of previous projects. This seems to work some of the time, and not others. When it doesn't, I Quit Xcode, go back in, then the list appears again.
I also noticed each time I quit Xcode, I get the "beach ball icon" for 5-7 seconds and then it exits most of the time. When it doesn't, I have to issue a killall Xcode in the Terminal.
I have a brand new Mac mini M4, 24GB RAM, 2 TB SSDD.
Is anyone else having these issues?
Thank you,
Dan Uff
Hi,
I've uploaded a new version of my Mac app after being rejected by Apple. I usually get a "new version section" where I pick out the version that I just uploaded. I am NOT getting that choice.
Did Apple change something that I'm not aware of?
Thank you,
Dan Uff
Hi,
My app is going to consist of 2-3 pages of weather data. Do I have to add the Apple Weather logo to each page, or just the main one?
Thanks,
Dan Uff