Andrew's Journey to Release an app

Day 39 - Focused Parameter

Saturday, February 12, 2022

Today, I learned how to use the new iOS 15 .focused parameter in SwiftUI. It accomplishes something, I always liked from many apps: if you press enter on the current field, it jumps you to the next one.

I also learned how to show/ hide a password field in a nice looking way.

See my repo here for more details on all this, and check out the awesome tutorial @joash recommended for this How to use @FocusState in SwiftUI | Bootcamp #60.

1 Like

Congratulation @RedFox1!

1 Like

Day 40 - Started Design Course!

Sunday, February 13, 2022

Was so excited to start the Design course today!! I’m glad that future students will begin this course before the Database course as well. This seems like the easier of the two course, plus it’s easy to get excited about beautiful designs.

I would have stayed away from drawing my own shapes in SwiftUI, but Chris breaks down the process, so easily! Plus, the reasons he cites for using your own designs are great. You get so much more performance this way. It takes way less memory and time for SwiftUI to generate an image versus to load a pre-made one from memory. In addition, it allows you full control of the object; rotating it; multiplying it; changing the colors are made easier through this method.

Day 41 - Valentine’s Day Break

Monday, February 14, 2022

Because of Valentine’s Day, I only managed to answer one person’s question in the forum! I took a stab at a notification question, and hope it works…

Day 42 - Design Course M1L2 Challenge

Tuesday, February 15, 2022

I was thrilled to get a CWC+ challenge as part of the SwiftUI Design course. It seems like, so long, since I received any challenges from CWC+. The Database course lacked many of the challenges that were so frequent in the early stages of the Foundations course, so happy to receive one through the Design course. Just as Chris said, it was a lot of fun to recreate this one design from scratch! I even used Photoshop to determine as closely as possible to the shape dimensions used by Chris, after trying them on my own. Pretty cool, what you can create with only SwiftUI shapes:

1 Like

Day 43 - Decodable + API Practice

Thursday, February 17, 2022

Took a shot again at trying to solve this question, and got some good API practice as part of it. Although, still haven’t figured out the true solution. Cool there’s an open source API with all the dog images though.

Day 44 - Dogs API + Paths

Sunday, February 20, 2022

Today, I continued hacking away at an interesting subject with Dog APIs. Through this, I learned how easy it is to use AsyncImages to seamlessly load multiple images from several URLs all at once.

Also, I continued with the Design course finishing the module one lesson three. It’s amazing what Paths can do! A Path describes where on an x/y coordinate system lines should be drawn, and can be used to create custom shapes. It’s a lot of fund, highly recommend it to anyone!

Wow. Amazing documentation :clap:

1 Like

Haha thanks @MeenakshiPoorani! The journal has become more or less my own personal journal, so I hope you got some value out of it :slight_smile:

I highly recommend starting one yourself, if you want to stick with learning Swift! It helped me get closer to my goal of coding an hour a day, not procrastinating on this, and just enjoying to code. There’s so much involved in this programming language/ the steps needed to create an app. However, once you learn a new feature e.g. the tab view, or a sheet, it’s so easy to implement it in your own app, because you can reference your old code/ have the knowledge of how to implement it.

Cheers,
Andrew

1 Like

Days 45-47 - Creating PDFs, Share Button Implementation

Friday, Saturday, Sunday, February 25-27

I spent the last couple of days learning how to create a PDF based on data. This is one critical feature I’ve missed from CWC+, so far, the ability to export a View or data from your app into a PDF, and share it. So I learned how to accomplish this the past couple of days :slight_smile: the sections on how to implement UIKit code within a SwiftUI app were critical to getting this working! Without those CWC+ sections I would have been completely lost.

Here are some links that helped me along the way:
This article goes into depths on how to create a PDF within Swift:

This StackOverFlow describes turning Views into PDFs:

Describes how to open a PDF within an app:

How to create a PDF:
https://www.hackingwithswift.com/example-code/uikit/how-to-render-pdfs-using-uigraphicspdfrenderer

