Posts

Showing posts with the label Catie Catterwaul

RayWenderlich.com Layout in IOS Course - Part 6

Here we go! The final chapter. Possibly two entries but I may be able to do it in one. Then the Auto Layout is complete. As always I will do a consolidation entry. This chapter is all about constraints.  Start time - 13:35 Intro Attributes can be added - position, width and height Some of this is implied e.g. if you give the leading (left) and trailing (right) edges, then the width is derived from those Formulas are used to work out the position, width and height. Top and bottom Layout guide - keeps tab bars etc. separate. Stack views are usually the best way to set up views but constraints still needed. Add New Constraints So some cool shortcuts - add multiple heights/weights in one go. Do the whole make same height feature, based on one constraint already in. Minimum font scales - great if text is too big, then it will work on multiple devices. Drag Constraints Ok, so selecting options in the attributes - in this case centre horizontally and vertically ...

RayWenderlich.com Layout in IOS Course - Part 5

Image
It's been a while but for god reason! I've got a promotion at work, which means I've really got my future set. However, I am not going to abandon Swift. My work over the past 20-ish months has been rewarding and to let all of that go would be a shame. True, had I not got the promotion, I would probably be gravitating towards Swift more with an aim to transition to a career in the future. Anyway, that COULD still happen but it does make me want to rethink my goals a bit. We're also on an early holiday, so plenty of time to code and do a reflective entry of where I am and where I want to be. That will happen soon! For now, let's get on with the auto layout course! Start Time - 9:42 Intrinsic Content Size So this is the size that will fit EXACTLY into a a view's content. Content Hugging and Compression Resistance - these are rules that show the importance of contents not shrinking or resizing, bigger than the intrinsic size. 4 priority values to set. Vert...

Ray Wenderlich Functions and Types Course - CONSOLIDATION ENTRY!

Not wasting a moment since completing the functions and types course, time to review Catie's course in its entirety. To do so I'll be looking through my previous entries to make sense of the knowledge, rather than watching the videos again. Let's go! Start Time - 15:45 Entry 1 - 8/1/20 A general intro followed by functions. With the review of these, I generally had no issues. Recap of return type, default values...all good! Overloading - this means creating different functions with the same name. Each function with the same name needs to be unique. Stride function - new feature in Swift - for  i  in   stride (from:  10 , to:  2 , by:  -2 ) {      print (i) } So good for number sequences basically.  Entry 2 - 11/1/20 Advanced parameters as the main focus here.  Variadic parameters - use of ... so there can be multiple values.  Inout parameters - used if the value of the parameter could chan...

Ray Wenderlich Functions and Types Course - Part 12

Here we are! This will be to conclude Catie's course. It's been useful to go over the content. The issue is that none of it is project-based - I need to see more in context! The MOST useful way of using the info will be in the consolidation entry to follow this. So here we are, the rest on protocols and inheritance! Start Time - 12:56 Protocols and Extensions Extensions - I know about these already. Extending them to protocols... Using protocols you can say 'composition'. If class inheritance isn't quite working then protocols are the way to go! Extensions can't have stored properties or designated inits. At the moment I don't see the advantage of having extensions for a protocol when all of that could just be in one protocol. You can also extend native types e.g. Ints. This is quite advanced! extension Numeric {     var squared : Self { self * self } } An example of putting in member-wise init.  Challenge! Last one fo...

Ray Wenderlich Functions and Types Course - Part 11

Image
OK! This is probably going to be the penultimate part. Maybe last part as I have a good hour so we'll see how far I get. Onwards with protocols! Start Time - 17:00 Initializers This is a pretty lengthly tutorial! Always useful to see this in action. Installing additional Xcode components...will follow along with video without actual coding until that's ready. So the super.init is for the superclass. That needs init. Init phases Phase 1- init all stored properties. From bottom of the hierarchy upwards. Phase 2 - use anything that has the use of self. Two phase init! Then the object is ready to use. If you tried creating an object without declaring the value of the sports array an error would come up. So you an give a default value for that in the class....OR, much better, have another way to init! Use of required rather than override. But required needs to be in the super class. Or the base class. Designated inits. They need to call super.init. So we...