Skip to content

Instantly share code, notes, and snippets.

We couldn’t find that file to show.

unnamed

Just follow the steps and it should work again: Menubar → Product → Destination → Destination Architectures → Show Both Run the project on a device you desire, but with Rosetta. (i.e., iPhone 14 Pro Max (Rosetta)

@asimnajam
asimnajam / async-await dataTask
Last active January 23, 2023 18:01
Usage of Async/Await in UIKit based iOS Application
// Referenaces
// https://developer.apple.com/videos/play/wwdc2021/10095/
// https://swiftly.dev/async-await
// https://www.avanderlee.com/swift/async-await/
// https://swiftsenpai.com/swift/async-await-network-requests/
enum CustomError: Error {
case invalidRequest
case unsupportedImage
}
@asimnajam
asimnajam / gist:4fea5c93c06184ddecb2fa6c69a8d2ad
Created February 21, 2022 10:59
Multiple Choice Question JSON
{
"questions":[
{
"id": 0,
"query":"We can return multiple values from a function using?",
"answers":[
{
"correct":true,
"title":"Tuple"
},
@asimnajam
asimnajam / gist:0c43a9c51c07080d34c950ca4d6e1dad
Created September 15, 2021 10:18
Instantiating Storyboard Using Protocol Extension
protocol Storyboarded {
static var name: String { get }
static func instantiate() -> UIViewController
}
extension Storyboarded where Self: UIViewController {
static var name: String { return "Main" }
static func instantiate() -> UIViewController {
let storyboard = UIStoryboard(name: name, bundle: .main)