Details how to share an item:
Showing 'UIActivityViewController' in SwiftUI - Stack Overflow.

Details more on the sharing feature within Swift as well as how to create your own share button such as “mustachify” :wink:

Wow, this is a fantastic journey.

I wish I could read through it all, but I’m too busy learning on my own journey. I’m wayyyy back behind you, but I can see your dust in the distance ahead of me. :grinning:

I echo what you’ve said above when you recommend that others, especially us beginners, keep a journal like this.

In my case, I add a word or two on my blog whenever I complete a lesson. Entirely for my own benefit, so that I can look back and remind myself what I’ve previously learned (especially when I can’t recall learning it!). If others benefit from our ramblings, then it’s done double-duty.

Keep up your journal because I know for sure that when I get stuck with something, I’ll be perusing how you’ve overcome it.

1 Like

Day 48 - Share Restrictions & Shapes

Monday, February 28, 2022

Today, I worked on how to restrict users from sharing certain PDFs generated within apps. It’s weird to me that Apple produced many ways to restrict sharing of content, but then failed to give developers the ability to restrict some access. For example, you can prevent the app from showing copy, message, mail, etc. as share options, but you cannot prevent them from being able to Save to Files the generated PDF.

Also, I worked on the module one lesson three challenge in the Design course. I was happy to finally finish this. It’s weird drawing with shapes, but I can see how powerful creating these own graphics can be.
Challenge was to create your own shapes like this:

Here’s my solution code. It’s not exactly like the example given, but it was the only way I could get the two shapes to show up with different colors. Before, I tried making it with a single Path object, but then I was unable to change the colors (although, the shapes were more closely in the middle then).

I was surprised to find that the shape on the right was composed of two triangles as well. Always need to think about this stuff with drawing with shapes! So much can be made by re-using shapes.

//
//  ContentView.swift
//  PathsChallengeL3
//
//  Created by Leone on 2/22/22.
//

import SwiftUI

struct ContentView: View {
    var body: some View {
        
        HStack(alignment: .center) {
            // MARK: - Arrow
            Path { path in
                path.addLines(
                    [
                        CGPoint(x: 50, y: 225), // Top-left point
                        CGPoint(x: 150, y: 225), // Top-right
                        CGPoint(x: 230, y: 425), // Middle
                        CGPoint(x: 150, y: 625), // Bottom-right line
                        CGPoint(x: 50, y: 625), // Bottom line
                        CGPoint(x: 130, y: 425), // Bottom-left -> Middle
                        CGPoint(x: 50, y: 225) // Middle -> top-right
                    ]
                )
                
                path.move(to: CGPoint(x: 250, y: 450))
                
                // MARK: - Yellow Star
//                path.addLines([
//                    CGPoint(x: 250, y: 385), // left-top
//                    CGPoint(x: 290, y: 385), // top-left
//                    CGPoint(x: 315, y: 345), // top-right edge
//                    CGPoint(x: 340, y: 385),
//                    CGPoint(x: 380, y: 385), // right-top
//                    CGPoint(x: 365, y: 425), // right star
//                    CGPoint(x: 380, y: 465),
//                    CGPoint(x: 340, y: 465), // bottom-right edge
//                    CGPoint(x: 315, y: 505), // bottom-middle right
//                    CGPoint(x: 290, y: 465), // bottom middle left
//                    CGPoint(x: 250, y: 465),
//                    CGPoint(x: 265, y: 425),
//                    CGPoint(x: 250, y: 385)
//                ])
            }
            .foregroundColor(.blue)
            .frame(width: 10)
            
            Path { path in
                path.addLines([
                    CGPoint(x: 250, y: 385), // left-top
                    CGPoint(x: 290, y: 385), // top-left
                    CGPoint(x: 315, y: 345), // top-right edge
                    CGPoint(x: 340, y: 385),
                    CGPoint(x: 380, y: 385), // right-top
                    CGPoint(x: 365, y: 425), // right star
                    CGPoint(x: 380, y: 465),
                    CGPoint(x: 340, y: 465), // bottom-right edge
                    CGPoint(x: 315, y: 505), // bottom-middle right
                    CGPoint(x: 290, y: 465), // bottom middle left
                    CGPoint(x: 250, y: 465),
                    CGPoint(x: 265, y: 425),
                    CGPoint(x: 250, y: 385)
                ])
            }
            .foregroundColor(.yellow)
            
        }
    }
}

