Hello all,
I am getting a bit frustrated trying to find help with Xcode 12 beta and swift UI. I wanted to try learning these since the new Xcode beta has made improvements in accessibility. I am having issues but I don't know where to go to get help. I tried looking at the documentation but it is not helping. I tried to get into the developer forums to ask questions but I just kept going round and round trying to register to be able to ask a question. Right now I am trying to follow the 100 days of swift UI to learn coding in swift for iOS. The issuee is that it tells you to create a new project and select the iOS single view app template. There is no single view app that I can find in the template chooser in Xcode 12 beta. I don't know if this is a bug with Xcode, a bug with VoiceOver or if this option is just now gone. I have tried googling for this but I cannot find any answers. Please Help? :)
Thanks,
Greg Wocher
Comments
None
There is no beginner help with this. You'll have to wait for it to be released in order to get help with this.
I believe the tutorials…
I believe the tutorials haven't been 100% updated for the new Xcode 12 beta and new changes to swift UI. I picked multiplatform App and it works fine. Your login to the dev forums is your appleID.
A note to anyone using the…
A note to anyone using the 100 days of SwiftUI program, when you start building apps and you get into pickers, you need to add some accessibility(value:) attributes for VoiceOver to see the new selection that is made.
struct ContentView: View {
let colors: [String] = ["Red", "Blue", "Green"]
@State private var colorsIndex: Int = 0
var body: some View {
NavigationView {
Form {
Picker("Choose a color: ", selection: $colorsIndex) {
ForEach(0 ..< colors.count) {
Text("\(colors[$0])")
}
} .accessibility(value: Text("\(colors[colorsIndex])")) // This is the important line
} .navigationTitle("Test to show accessibility on pickers")
}
}
}
Accessibility in color picker
Hello,
Thanks for this. Right now I am on day 16 of the 100 days of swiftUI. I am working on the WeSplit app. this will come in handy when I get to the color app.
Greg Wocher
You will need to use the…
You will need to use the code I provided for We Split and the conversion app. there is no color app. that was just something I whipped up to show what you needed to add.
Where can I find the 180 days of swift tutorials?
Hi,
Where can I find the tutorial that was mentioned?
Thanks for any help.
The program is 100 Days of…
The program is 100 Days of SwiftUI and can be found at: https://www.hackingwithswift.com/100/swiftui
I'm very interested in…
I'm very interested in learning to code. Do I need Xcode 12 in order to complete this course successfully, or can I at least get started with Xcode 11?
Problem with accessibility of picker
Hello,
I keep getting an error when I try and add the .accessibility line to the picker in the WeSplit app in the tutorial. Here is my code:
struct ContentView: View {
//Variables for our text fields
@State private var checkAmount = ""
@State private var numberOfPeople = 2
@State private var tipPercentage = 2
let tipPercentages = [10, 15, 20, 25, 0]
var body: some View {
NavigationView {
Form {
Section {
TextField("Amount", text: $checkAmount)
.keyboardType(.decimalPad)
// Start of picker
Picker("Number of People", selection: $numberOfPeople) {
ForEach(2 ..< 100) {
Text("\($0) people")
}// end of foreach loop
} //.accessibility(value: Text("\([numberOfPeople])"))
} //end of CA section
Section {
Text("$\(checkAmount)")
} //end of text CA section
} //end of form
}
} //end of some view
} //end of struct
Greg Wocher
You can use Xcode 11
Hello,
XCOde 12 is not required to do this tutorial. You can use Xcode 11 just fine. I am just testing Xcode 12 because it is suppose to have some accessibility fixes and new features in it.
Greg Wocher
Greg, remove the [] from…
Greg, remove the [] from around the numberOfPeople variable and it should work.
Also, in the comments to mark up the end of your code blocks you noted that at the end of the body property you said end of some view. some view is the return type. body is the name of the property.
Thanks it worked
Hello,
Thank you. Removing the [] from the numberOfPeople variable worked. The live preview is sort of accessible now in XCode12. There are some issues that I need to report as soon as I find out how. LOL.
Greg Wocher
Xcode 12
11 should work, just the playgrounds sidebar isn't accessible. The rest should be okay at least.