Posts

Showing posts from November, 2019

*BONUS ENTRY* Putting SwiftUI Into Practice - Part 2

Image
Second and final bonus entry! This is a bit more of a chance to put into practice some of the aspects of SwiftUI that I'm still getting used to.  Start Time - 20:29 Here is the list from before - List - how to get items in a vertical list Image - including all the properties and modifiers Buttons - again, modifiers and other bits DatePicker - options for what day, month, year Toggle - something that is on/off Slider - a value going up or down H/V/Z Stack ForEach - a loop basically Form - as you would see in lots of iPhone menus Last time I covered list, image and ForEach. So, logically let's work on the other stuff - buttons, datepicker, toggle, slider, Stacks and Form! Buttons *20 minute delay      var body : some View {               Button (action: {          print ( "Good food!" )      }) {          VStack { ...

*BONUS ENTRY* Putting SwiftUI Into Practice - Part 1

Image
This is a bonus - a 'rain day' today! Basically the day off. And definitely some time to code! As I've mentioned, Laurie's course is great but very complex. There's a lot I'm still not well versed with. So with practising making perfect and all that, this is the right time to play around with some of the concepts.  Start Time - 17:56 Right, so first thing is to make a list of some of the things I want to play around with.... List - how to get items in a vertical list Image - including all the properties and modifiers Buttons - again, modifiers and other bits DatePicker - options for what day, month, year Toggle - something that is on/off Slider - a value going up or down H/V/Z Stack ForEach - a loop basically Form - as you would see in lots of iPhone menus So, starting with List... Here we go - combining List and ForEach: struct ContentView : View {     let f1Drivers = [ "Schumacher" , "Alonso" , "Hamilto...

Ray Wenderlich Course - SwiftUI (Part 5)

Image
Here we go! So a bit of time now to continue with Laurie's course. Let's do this! Start Time - 19:29 ForEach & Identifiable Key paths - accessing the properties without accessing the actual values. \. syntax. \. self is used for simple types like strings. Paused at 19:35; resumed at 19:55 UUID - unique identifier. Making a custom type that conforms to identifiable. Nothing is actually working - with the picker or when using the custom type. {        let tips = RelaxationTip . demoTips          @ State private var selectedPickerIndex = 0      var body : some View {     Picker (selection: $selectedPickerIndex , label: Text ( "Relaxation actions" )) {     VStack {         ForEach ( 0 ..< tips . count ) { index in             HStack {                    ...