Posts

Showing posts with the label Ray Wenderlich

Ray Wenderlich Course - Second SwiftUI App Part 2 (and final - abandoned after this!)

Image
Two days in a row, baby! Back to this confusing, but useful in places course.  I have around 40 minutes so enough time for a whole chapter possibly.  Start Time - 17:15 We will use the above to add and delete tasks. A different view for new task? New Task View Here we go! Straight into a challenge... Well this was hard of course! To be fair, I'm still getting used to SwiftUI so good practice... Modal Views You have a + button in the upper right. var body : some View {         NavigationView {             List ( taskStore . tasks ) { task in                 Text (task. name )                                     }         . navigationBarTitle ( "Tasks" )             . navigationBarItems (     ...

Ray Wenderlich Course - Second SwiftUI App Part 1

Image
Here we are now! Haven't been able to code for a few days. A quick entry here - around 20 minutes, then some proper time tomorrow! Rather than play around with the SwiftUI view stuff, I feel like cracking on with another Ray course. There's plenty of content on RW.com so I want to get stuck in! *Entry ends up going over two days! Start Time - 12:01 I struggled with this 'To-do' app before. I want to have another crack with it as it looks updated with UI even though the overall rating (3.4 out of 5) isn't great. The dude's name is Jessy Catterwaul. He looks a little like the Joker! There will be challenges etc. along the way. Models A point about copyright statements - something to bear in mind if/when working for a specific company. A bit about copying a p-list into the main folder. Done. Models - created a Swift file. This is where the data model will go. Another Swift file created with a class. OK challenge time - nearly there for now! cl...

Ray Wenderlich First iOS SwiftUI App Course - Part 5

Image
Yes three days in a row! Though the blog date for one of the entries was the 25th when it should have been 26th...anyway not to worry. Last bit of Ray's course! Start Time - 18:11 Right, the last bit to do will be the graphics - the different pictures and views. Images This is a bit I sometimes get confused with. All of the images have been created specifically by Ray - for me it's just clicking and dragging to the assets folder. So 1x, 2x and 3x. We don't need to use 1x any more! No need to bother with that. I remember using a programme I had downloaded that create all of these for you. Anyway, leaving that for now. This is the website with the guide to device resolutions - https://www.paintcodeapp.com/news/ultimate-guide-to-iphone-resolutions Background is a method that can be used. Awesome! View Modifiers *Delayed for around 15 minutes There is a great website www.iosfonts.com This basically has all the info for using specific fonts! This is SOO...

Ray Wenderlich First iOS SwiftUI App Course - Part 4

Yes! Some momentum - four entries this week is pretty good. Right, straight on to the next part! Start Time - 09:07 More Swift Basics A challenge straight away! Showing the score. OK, let's have a go... I got MOST of this but tried to put in the code inside the function, rather than in the button bit of code. No matter - still getting used to SwiftUI. Paused at 09:23 (need to sort breakfast!) Restart at 09:46 Right, so the bug in the code is that the target number gets updated before the calculation, so we want the updating to happen after the alert button is pressed.... So this works! What you need to do is put the code inside the curly braces by the dismiss button. This means that the code actually happens when the button is pressed. This makes sense for updating. I've had this before in games with the round changing before the points have been updated etc. Challenge - tracking rounds! OK, so for this I need the state variable. I'm getting used to that...

Ray Wenderlich First iOS SwiftUI App Course - Part 3

Image
Here we go! Back from Thailand and a couple of days of Half Term left. Man it really makes a difference using the screen and not having to squint! Carrying on with Ray's excellent first Swift with UI App... Start Time - 11:15 SwiftUI Binding So at the moment the slider does not work. Bindings are ways of saying a view will always be tied to a STATE variable. So we will bind together the slider with a state var. Ok so I have put in the lines of code, thus BINDING together the state var with the slider. Cool! Strings String interpolation - know all this. Variables Again, real basics here. Casting from one type to another. Each variable has a certain lifetime. This is to do with scope. Local variables etc. Swift Basics I know this will be a lot of recap so more of a skim through... Swift Standard Library Stuff about Int random. Point is you do not need to memorise everything. You learn as you go then refer back to bits etc. Writing Methods Putting in a ...

Ray Wenderlich First iOS SwiftUI App Course - Part 2

