Post

Replies

Boosts

Views

Activity

Not sharing files with Xcode 16 Beta?
Hi, I am creating an app that would be able to share information between iPhone, iPad, etc. I created a new target and went to the Target Membership area and noticed the attachment instead of the list of files that the app can share between the current target and a new one. Is there another way to do it? Thanks, Dan Uff
1
0
774
Jul ’24
Looking for opinions….
Hi, I’m running out of hard disk space on my Mac mini and am considering moving all of my projects to iCould. But I need to know if anyone else has done this and if iCloud would be a viable option working with Xoode and if said idea would be able to keep up with any update(s) that I’d make to an app. Thank you, Dan Uff
1
0
286
Dec ’24
FYI: Xcode and Disk Space
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
3
0
519
Feb ’25
Math Problem, entering an answer
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)   } } }
5
0
601
Apr ’21
Apple Watch App not Displaying Back "<" Button
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
2
0
1.2k
May ’21
Not able to change background color of NavigationView - SwiftUI
Hi, I have been trying to change the default color of the NavigationView in the AppDelegate file and am unable to. Is it the code, or me? Using Xcode 13, Beta 1. I got the code from hackingwithswift.com. Here's the code: func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {     // Change Color of Navigation Bar:     let configuration = UINavigationBarAppearance()     configuration.configureWithOpaqueBackground()     configuration.backgroundColor = .systemPurple     return true } Thank you. Dan Uff
0
0
453
Jun ’21
List of Items - Best way SwiftUI
Hi, I have a list of items on the iPhone that I want to share on the watch. The list would be too big to have the actual file on the watch, so, what's the best way to share the list from the iPhone, and could someone give me a step by step on what to do or point me to a good document? Thanks, Dan Uff
0
0
449
Jun ’21
Show JSON output to screen?
How would I take the output from JSON and print it to the IBOutlet's newsview? Thanks! class ViewController: UIViewController {   @IBOutlet var newsview: UITextView!   override func viewDidLoad() {     super.viewDidLoad()     // Do any additional setup after loading the view.     // API Endpoint:   let urlString = "[string withheld]"   let url = URL(string: urlString)   guard url != nil else {     debugPrint("URL IS nil")     return   }   let session = URLSession.shared   let dataTask = session.dataTask(with: url!) { (data, response, error) in     if error == nil && data != nil {       let decoder = JSONDecoder()       do {         let newsFeed = try decoder.decode(NewsFeed.self, from: data!)         print("Result: \(newsFeed)")       //  newsview.text = NewsFeed as? String!       } catch {         debugPrint("Error in JSON Parsing!")     }   } }   dataTask.resume() }   override func viewDidAppear(_ animated: Bool) { }
6
0
907
Jul ’21
Apple Watch, SwiftUI. and Xcode 13
Hi, I added an Apple Watch target to an existing app using SwiftUI and Xcode 13 (13A233) and the Canvas shows the first view controller correctly (an Apple Watch) but when I add additional VCs, the canvas shows an iPhone. I recreated the additional VC making sure I had WatchOS selected and got the same thing. Is anyone else having this problems with this? Any work arounds? Thanks, Dan Uff
0
0
514
Sep ’21