Pagasi Journal starting the beginner classes!

GitHub is up and running! I overslept though so I only had about 15 minutes to do it, I didn’t get to do anything but set it up. I hit a small snag but I was able to work through it pretty quickly. Today I called my buddy who also tinkers with code to basically help me manage my time. I’ll be calling him once a week to go over my progress or lack of progress. What that means is I gotta go back into GitHub and check into having him added to be able to download my (currently set to private) code. He doesn’t know Swift he’s more of an oversight/big picture guy. And can help me see where My design choices are flawed. So I have a team now! This is getting exciting

Edit: team member added on GitHub, also got the GitHub app :slight_smile:

2 Likes

good day’s work this morning! woke up on time, baby woke up too but decided as long as I hold him he can sleep some more lol

Let me just tell you how much freedom and peace of mind Git Branches can bring! while working on my first app I was trying to set up a timer so that my son could run his sight work flashcards and see how fast he was going, I know he would have loved it, but about halfway into making the timer I started to break things! the app stopped working and I couldn’t figure out why! UNDO UNDO! I put a set of /* */ around all the timer code, got it to work, and never touched that thing again… my poor son never got his timer

today however, I had a working UI for the music flashcard app and started working on the model, but before doing so, I created a branch. Huge sigh of relief. I broke things left and right, deleted files, copy and pasted huge pieces of code just because I could lol. Everything still works for the moment, and progress is being made.

also at this mid stage of the game I decided maybe I should um… //tell myself what my code is actually for lol.

1 Like

Just took a late hour to work on the code… realized that by making my model inside a view controller it’s super hard to extricate to it’s own file because so many variables… not even sure it’s worth it, I need to look at some other peoples models to see proper methods here.

The app is coming together nicely though! All the programming is pretty much easy from here on out. Now the hard part will actually be assets. Do I make gif files? I dunno. Do I try to learn to do some simple animations? Geez that’s a huge job. I know I can get the app to my students in a beta form and get huge benefits… at least for those with iPhones lol! But I want complete mutability on my files so I need to put the assets on my website and download them to the app and cache instead of preloading assets on the app… still a lot of work to do. And don’t even get me started on making it look good, that’s a huge headache waiting to happen lol

Use Figma to make the assets and follow some good design practice videos.

Good luck with writing the app!

Now I’m thinking I could preload some basic images on the app, and then have the app check for available images to download to replace those images? not sure how I would code that really, because the new file would have to be the same name as the old one for the code to recognize it as the image I need since I call the images with UIImage(named: “Cat”) lol I’m sure there are many solutions to this

progress made, getting somewhere! almost overthought things and had to setup a database, but realized I could just reorganize my storyboard segues and have a super easy passing of variables between view controllers. At some point I do want to play with the problem that I was trying to solve instead of getting around it, but for now I’m just going to move on to the next part of the app… which is to fix all the other things I just broke by implementing this snipping of an array hahaha

1 Like

Glad you are making progress! I hope you really get somewhere when you have published your first app. I can’t wait to see the finished product!

P.S. Good luck with the rest of the app!

maybe you can also check out UserDefaults or Keychain for a simple “database” thats not as rigid as CoreData, we have bentos of those

1 Like

Yknow I thought about user defaults I’m probably going to use them to save the letters that the user has picked under custom… but if I want to keep a log of their scores over time I think I’m going to need a database… and if I want to let all my students compare scores I’ll probably need firestore at that… If I use Firestore I might as well use it for everything… although many kids will have iPads that don’t have cell service so maybe I should use both and only require internet when needed

Massive progress today! I had a meeting with my friend who sparked some things based on other similar apps and such for the moment I’ll just need to keep doing what I’m doing.

Spent some time playing with the UI just for funsies, final product probably will change the entire look so I probably just wasted an hour but it was fun and I learned stuff lol

Discovered a glitch in my array work and managed to actually fix it. I thought I’d describe it so that @fuerte.francis and @mikaelacaron can tell me that there was a super easier way to do it lol!

//array of Int to remove from stringArray

let arrayOfInt = [0,4,3]
var stringArray = [“abc”, “def”, “hij”, “klm”, “mno”]

//loop through arrayOfInt removing the chosen string

for index in 0…arrayOfIntToRemoveFromStringArray - 1 {
stringArray.remove(at: arrayOfIntToRemoveFromStringArray[Index])
}

So the problem is the loop starts by taking the first Int 0 and removing “abc” from the stringArray but then everything in the stringArray shifts down so that “def” is now at position 0 and “mno” at 3. So then the second loop starts and tries to take the int 4 which was intended to remove “mno” but now there is nothing there so… app crash! Hahaha not to mention that even if the second Int was 2 it wouldn’t have crashed but it would have removed the wrong string

So the user actually chooses the numbers in the ArrayOfInt and their order but it doesn’t really matter what order they get removed so…

My solution was to sort the arrayOfInt from largest to smallest… tada!! All fixed lol took a while to figure it out though.

2 Likes

Whats great about firestore is you only need the internet once (to load everything) and it will already have an offline copy of your database, it will then only sync to your online version once ur internet is back so its great for a leaderboard or something

