Number: 001, Date: 2024-01-08

2024.01.01 ~ 2024.01.07

🌏 New Screen Development Tips


When developing a new screen, you may implement the UI first and then the business logic, or vice versa. Regardless, when testing before the API is developed, if the server and response format are agreed upon, you can add a Mock JSON file to proceed with testing.

The advantage of this method is that you can deploy the app to TestFlight before the API is developed, reducing testing time, and you can write UnitTests to test without direct networking.

  1. Add JSON file
  2. Add parsing function
    import SwiftyJSON
    
    func loadLocalJSONFile(filename: String) -> JSON {
        if let path = Bundle.main.path(forResource: filename, ofType: "json") {
            do {
                let data = try Data(contentsOf: URL(fileURLWithPath: path), options: .mappedIfSafe)
                let json = try JSON(data: data)
    
                return json
            } catch {
                fatalError("Unable to read data.")
            }
        } else {
            fatalError("Invalid path.")
        }
    }
    

🤖 Dependency Library Update


The project is using fixed versions of libraries, and updates are being carried out on a yearly basis.

  1. With the update of the Google Sign-In version from 5.0 to 7.0, some singleton objects and implementation methods have changed, requiring handling of these changes.
    1. Reference Link
    2. The GoogleUtilities dependency of the Google Sign-In library is connected with Firebase products, so the versions need to be matched.
  2. Firebase products have complex dependencies, so you need to check them before proceeding with the work.
    1. Search for the library in the Cocoa Pod search bar, then go to CocoaPods Spec to check the dependencies key value, remove separately installed items, and handle version matching.
    2. 🧐 [CP] Copy Pods Resources has been removed??When upgrading the Firebase products and Google Sign-In pod versions, the [CP] Copy Pods Resources, which is automatically generated during pod install in Xcode → Build Phases, is not added.→ The purpose of the [CP] Copy Pods Resources script is an automatically generated script in CocoaPod, created when there are resources (images, fonts, etc.) in the added Pod. The above issue occurs because there are no resources in Firebase or Google Sign-In pods, but it is not an issue.
  3. Review and change manually installed Pods
    1. Manually installing libraries has the advantage of customization, but if there is no significant reason, remote installation is more stable.

Caution

  1. If the CocoaPod Spec and Github Releases Tag version are differentEven if you check the Release tag version of the library’s Github repository and install the pod, if it is not in the CocoaPods Spec, it will not be installed, so install based on the CocoaPods Spec.
  2. If you are indicating a license, you need to check if the version also needs to be updated.