Dev Notes

Dev Notes: January 31 - February 6, 2025

Work

Pull-down Button in SwiftUI

Today I learned how to implement SwiftUI’s pull-down menu, I also like the implementation. This is a real implementation in updating the user’s gender.

Menu {
    Button {
        Task {
            let json = [
                "gender": "male"
            ]
            do {
                try await profileObservable.updateJobseekerProfile(json: json)
            } catch {
                print("Save employer details error: \(error)")
            }
        }
    } label: {
        Text("Male")
    }
    Button {
        Task {
            let json = [
                "gender": "female"
            ]
            do {
                try await profileObservable.updateJobseekerProfile(json: json)
            } catch {
                print("Save employer details error: \(error)")
            }
        }
    } label: {
        Text("Female")
    }
} label: {
    Text("Gender: \(profileObservable.jobseekerProfileData?.jobData?.gender ?? "")")
        .font(OnlineJobsFont.semiBoldFont)
        .frame(maxWidth: .infinity, alignment: .leading)
        .background(Color(.background))
        .listRowBackground(Color(.background))
        .padding()
}

Xcode Reason Codes

I found out that Xcode has some “code” in their crash reports. My favorite has to be 0xd00d2bad (3490524077) — pronounced “dude, too bad”.