Hello community,
This is my first post here. It's a super basic question. I'm starting to learn Swift and I'm using a Swift Playground from Xcode.
I have tried to print a text like this:
print("Hello, world")
However the output is adding a "\n" symbol, resulting in:
"Hello, world\n"
Any thoughts?
Thanks in advance,
Rodrigo
Post
Replies
Boosts
Views
Activity
Dear community,
I'm reading "Develop in Swift Fundamentals", and on page 89 it asks us to open a file from the downloaded file (page 9 - Download Student Materials link).
I was running the last part of the exercise of page 89 and it seems I got stuck when trying to remove the last compile warning message:
"1. Condition always evaluates to false"
"Will never be executed"
Please take a look at the screenshot, where you can see the whole code and context.
I have tried to add a few breakpoints (rows 10 to 12) in order to see if they would get ignored but it looks like it's still there.
Any idea how to remove / get rid of this compile warning message?
Thanks,
Rodrigo
Dear community,
I've been learning Swift, currently reading "Development Swift Fundamentals" (page 484).
I have added 2 items to the tab bar controller. If I use one of the default "system items" (icon+label), it works fine in the simulator. However, if I change that to "Custom" and choose a different icon from the "Selected Image" menu, it shows that normally in Xcode but it does not show that at all in the Simulator or in my iPhone. Please see the images attached.
Any thought?
Please find below how I see that in the Simulator (or in my iPhone):
Thanks,
Rodrigo
Dear community,
I came across a roadblock in one of my exercises from the book "Develop in Swift Fundamentals".
The goal is to create an iOS app about a Quiz, which includes questions, answers and in the end it brings a final screen with results.
The book asks to create different View Controllers, one for the questions and answers, and another one for the results. They are named as following:
QuestionsViewController: For questions and answers
ResultsViewController: For the final result
There is a Segue from the "Questions" to the "Results" view controllers.
Each view controller has its own Swift file with some coding. The error message I'm getting is in the "ResultsViewController" only, after I added the following line of code:
var responses: [Answer]
(ERROR: Cannot find type 'Answer' in scope):
As you can see, it's complaining that the type "Answer" cannot be found in the scope of the "ResultsViewController", however it can be found in the "QuestionViewController", as the screenshot below:
Does anyone know why I'm getting this error message?
I appreciate any input. I have tried to get an answer from ChatGPT but with no success.
Thank you,
Rodrigo
Hello community,
I came across a very frustrating situation. I finally decided to update my macOS from Ventura to Sonoma.
After the update, I noticed that the icon for Xcode (version 14) had a "prohibited" sign on it, indicating that this version is no longer available for Sonoma.
Then, I have downloaded the latest version of Xcode, which is v15.2
However, upon launch, I'm not able to start the VisionOS SDK. It shows the following message: "Requires Apple silicon Mac" (please see attached file).
Did someone ever face a similar issue?
Thanks,
Rodrigo.