Posts

Showing posts with the label SwiftUI

RW.com: Navigation Tutorial - Part 1

Image
Alright! A new article - technically a tutorial to focus on. This one is all to do with navigation. Start Time - 14:20 Here is the link, from Audrey Tan: https://www.raywenderlich.com/5824937-swiftui-tutorial-navigation Before I start, just having look to see what's there. Good to see the ContentView empty at the moment - that's genuinely good to see we're adding from scratch! In the 'Artwork' file, we have a custom struct for Artwork, then an array full (17!) of different artwork values. Each has a whole list of properties. In the MapView file we have some code that I'm not familiar with. OK, let's go to the actual tutorial! SwiftUI Basics Yes I agree with Audrey - I MUCH prefer how the code directly matches to the view, so you can keep track of it all. Also, just the one main ContentView is easier than using storyboards. Another key point is that UIKit can still be used alongside UI. Declarative App Development So what does declarat...

RW.com: Animations Article - Part 2

Image
The run continues! Will be good to make the most of it, as there will not be anywhere near as much time over the next few weeks. Anyway, second and final part on animations. Let's do it! Start Time - 15:04 So we are starting with combing transitions Combining Transitions Here is an extension on AnyTransition - extension AnyTransition {     static var customTransition : AnyTransition {       let transition = AnyTransition . move (edge: . top )         . combined (with: . scale (scale: 0.2 , anchor: . topTrailing ))         . combined (with: . opacity )       return transition     }   } This basically means that there are three specific transitions saved into customTransition - and that is specifically for the type. I'm starting to understand when it is useful to use type properties! 10 minute delay Asynchronous Transition So we have replaced to tr...

RW.com: Animations Article - Part 1

Image
The run continues! Like I said, my plan is to absorb knowledge from these 'beginner' articles. I won't get ALL of it - there'll be stuff beyond me for sure. But there WILL be elements to glean from them, that's the point. In the past I've been too concerned with understanding every aspect but actually, it's more like gradually building a complex puzzle - one piece at a time! Start Time - 15:16 https://www.raywenderlich.com/5815412-getting-started-with-swiftui-animations *Article dated Dec 9th 2019 Again, this could well be over two parts. We'll see! The three key things we're going to learn are animation MODIFIERS and withAnimation - that's the function which lets you animate STATE CHANGES. And Custom Animations! Opened project - here are the various Swift files already put in! And here's what the view structure is - The app is to basically bring up info about the planets in the solar system. Basic Animations *subheading...

RayWenderlich.com Layout in IOS Course - Part 3

Some momentum again! I feel positive about the content I'm learning, even if some of it is very complex. Right, straight onto this - I was partway through a challenge. Let's crack on! Start Time - 18:41 Challenge: Custom Alignment Guides OK, something does not seem to be working with this particular project. Errors coming up so just following along to see what Jessy does. This alignment guide is very hard! So it is something I think to revisit at the end of the course. Definitely will need some going over! I didn't have a clue for this one but then there wasn't much of a chance, as even Jessy admits. He says that this is beyond the complexity for most, which is me at this stage! So I'm putting this challenge down to a 'too hard!'. But will have another look another time! ZStacks Has a lot in common with the other two stacks. Zstack represents the background of the view. It uses BOTH horizontal and vertical. 9 built in values to use. So a poin...

RayWenderlich.com Layout in IOS Course - Part 1

Image
Here we are! On February Half Term again in RAK! So a sense of Deja Vu. Sadly, looking back on a whole year, there hasn't been much progress. But that's all going to change! Yes, I've been on much more of a roll recently and am ready to dive into more RW.com courses. The last one was a meaty one and took well over a month. Next one, which makes sense at this stage, Layout in IOS.  Start Time - 11:10 So this course is about layout in both Swift UI and UIKit. Cool! It made sense to go for this course rather than one of the ones from 2018 - anything before October 2019 does not include SwiftUI! So Stack Alignment is the first bit of this. Stack Alignment This is a container view that has its children in a line. V and H Stack. Option, command, return - shortcut for toggling canvas on and off. Still need to click resume though! Option command and p - shortcut for refreshing that view. Another shortcut to practise! To go straight to inserting from library, it i...