Andrew's Journey to Release an app

Day 37 - Answering Forum Questions

Tuesday, February 8, 2022

Happy to report that I can now finallyyyyyy understand, and answer CWC Forum questions! Instead, of coding myself, so much today, I spent it answering others’ questions.

I was always in awe of some of the people that were able to answer left and right the different questions. That was one of my major goals: to be able to read and understand other people’s Swift code/ questions.

A bit thank you to the CWC+ staff that helped me get here! So many of the concepts taught are essential ingredients to any app.

1 Like

Day 38 - PHPicker + Live Text

Wednesday, February 9, 2022

Today, I went over how to use the PHPicker versus the UIImagePickerController for photos in SwiftUI. Previously, I got a deprecation warning for UIImagePickerController, but now I don’t. It makes me wonder, if there was a deprecation warning at all, because I can’t even recreate that warning… so eventually, I read some articles about the PHPicker. It has some bonuses, like limiting the content from the photo library to Live Photos, no videos, etc, that the UIImagePickerController did not contain. However, I could not find how to use it to select the person’s camera. For this reason, I kind of gave-up on the refactor.

During my research though, I learned about a powerful new Live Text feature in iOS 15, which allows newer devices to do natural language processing live or of photos, so that you can easily copy all the text in an image. One of my apps would benefit greatly from this feature, but unfortunately my iPhone is too old to use it itself. Great tutorial on it here: Capturing Text From Camera Using SwiftUI | raywenderlich.com.

Also, I analyzed some of the success stories from CWC. Some of the apps looked so professional, while others seemed to solve niche problems important to different users. Still, I wasn’t able to gear the success overall of the app. Would love to know the business metrics behind them, e.g. downloads, revenues, profits, etc.

1 Like

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):