Pagasi Journal starting the beginner classes!

soo that was hours of basically just data entry… lesson learned, go find where someone else already did the work and make the app conform to their data entry instead of making your own lol

in case you wanna download my code so far and run it, here’s the link. Its specifically designed for my business, so it won’t make hardly any sense to most people but that’s okay!

I just added a few more assets… there are of course lots of things to fix but adding assets is really needed at this stage of the game

massive progress on the app today!

I uploaded assets, added background images, fixed bugs on the tableView with switches on it with a single line of code! I was pretty proud of this one let me paste it…

ArrayOfLettersSwitchedOff.contains(indexPath.row) ? switchView.setOn( false , animated: false ) : switchView.setOn( true , animated: true )

muahahahaha my coding skill is growing, that there is a single line if statement :wink:

oh and get this: I added drop shadows to my custom button to go along with its cornerRadius. Which is nigh impossible to do on multiple buttons on the same viewController. We were right though, just add it to the custom button file and all your copies of that custom button will have both corner radiuses and drop shadows all day long! good times. The annoying thing bout those custom buttons though is that because I set a (title: String) parameter, apparently I can’t assign my custom button to a button on the Storyboard? that kinda sucks. Maybe if I add it like a (_ title: String) kinda parameter… maybe I’ll try that tomorrow

PS. As far as the Texas electricity situation, the power is back on, the temperatures are back above freezing… at least in the daytime, and my house’s water lines so far appear not to have any cracks in them, thank god! The pool pipes are another story lol but that’s okay, those won’t flood my house. I was one of the lucky ones, in that we had family who never lost power and we went over there about half way through the second day with no power.

These weather days and weekends have been very beneficial to my app lately. I’m getting very close to a presentable app. I was able to organize the data and pass it around the various view controllers pretty easily, and now just need to work on aesthetics. Remove unneeded buttons, redesign the layout of a screen or two, bug my wife to see if she thinks it looks good and the thing should be ready to submit as a V1.0

I do have a few features I might still want to add before I’m finished for example:

-some images I’m using are extremely rough and could use some artistry and love… okay fine, most of the images are basically me scribbling on a marker board and are barely tolerable lol
-I have not looked into how to put adds on the app at all
-I could set up a community score board probably fairly simply… probably with a json file I could keep on my website, or with firebase

I know I want to change several other things on the app as well later. But for now I basically wanna get it into the hands of my students and start getting feedback.

Speaking of submitting, I have not registered as an iOS developer yet. lol I’m gonna have to go back to the classes that teach how to do all that.

PS. Dangit @Chris2 !! You know I want that weather badge!! But I can’t lose momentum on my app right now lol will they be available after the solutions are posted somehow? I absolutely love the idea for after I’ve written the apps I want to write and need to stay fresh for the next idea

Well… today was the last day where I can spend lots of time programming. The app is pretty much presentable if you ignore certain things, I imagine my progress is about to slow way down since the boys will be back in school, my wife back at work, and the baby being fully under my care. On the upside I’m actually off work this entire coming week for a “vacation” so that my wife can stay late at work all week for some training. So maybe in the evening I can try to make some progress.

On the upside I did make some pretty good looking buttons today. And got the general look of the app much cleaner, it’s starting to look like a real app!

Today I went looking through several apps on my own phone to see if I understood how they were made. Pretty much every app had a feature that I didn’t understand how it could be done lol I’m still such a beginner

I feel the need to vent… so basically ignore me for a paragraph or two

I find myself getting stuck… can’t seem to pass infor from the mainVC to fourthVC. Can’t use prepare for segue because I segue to 5 other VCs from that screen and it throws an error when I try to go to any other VC. Can’t use protocol because when the delegate initializes it erases the value I had passed for the variable before presenting the fourthVC. I’m betting I can play with that some more by creating more variables that aren’t part of the initializer but it hasn’t worked yet. The only other way I recall @Chris2 mentioning to pass info is by using functions as parameters… still need to research that one.

Then secondly I really need to get some constraint layouts to work in both portrait and landscape. I’ve started the process but it’s fighting me hard… makes me wanna delete a bunch of constraints and start over… again lol

}//end vent

1 Like

I think I’m starting to figure this protocol problem out. The delegate doesn’t work unless it’s already been loaded up and initialized before the protocol calls it to do anything. That’s why all the protocol tutorials have a main screen that has a button to open an options screen which pops up just long enough to pass the information BACKwards to the main screen. This explains why my app isn’t working, and it explains the use of the prepare for segue as a contrast. Prepare for segue will push information FORward into a ViewController that hasn’t been loaded yet. My problem with prepare for segue was I had 5 segues on the main ViewController and so it threw an error if I hit any segue but the one I had prepared for. Now I may have found the solution, which is to call the override prepare for segue but only make a change if the destination is the one I want. Fingers crossed!

Holy mother of all that’s holy… it worked

override func prepare(for segue: UIStoryboardSegue, sender: Any ?) {

if segue.identifier == BUTTON_TO_VC_SEGUE {
let vc = segue.destination as! FlashCardViewController
//code to execute such as
vc.propertyToChange = “Changed”
}
}

quick post to say, sorta took a break today, but then also came across Unicode format for strings! It could be my solution to the music font delimna. basically I haven’t found a free music font for sharps flats and such that I could use for my app lol. Well I found one but couldn’t get it to install properly? not sure what happened there.