struct ContentView_Previews: PreviewProvider {
    static var previews: some View {
        ContentView()
    }
}

Thank you so much for the guidance :smiling_face_with_three_hearts: Yeah, I’ve started to maintain a personal journal here too and yeah, its been incredibly motivating :innocent: And as much as I’ve been learning programming here, I wish to develop my ability to clearly describe my workflow too and your journal has been a real inspiration in that regard :heart:

1 Like

@JRudderham thanks so much for your kind words, and reading even a bit! This has become almost a journal solely for my own uses, but glad to see it can help out others.

What’s your blog?? Haha and it’s true!! You and me both do exactly the same thing. That’s great to see, 100% with you on this. I’ve been making public repos of all my lessons completed as well

Haha yes, please do!! Let me know as well, if you end up using it to solve something. Feel free to reach out on DM anytime as well :slight_smile:

Keep up the coding and journaling my friend!

Cheers,
Andrew

Hey Meenakshi, that’s great news! Glad to hear you’ve taken action in this direction, and appreciate the compliment :slight_smile:

You write well already, so with practice daily, you’ll only improve!

1 Like

That’s fantastic. I’ve just had a quick look at your repos, and that’s definitely something I’m going to have to browse through as soon as I have the time. That’s going to be very useful.

I’ve only been using GitHub in its most basic sense so far, but I intend to use it more (my hobby is story-writing, and I want to explore how to use GitHub to keep track of changes when writing & editing). Prior to CWC, Git/GitHub was something I’d “heard of, but never used”.

Other than learning code and hobby-writing, my free time is taken up with running. I mostly run on roads. Why do I mention this?

Well, I’m a ‘road runner’ that also ‘codes’, so my blog can be found at: https://coderunner.uk (a coder road-runner - yeah, not very imaginative, I know! :smiley: ).

I try to keep my blog light-hearted if I can, in order to remind myself that the learning may be heavy-going at times but keeping it light is the best way to move forward.

1 Like

Thank you :smiling_face_with_three_hearts:

1 Like

Day 49 - GitHub Search Tricks & SwiftUI Dates Challenge

Wednesday, March 2, 2022

Today, I learned how to search GitHub more effectively. I learned how to filter to a particular username’s repositories, as well as search for a string within all of the files ending in a certain extension. For example, I searched for all occurrences of Date within my GitHub repos with the following query:

user:<userName> extension:swift <searchTerm> in:file
user:agholson extension:swift Date in:file

This reference provides more examples on how you can search. I love how they word that they will ignore certain keywords:

Also, was grateful for the challenge from @alexbard here in his date’s app. I ended up writing the code for the middle list of dates (full repo here):

Hey Jonathan,

What a beautiful website and killer domain name you have! This is great, I love the design here:

How are the views on your site? I often journal and post excellent READMEs with detailed notes in my repo, but I doubt anyone’s looking at them. However, regardless for me, it’s great to have them hosted via GitHub for free. I can do super-fast global searches across all my repos looking inside every Swift file for code I used in the past. It’s very helpful for things I did months ago.

This is great! I’m going to take a look at one of your posts now to get a feel for your writing style. We have similar outlooks. I love the positivity!

You should create a separate post in the Community section to point others towards your blog too!

1 Like

Day 50 - Re-Useable Views

Thursday, March 3, 2022

Today, I worked on a little challenge on my own on how to create a re-useable View with yes/ no questions side by side. So you can pass in a list of questions, then it will automatically create yes/ no buttons for each of them.

1 Like