Image
Here we go! Consecutive days baby! No need for more info - straight back into the next part of Ray's course.  Start Time - 14:58 Realistically I have 40 minutes here. At least another chapter or two! Using Interfaces with SwiftUI This is all about getting the layout done. So probably will just be on this chapter for now. Phone resolution guide  - use to figure out differences between screen sizes. Number of pixels - only important for designers. Developers work in points! Cool, some good bits about getting to landscape, changing the view on Xcode. All good. But only around 20 minutes left and have barely started this chapter. SwiftUI Views Stuff about views. We need four rows of views on a v stack. Side by side for the children views. H stack views within the V stack container. Cool! I love the whole stack, then adding the text. This is much better than adding the various labels.... so far I definitely prefer SwiftUI. Challenge! I need to add in the o...

Ray Wenderlich First iOS SwiftUI App Course - Part 1

Image
So on holiday in the beautiful, tranquil Wora Burra hotel in Hua Hin, Thailand. What better to do than a bit of coding?! Honestly, I love doing this and it is not in any way a chore. I just wish that I could sustain some sort of momentum with it. Life - work mostly - manages to get in the way. OK, we're back to the first app course. This time with the actual UI stuff! Let's get into it.  Start Time - 10:57 OK slight snuggle - Xcode beta needs to install additional components... Just going to watch then pause at the point I need to. So one of the benefits of SwiftUI is the 'live' update to what the interface looks like. It is on pause by default but can be played easily. This is cool - it means that you don't have to test on the simulator every single time!! You can still choose a simulator to run it on. This is separate from the live update of UI. OK Xcode updated, ready to go! I've loaded the Bullseye file from several weeks ago. Neat little trick -...

Ray Wenderlich Fundamentals Course - Part 2

Image
Yes! First consecutive entry for a little while. Good news - I have sorted out the UI stuff so I have Mac OS Catalina - the beta version. I've changed my account so I get to have the beta stuff basically - ahead of time. So when the actual update comes up, I will just get that for the 'normal Xcode'. Anyway, I want to complete the fundamentals course. It's been very, very basic so far. So will skim through the content and just get to the challenges. Also, I'm aiming for no more than an hour at a time, but in 2 possible stints today. So stint 1 is to get the next chapter done. Here we go! Start Time - 11:49 COLLECTIONS Tuples One thing to type - that you can assign multiple values in brackets to the entire tuple, then each of those values is saved separately. let wrestlingFacts = (name: "Kevin Owens" , didWin: true ) let ( name , wonMatch ) = wrestlingFacts So now 'name' and 'wonMatch' are their own values. I could use ...

Ray Wenderlich Fundamentals Course - Part 1

So, as expected, I can't use the Swift UI functionality yet. Not at least for a few more days. So I'm going to focus on this fundamentals course, which should just be recap. I need to keep my eye in as I feel it slipping away with all of the delays. So a little bit of time now, whizzing through the core concepts.  Start Time - 15:51 Technically we're out of sync as this should follow the Bullseye app. But I can't do that without the Swift UI stuff. But that's fine. Playgrounds This is all VERY basic. So far we've got creating a string for a message and where it appears. Then printing it. Think of playgrounds as a notepad for trying things out. So, unlike the Lynda course, it makes sense to REALLY skim through this. Just basically pick out any nuggets! *Markdown - go to editor/show rendered markup to get the proper view! OK, one useful thing learned then! Booleans and Comparisons All recap here. Nothing new. Comparing ints, doubles, strings et...

Treehouse Intermediate Course - Part 3 (Generics 1)

Image
Yes the momentum continues! Today the aim is to cover half of the Generics bits. I know a bit about these but can't think much else other than downcasting/upcasting. There'll be more for sure! Also, I am going to ensure to do the extra reading parts, where relevant, as well as any coding practice.  Start Time - 15:04 Writing Repetitive Code So generics presumably means using the 'any' type and avoid using repetitive code. So I was right in that sense! Also, this links to the F1 quiz I've done before, which is in dire need of other options. Need to have sections for drivers, teams or difficulty level...I had to give up on that project back in January. Back to the course! Loops for example are an elegant construct - much better than typing out verbose code! func swapInts( _ a: Int , b: Int ) {     var tempA = a     a = b     b = tempA                } swapInts ( 4 , b: 7 ) ...