Pagasi Journal starting the beginner classes!

Wooo!!! :partying_face::partying_face::partying_face: congrats!!!

1 Like

Great job!

1 Like

Okay it’s been a week or so and I’ve had almost all of my students download the app and trained them on it! It’s so nice to not have to reinstall the app every few days, or get a potential betas tester to double authenticate.

I’ve started a new app for my wife which is a simplified blood glucose and carb tracker. Way simpler app than the flashcard app. But I’ve already learned new things! Today’s main lessons were relearning CoreData, as well as getting into Text Fields! Which have delegates and methods galore apparently! I had no idea! Just getting the basic UI up and then I have to make some decisions about the design… backwards? Maybe lol but I have a skeleton design just need to flesh it out is all. No API for this app either, I may write a weather app just to have an API under my belt…

Been following @inversewander Andy! You’re rocking it dude! It’s nice to have a new person to hang out with in the Journals!

1 Like

Thanks @Pagasi, You and the others who are journaling a lot (@Dumby @Scott_Tanaka @Wildsparrow) here really inspired me to do so too! I started so much later than you all so have been trying to catch up so I can participate and add to the discussions. Congrats on your piano App!

2 Likes

Okay so I admit I took a week and didn’t work too hard on apps, but I did get some UI work done yesterday and researched CAShape art a bit. There’s a whole world in there… that I feel completely inadequate to and would rather use photoshop and just upload the image lol! My design needs a serious overhaul though… wish I could just pay a designer lol

We’ve had good luck using Fiver for basic design work.

1 Like

today was one of those days, not a lot of progress, in fact I spent most of my time simply trying to unwrap a conditional string from a text box, it was so weird, nothing seemed to be working. I finally got it to work with this one:

let textBoxFloat = Float(textBox.text!) ?? 0.0

oh well, the app itself is rather simple, I’ve forgotten a good bit of basics though and its slowing me down.

You could break this up to make it easier to read and understand

if !textBox.text.isEmpty {

let textBoxString = textBox.text!
let textBoxFloat = Float(textBoxText) ?? 0.0
}

This is safer because if your textBox.text is empty your app will crash

okay so first of all, thanks @mikaelacaron ! I will probably do just that, but I’m also confused, why is there an ! in front of textBox? seems like a random syntax thing lol. but not I think on it, its probably like a “not” in front of textBox that would return a bool? not sure

second of all, I just realized that I sort of forgot to use Source control like an idiot hahaha I could destroyed the whole app! I’m not too deep in, but it has been a good two weeks of work at least that I couldn’t simply replace. And I miss doing the thing where you start working with no fear of destroying the project with an accidental ninja comma somewhere lol

Thirdly, today I succeeded in setting up my coreData from UI to database, which… with @Chris2 around is just super easy! I’m just not scared of it at all, which is nice! cause I can tell if I had tried to learn that thing on my own, I’d have been completely lost, just setting up the context would have been a month long adventure lol! I probably wouldn’t have even checked the “use Core Data” box when making the app lol. I only mention this because Core data was kinda scary to me still. even though we did so several dataBase apps…

and Lastly… can you save an array to core data? doesn’t seem like you can, I remember saving arrays to firestore…

NO!

Having an exclamation mark at the end is force unwrapping that value if you do this but the value is empty it will crash your app.

Look into optionals and unwrapping optionals

yeah I get that, but what does it do if its in front of the word like !textBox.text.isEmpty

When you have an if statement, the test results in something either being true or false so in the case above where the statement is:

