Closure that returns String

PHOTO EMBED

Thu Jun 09 2022 10:49:22 GMT+0000 (Coordinated Universal Time)

Saved by @hasnat #ios #swift #closure #return

// calling 
    getProfileMode { (mode) in
            print("Mode : ", mode)
        }

func getProfileMode(completion: @escaping (String) -> Void) {
           // write firestore code here
            completion("true")
        }
content_copyCOPY