Pagasi Journal starting the beginner classes!

Second day in a row! This is how habits are made! It actually feels really good reviewing all the basics, I can feel them solidifying in my brain

At the same time I’m resisting looking at my previous apps I was working on because that’s intimidating right now. I should open them up, there are definitely things I want to do with them… maybe tomorrow, small steps

1 Like

Welcome back Pagasi! Take it nice and easy. Those memories will come back :slight_smile:

1 Like

missed a few days there but I did watch several videos to catch up. Lesson 9 is quite the lesson! really does bring everything together and take the intimidation out of the SwiftUI ContentView file. I also know that you can write apps that combine UIKit and SwiftUI which is good because hopefully I can solve some of the UIKit problems by inserting a SwiftUI page in there on my old apps some day. No rush. I’m taking this slow again, small progress daily… there’s the key.

1 Like

still rolling! taking it nice and slow, not pushing for multiple classes, ran some swiftUI buttons today :slight_smile:

okay, took a stab at the swiftUI slots challenge, and thought it would be a piece of cake… turns out when I run it, I get a blank screen… and I have no idea why. I just started commenting out entire blocks of code… at some point this just means that my mac hates me right? like now I’m literally just trying to display two pieces of text with padding between them and I’m getting white screen… maybe a reboot is in order to show this thing who is boss lol. I’ve already lost too much time debugging though, I’ll fight the thing tomorrow

I’m back! well, I hope so anwyays, we will see. I’ve managed to work on swiftUI for 4 days out of the last week in some form or fashion. Turns out the problem I was having with the war app was using the wrong word for spacer()… so yeah if you do that Xcode hates you lol.

I’m moving onto the class on lists, so still veeeery early on in the swiftUI world. I do like that there are so many classes to go through now, @Chris2 has been busy making this a fantastic place to be to learn, and I very much appreciate it.

Anyways, just wanted to mark my presence here to continue to document my journey, however sporadic it may have been in the last year. But I do know that if I have a long term goal and work towards it with small daily goals, that I will eventually get there, so the current long term goal is to write a swiftUI app that helps me manage my piano teaching business, just an app for me but hopefully I can design one that cuts way down on my secretarial work such as inputing registrations into my contact list, and maybe sending messages to my current student list… I brainstormed the features I might want to have and there are quite a few that interact directly with other core apple apps in ways I’m not sure I can actually do… I have no idea how I would write it in UIKit much less SwiftUI so this is a journey indeed.

2 Likes

Hey buddy! I started over again a month or so back, and it’s been a marvelous experience, suddenly things are making sense, to the point that I can even improve on the lessons given.

Just finished the SwiftUI Foundations module yesterday, with the help of the Stewart Lynch concurrency lesson, was able to make all the previews work in all the modules. As well as solving the LearningApps bug with a different, more straightforward way of implementing the navigation.

Looking forward to seeing your progress.

Awesome! you’re a good bit ahead of me then, @cole_dano

I was able to knock out the loop lesson which was weird because there was absolutely nothing new for me in the lesson, but the challenge stumped me for a good little while. If I didn’t know how to debug already this would be a muuuuch more painful process lol

So if I wanna do this right and do all the challenges I imagine I would be able to burn through the easy lessons like I used to. Oh well.

I did hit a bug on the List lesson that I haven’t conquered, I declared a var count = 0 just before starting the list and when you press the button I was adding += 1 to the count which worked, but then for some reason after the button finished executing, it went back to the var list and reset the count to 0. I have no idea why its doing that.

1 Like

I just took a peek back at that lesson (Module 2 Lesson 3, right?), there’s no need to declare such a variable. Not sure that helps but…

Those early lessons were like that for me as well. I knew everything, but felt like I was solving the problems for the first time.

@cole_dano yeah I took a peek at his solution afterwards and it did not declare the variable, but regardless there will be situations where I’ll need it so I’ll have to figure it out at some point. … but not today :slight_smile: onward!

1 Like

Okay… so I flip flopped. I was enjoying progress with SwiftUI classes, but I in the real world, my published app has a weakness that has become more and more of a problem lately. I don’t have multiple user capabilities. So my flashcard app for my students saves the active cards of a student so the tthey can just instantly run the deck I set for them in class all week… but I have over 10 families with more than one student and some of those don’t have separate apple devices for each child. I’ll need to learn how to push an update now, cause I totally installed multiple user capabilities just now! yay!! my next feature that I want to implement is going to be so nice if I can do it. y’know how if you open your contacts app, there’s an alphabet on the right side? I want to put one of those in for my scales tableView. If its built into tableView methods then this could be easy, but if not, I’ve had to deal with the hell of scrolling a page to a specific point before… I do not look forward to that battle hahaha.

1 Like

I’ve been very busy…

so first thing I wanted to do on the app was adjust the buttons so that they don’t fall of the screen on small phones. I had the width of the buttons set to a permanent number and that was why. This actually took a long time to figure out how to fix, but turns out the answer is really cool!

class Device {
// set a base width, used iPhone 10
static let base: CGFloat = 414
static var ratio: CGFloat {
//iPad ratios are huge, so I just kept them the same size as the 144 phone
if UIDevice.current.model == “iPad” {
return 1
} else {
if UIScreen.main.bounds.width < UIScreen.main.bounds.height {
return UIScreen.main.bounds.width / base
} else {
return UIScreen.main.bounds.height / base
}}}}

extension CGFloat {
var adjusted: CGFloat {
return self * Device.ratio
}}

extension Double {
var adjusted: CGFloat {
return CGFloat( self ) * Device.ratio
}}

extension Int {
var adjusted: CGFloat {
return CGFloat( self ) * Device.ratio
}}

I mean this thing is super useful. anytime I type a number I just add 15.adjusted and it changes the number to match the phone

so I fixed a few bugs along with this, and actually put out an update to my app! my first update, wasn’t that tricky at all really to do either, thank goodness.

Then I wanted to add buttons to scroll down my tableview. The same way if you open your contacts list you can scroll through the alphabet on the right side of the screen. This was both hard to figure out, but then easy to implement, they are really just a UIStackView (the UIKit version of a VStack) of buttons stuck to the right side of the screen. The trick was to get the stack to fit on all phones again. and here I’m still a little confused. I had the buttons sized, and the padding between them set, but on some phones the list of letters would be off the screen either at the top or bottom depending on the phone. So I went through all the trouble to set up the list for each individual phone size all different numbers, went to bed, and got up today and something had changed. the stacks were off the screen all different ways again. This time when I fixed them all, they all used the same numbers?? no need to differentiate between phones. I had used the adjust on the size of the buttons, but yesterday that didn’t matter. I have no idea, I don’t trust it, I’ll check again tomorrow.

Once I get this all rechecked, I’ll be pushing out another update, the 3.0 version! There are many many more things I can do to this app, and I’m not sure what I’ll tackle next, but it does feel good to be back in the swing of things. I do still feel bad for not working on SwiftUI though. we will see.