if !textBox.text.isEmpty {

the ! is a logical NOT.
So you read that as "If NOT textBox.text.isEmpty is true then… In other words if textBox.text contains text.

You could write that statement like this which means the same thing:

if textBox.text != "" {
// OR
if textBox.text.isEmpty == false {

It’s worth while getting used to all these little methods that are available for Strings. They often read nicely in your code.

sweet! that was my exact guess in the original post lol! but it was a guess, I didn’t know for sure. now that you lay it out it makes perfect sense though.

5-12-21
Finally setup my GitHub repository lol! so lazy sometimes

Today I got the tableview to update from the Core Database, basic stuff I know, but I’m oddly proud of it. First time to have a fully operational

5-13-21
Apparently I forgot to hit the reply button on yesterday’s post lol whoops.

today I was able to relearn how to present the date with date formating lol I did it once before and it had completely fallen out of my head how to do it. Then I tweaked the UI a bit and added a trailingSwipe to the tableView to delete a row should I get mad at it for some reason lol

THEN, I gave it to my wife to test run for the first time! how exciting! She immediately attempted to swipe the screen up because the keyboard had just covered the lower half of the screen and she wanted to access that part of the screen… sigh keyboards are SUPER annoying on iPhones, have I mentioned that before? I mean it covers up half of the UI and any text fields that might be in that half are immediately inaccessible! But I’m going to follow her instinct, I think just adding a scroll view would let her scroll up to her heart’s content I suppose it does solve the problem… but then I have a bunch of empty space at the bottom of the scroll view lol! It feels ridiculous.

Then after filling out the fields she hit the submit button and of course… nothing appeared to happen, so she hit it again like 5 more times… with of course saved the entire form 6 times to the Core Database hahahaha oh man… good times. So let that be a lesson to ya! submit buttons should always have a visible reaction to being pressed lol. I’m gonna link it to the tableView page tomorrow probably, super easy fix.

@cole_dano I tried googling Fiver for design, but didn’t get any sort of design company to pull up. Do you have a link I could use? I may try doing some CALayer stuff to draw out some fun UI later, but… I also would like having access to a trusted designer.

Fiver is basically to hire a freelancer

It’s very hit or miss if you get someone who’s good (from what I hear)

aha! I see, thanks!

Sorry it’s Fiverr https://www.fiverr.com/ it’s basically a collective of freelancers that can do just about any odd design job. Just type in the service you need and you’ll get a list of people who can do it for a reasonable price.

1 Like

had some fun with a few text box properties, this is the first time I have right clicked and jumped to the definition of something like a UITextField and just rumaged through all the myriad properties and methods lol I was all making a list of the ones I wanted to play with, but in the end they were tricky to actually put in without googling how to use them… it was still fun :slight_smile: I was actually tryin to accomplish something in the process, and I kinda got it to work… to get rid of they keyboard that pops up you have to resign the active box. There are several ways to do it, and just hitting the return button does it all on its own… but I only need floats. and there is no return button on the keypad version of the keyboard. So that’s annoying and you have to manually resign. But as I said there are several ways to do it. I just can’t figure out how to do it and also capture the field that was resigned so that I can mess with it. I know its possible. But I couldn’t figure it out. This code will just resign whatever text field is active when you touch the screen somewhere, but doesn’t tell you which text field got resigned

override func touchesBegan(_ touches: Set, with event: UIEvent?) {
self.view.endEditing(true)
}

woot! success! so I wanted to capture the field that had just been edited into a variable whenever someone touched the screen outside the field to dismiss the keyboard… but instead I just decided to capture ALL the fields.text lol and save them to userdata, and just refil everything when the app reopens… could be a bit excessive to save all the data everytime someone touches the screen hahaha maybe theres something that detects when a first responder resigns and I could put the code there… sounds like a lot of effort hahahaha.

also, I learned how to compare dates to see if they match but while ignoring the time! check it out!

extension Date {

func stringDateOnly() → String {
let formater = DateFormatter()
formater.daeStyle = .medium
return formater.string(from: ​self)

}

date1 = Date()
date2 = Date()
if date1.stringDateOnly() = date2.stringDateOnly() {
print(“success!”)

productive day! but just basic stuff done really. changing backgrounds to red if the number is too high, as well as putting the whole thing in a navigator view.

I’m having trouble finding how to put that thing… like in your iphone contacts on the right, that you can scroll down to the letter you want. I don’t know what its called so I’m having trouble finding tutorials lol

edit: I did find this just now

func selectRow(at: IndexPath?, animated: Bool, scrollPosition: UITableView.ScrollPosition)

“Selects a row in the table view identified by index path, optionally scrolling the row to a location in the table view.”

but I will have to play with it… maybe I can search youtube now that I have something to search for lol

edit 2:

wow! so I copy pasted that code from apples developer site, and it posted blue here, I clicked on it and it took me to this:

You set the scroll position through a parameter of the selectRow(at:animated:scrollPosition:) , scrollToNearestSelectedRow(at:animated:) , cellForRow(at:) , and indexPathForSelectedRow methods.

soooo… apparently there are 4 methods that let you scroll to a position hahaha this is such a random way to figure all this out