Number: 028, Date: 2024-07-15

2024.07.09 ~ 2024.07.14

🚨 Github Blog Workflow Fix


There was an error with the GitHub workflow related to deploying posts to this đź”—Github Blog Repository.

This repository has two workflows for deployment:

  1. ci.yml: A workflow that checks if the build and make commands execute properly.
  2. deploy.yml: A workflow that overwrites the output to the đź”—sookim-1.github.io repository.

I modified the workflows to fix the error.

First, there was a version mismatch between the Ubuntu version running the workflow and the node version, so I upgraded Ubuntu to 20.04 and matched the Swift version accordingly. I also set Swift as the image.

Second, there was an issue where the GoogleSearchConsole, Naver Webmaster Tools HTML files, and robots.txt were being overwritten in the deployed đź”—sookim-1.github.io repository. I resolved this by moving the files to the đź”—Github Blog Repository and ensuring they were added to the output folder.

Lastly, I consolidated many redundant steps. Since ci.yml and deploy.yml execute consecutively, I combined them into a single build-and-deploy.yml workflow.

⌨️ becomeFirstResponder


I used becomeFirstResponder in viewWillAppear to focus on a UITextField when entering the screen, but this caused stuttering because viewWillAppear is called before the view is fully loaded.

Calling becomeFirstResponder in viewDidAppear solved the stuttering issue since it’s invoked after the view is fully displayed, but it felt a bit slow.

By disabling the animation in the pushViewController method of UINavigationController during screen transitions, I was able to prevent the stuttering. To mimic the feel of an animated transition without stuttering, I implemented custom animations for transitions.

extension UINavigationController {
    func pushViewControllerCustomAnimation(_ vc: UIViewController) {
        let transition = CATransition()
        transition.duration = 0.3
        transition.type = CATransitionType.push
        transition.subtype = CATransitionSubtype.fromRight
        transition.timingFunction = CAMediaTimingFunction(name: CAMediaTimingFunctionName.easeInEaseOut)
        
        view.layer.add(transition, forKey: kCATransition)
        pushViewController(vc, animated: false)
    }

    func popViewControllerCustomAnimation(completion: @escaping () -> Void) {
        let transition = CATransition()
        transition.duration = 0.3
        transition.type = CATransitionType.push
        transition.subtype = CATransitionSubtype.fromLeft
        transition.timingFunction = CAMediaTimingFunction(name: CAMediaTimingFunctionName.easeInEaseOut)

        view.layer.add(transition, forKey: kCATransition)
        popViewController(animated: false, completion: completion)
    }
}


### 🙋🏻‍♂️ Other Notes

---

1. I added `[credential] helper = osxkeychain` to the `.gitconfig` file to prevent the `git credential osxkeychain` pop-up from appearing every time I accessed it.
   `$ git config --global credential.helper osxkeychain`
2. I researched and tested Firebase Crashlytics customization and Firebase TestLab products.
3. I reviewed the concepts of Swift Package and SPM and documented how to create projects with them. I plan to add more on the structure later.
4. I briefly reviewed the main changes in Xcode 16, Swift 6, SF Symbols 6, and macOS Sequoia. I’m considering upgrading immediately once the final versions are released.
5. I organized the access accounts for App Store Connect.