loading...
Cover image for Day 16: Swift macOS password manager for people who hate the cloud

Day 16: Swift macOS password manager for people who hate the cloud

swlkr profile image Sean Walker ใƒป2 min read

<- For Day 15 go here

๐Ÿ“… 01/16/2019
๐Ÿš€ 14 days until launch
๐Ÿ”ฅ 15 day streak
๐Ÿ’ฐ $2.99 price (into cup of coffee territory now)
๐Ÿค‘ $0 revenue
๐Ÿ“ˆ 0 customers
โŒš๏ธ 13.5 hours spent
๐Ÿ’ป 20 files changed, 1324 insertions(+), 171 deletions(-)
๐Ÿ Today's goal: Copy buttons for username, email and password

6:00 AM
Decided to just be tired and see how much I could get done before work.

7:06 AM
Hey! Xcode crashed finally. Was trying to use gravity areas and a stack view and moving the last gravity area in storyboard caused Xcode to quit really quickly, not even so much as a beach ball ๐Ÿ–

8:00 AM
Just messed around with stackviews for hours at this point. Still don't understand them. Time to abandon ship and come up with something else for when username or email is nil

8:10 AM
It's a beauty:

    override func viewDidLoad() {
        super.viewDidLoad()
        let loginTable = Login()
        let kc = KeychainSwift()

        nameOrUrlValue.stringValue = login?[loginTable.name] ?? login?[loginTable.url] ?? ""

        let username = login?[loginTable.username] ?? ""
        let email = login?[loginTable.email] ?? ""
        let password = kc.get(login?[loginTable.key] ?? "") ?? ""

        if username.count > 0 {
            label1.stringValue = "Username"
            value1.stringValue = username

            if email.count > 0 {
                label2.stringValue = "Email"
                value2.stringValue = email

                label3.stringValue = "Password"
                value3.stringValue = password
            } else {
                label2.stringValue = "Password"
                value2.stringValue = password
            }

        } else {
            label1.stringValue = "Email"
            value1.stringValue = email

            label2.stringValue = "Password"
            value2.stringValue = password
        }
    }

You know you're doing something wrong when you have nested if/else statements. Shhh, don't tell anyone. It's our little secret. What's that saying? Move fast and break society? That doesn't sound right.

I didn't even manage to get the copy buttons in there, maybe I can squeeze it in after work.

7:00 PM
I'm here, I'm without beer, ready to rock and roll

7:27 PM
Done! 27 minutes and I did quite a few things, I decided to abandon the "view" view and just show the edit view when selecting things from the list, not sure if I like that yet, and behold, copy buttons:

Cool as a cucumber

See you tomorrow ๐Ÿ‘‹

Posted on by:

swlkr profile

Sean Walker

@swlkr

Takes hikes ๐Ÿ” Makes sites ๐Ÿ‘จโ€๐Ÿ’ป

Discussion

markdown guide