1 Like

So I have this custom object Letter

And in this object I expected I would need a reference to a flashcard image, a hint image, an answer, a label for the table view, a switch for the table view and probably more. But for now I just made one property

nickname: String

And figured I’d fill in the rest later. But… Turns out I can use that one string to solve all of the other references.

The string for example might be “Elephant E”

that’s exactly what goes on the label.

It’s also the exact name of the hint image.

The flashcard image name will be “Card Elephant E” sooo Let flashcardImage =
UIImage(named: “Card (nickname)”

The answer will always be the last letter of the string so let answer = nickname.last!

And finally I can add a switch to the accessory view of the custom cell where switch.tag = index. An index that will correspond to the letters place in the array is all I need to filter the array based on the switches flipped… like I didn’t even need to create this letter object, I could have just made a string variable for the view controller lol

Ah well at least I have a mode for my MVC right?

I’m definitely going to be using Firestore… its the only one I know really, the other class, @Chris2 warned us that recent changes had broken it and I never even tried lol! I did watch the videos a bit and when he said “See?! isn’t that easier.” I thought “NOPE!” and moved on hahaha.

Also I understand Apple is adding new restrictions because BitRise is sending me emails saying I need to double verify my identity? don’t know if that applies to Firestore. I almost wish apple had its own external Database. I’m 100% willing to deal with the complications and confusion of CoreData just to have apple maintain the system for me through updates lol

massive progress today!! the puzzle of the day is how do you create a tableview where there is a switch on each row where each switch does a different thing. and THEN! make buttons that can switch all the switches to a preset pattern where some of them are switched on and some of them off all at the same time.

this one took a few hours and turns out the solution involved… a property in that fancy object I was talking about 2 posts ago! It didn’t end up going to waste after all!!! hahaha

1 Like

On the one hand I feel like I barely did anything today… but on the other I just accomplished the ability to set a timer and capture the high score, which is something I hadn’t been able to figure out on several previous attempts… This is a weird feeling lol

I have this feeling that my biggest weakness here is basic design. The thing works, but looks like a weird… Nickelodeon slime/dark blue mess. I’m trying to look at other apps and I’m noticing that their fonts are all way smaller. and shapes less cartoony. I like the drop shadow, I’m gonna have to incorporate it a lot more to get that more professional look, but really its mostly an app for students and as such, more kids than anything, so… back to the green??? ick.

watched a lot of videos on refactoring the huge View Controller problem and I’m thinking… this is a job for after the app is done lol. I feel like I’d be wasting valuable time just rearranging code when nobody but the apple reviewer is ever going to even look at it? It does help to come back to your own code though and be able to understand it so I kinda do want to do it… but like… later… adding it to the trello list as a way later thing lol.

I do have a segue glitch I want to look into fixing… maybe that can be my today research and tomorrow accomplish thing. I’ll go make a post on that

oh! and I spent a ton of time yesterday trying to figure out custom buttons! I thought Oh easy! just make a cocoa file subclassing UIButton and go to town… but nooooo! couldn’t be easy could it lol. I did find some good YouTube videos after a lot of searching that helped with what I wanted, but man that was confusing.

lesson of the day?

contentView!!! so I set up this complicated set of stackViews kinda like in the calculator app… okay pretty much exactly like that but the point is I did it in a customTableViewCelll file, which meant I needed to attach that main stackView to a View… but what view? there is no view in a standalone file… SuperView? nope! Xcode did NOT like that. import a view from the viewController? even then, which view am I importing? I’m pretty sure that could work but I didn’t get that far, attempt 3: go to YouTube and watch what they attach things to in custom cell files… yep, contentView!! which is amazing cause I can just slap that thing on all the stackViews I’m making and go to town

also, addSubview vs addArrangedSubviews… yeah don’t try to addSubview when dealing with stacks lol its just silly

also I forgot how to fix that dequereusablecell glitch when you scroll lol gotta go hunt it down.

2 Likes

I’m in north Texas and we have been out of power since 3:30 this morning. It’s 6:30 now and probably not gonna get power till tomorrow, it’s between 5 and 16 degrees Fahrenheit outside and currently 59 degrees inside. We started at 61 when I woke up this morning. So yeah…
This is what they say:

today’s learning experience: the UITabBarController!

woah… that was a lot of work. So I thought to myself. I’d like to have the scale page have the ability to switch the entire screen from major, to 2 octave major/minor/2 octave minor and have the whole table view change accordingly… first I spent an hour trying to install a picker… before realizing a picker wasn’t what I thought it was HAHA In my mind I was installing a tab bar controller, but in code I completely installed a UIPicker facepalm so I ripped that out, looked up tab bar view controller and realized that if I used one of those I would actually need separate viewControllers for each of the 4 tab choices sigh I was hoping to just use the one so I fought the idea for a while before deciding it may be ugly, but its also the easiest way to get the thing working, so I went ahead and installed it. and boy was that a headache lol but now it works! woot!

y’know, sometimes its fun to just hit discard all changes