I’m also excited about this post @Chris2 made about hosting one’s json on github!!! I googled it as soon as I saw him mention it and yeah… seems pretty simple! But after all the work I did on my website to get it an SSL certificate and change hosts to get more control of it, and adding a json file to it to play with… seems such a waste lol! my main issue with using a json file right off my website it security… ironic considering I just got an SSL certificate. I would need to set it up special with a key or something right now its right out in the open for anyone to push to. Honestly, the real answer here is a database… I don’t know why I keep pushing for a json file other than I’ve gotten this far lol!

Edit: yeah… just stayed up way too late adding all the unicode to my scales file lol whoops! looks a lot better though and now I don’t have to worry about finding that font!

Wow I’ve been stuck for three full sessions on simple constraint problems for a page with 7 buttons in a vertical stack sigh details later

1 Like

okay, I finally solved it. So the problem was there were 7 buttons which in landscape mode was too tall for the screen… oh easy! I thought. I’ll just put the top 3 buttons in a vertical stack, the bottom 4 in a vertical stack, and put both stacks in a vertical stack that I can rotate to horizontal when the phone goes into landscape… facepalm. okay so with 8 buttons this would have been exactly that easy. hardly any constraints even needed, but with 7 it resizes the buttons so that the 3 buttons are now bigger than the group of 4 buttons. Its possible I could have solved that by creating an entire other view to put the buttons in and resizing the view, but I decided to just delete the outer stack and manually calculate where each of the other two stacks should go… Mind you this is vastly oversimplifying the torture I went through. I did all these constraints programmatically. and that’s where my brain couldn’t work it out. I whipped up a storyboard with the same setup and was quickly able to figure out what I needed to do… I just didn’t do that until the 3rd day of beating my head against a wall lol. Also in order to realign those constraints I had to deactivate the old ones… or bad things happened lol. that meant capturing the constraints in a variable which I then could activate or deactivate or put a new constraint into. So because of that I have my new lesson for the day:

[stackXConstraint, stackYConstraint, stack2XConstraint, stack2YConstraint].forEach {NSLayoutConstraint.deactivate([$0])}

I mean come-on, that just looks cool lol. its really just this:

NSLayoutConstraint.deactivate([stackXConstraint, stackYConstraint, stack2XConstraint, stack2YConstraint])

…theres literally no reason for the forEach lol but I couldn’t resist

Cant you just add an “empty” container or view on your top part so it takes up exactly 4 spaces as well?

yes but it doesn’t offset the one with 3 cells in it so that they are all centered vertically

So why not just a button then but one with no image and or text so it takes up the same space as the other buttons? Or that doesnt work either?

When I was trying that out on storyboard even .fillProportionatly wasn’t doing it right for some reason. There has to be a way but every time I thought I found it what really happened was a conflicting constraint. So Xcode would just break on of the constraints to try to fix the problem and everything went all over the place. I might keep playing with it. If you could get a half sized button on top and bottom it would do the trick

Okay I just set up a new project, and embedded two stacks into a horizontal stack and it works perfectly… I do not understand lol I’m sure it’s because I did it with only a 45 height on the buttons and X and Y centering on the horizontal stack. Whatever other constraints I was using must have interfered

Ah its the button inside that should auto adjust no the stack to the button

Well in my first project where it didn’t work, the button heights were completely ignored. I was trying to adjust the stack heights to get the perfect buttons but then the horizontal stack would crash.

In the project I just threw together the button heights worked and the inner stacks .fillEqually worked perfectly

So I needed the stacks to adjust to the buttons

I’m in a weird spot right now. Most of the programming is done but my assets are crap. I hate to stop practicing programming in order to go work on assets lol. At the same time My free time which is allotted towards programming is shrinking… as the baby grows that changes for better or worse, I don’t even know if the boys getting out of virtual school for the summer or even going back to in person school will help cause it’s mostly baby care lol

The second problem I face is choosing which app to write next. I’d like to write a sight reading app, possibly even merge it with my current app as a v2.0. But I also want to expand my horizons a bit. Maybe in the api direction or maybe build a four player board game that I’ve already designed. If I go for the game then I’m currently looking at SceneKit I want a 3d board but I’m having a hard time finding where I should train for it.

I just lost all my work since March 3rd. I wasn’t able to push to GitHub for some reason today because it kept “loading” the origin-main in the push screen. Something about a broken head? I don’t know. I ended up downloading the GitHub desktop app and opening my local repo there and was able to reconnect the origin main/head but then when I went into Xcode it said I couldn’t push because I was out of sync and had to pull or fetch changes I don’t remember exactly but when I did it overwrote all my work with what was the last push I had made on March 3rd. Did not prompt to stash changes or anything. It also switched the initials in the circle on the left side of the push from W to P not sure what that means yet. I’m making a list of everything I did this last week that I can remember, it was a good bit.

Why the hell did origin-main break in the first place

Edit: okay so it turns out it did not overwrite my commit from March 8th whew!!! I still lost a chunk of work, but honestly it was mostly small things I should be able to easily fix. I thought I had made another commit since then but I guess I didn’t. Still a little sad, but not NEARly as sad as I was before

Edit2: a bit of research and it appears that you cannot just checkout old commits and expect to be able to merge it to main. You have to check out branches that were created in advance. Now I don’t remember checking out a commit, but I expect that’s what I did. It makes sense because I did dispense with a chunk of code. and start working from there. I also now know there is a way to roll back your main instead of checking out an old commit, but I’m not sure how exactly to do it at the moment, and I’m not sure you can do it from inside Xcode? either way, geez! what a painful lesson, the thing that is supposed to keep you from losing code actually causing you to lose code… I mean damn.