Skip to content

Instantly share code, notes, and snippets.

class alignas(MaximumAlignment) AsyncContext {
public:
/// The parent context.
AsyncContext * __ptrauth_swift_async_context_parent Parent;
TaskContinuationFunction * __ptrauth_swift_async_context_resume
ResumeParent;
}
func caller() async {
let version = await getSwiftVersion()
await printSwiftVersion(number: version)
}
func getSwiftVersion() async -> Int {
print("Getting swift version")
return 7
}
@vikage
vikage / gist:1e6d1bd118750aaaf2394e3285bed66d
Last active March 15, 2023 07:06
Config CI/CD for iOS project
1. Config secret env keys:
+ MATCH_PASSWORD: Match repo password
+ MATCH_GIT_BASIC_AUTHORIZATION: Match repo basic auth
2. Write fastlane pipeline
+ Create keychains
+ Update bundle version,...
+ Call match to install cer & profiles
+ Run unit test
+ Call gym to build app
+ Distribution iap to appstore/firebase
@vikage
vikage / BUILD
Created April 17, 2022 05:56
AppClasses after add Alamofire deps
swift_library(
name = "App_Classes",
srcs = glob([
"*.swift",
]),
data = [
"Base.lproj/LaunchScreen.storyboard",
"Base.lproj/Main.storyboard",
"//Assets",
],
@vikage
vikage / BUILD
Created April 17, 2022 05:48
Alamofire BUILD
load("@build_bazel_rules_swift//swift:swift.bzl", "swift_library")
swift_library(
name = "Alamofire",
srcs = glob([
"Sources/Source/*.swift",
]),
module_name = "Alamofire",
visibility = ["//visibility:public"],
)
Pod::Spec.new do |s|
s.name = 'Alamofire'
s.version = '5.6.0'
s.license = 'MIT'
s.summary = 'Elegant HTTP Networking in Swift'
s.homepage = 'https://github.com/Alamofire/Alamofire'
s.authors = { 'Alamofire Software Foundation' => 'info@alamofire.org' }
s.source = { :git => 'https://github.com/Alamofire/Alamofire.git', :tag => s.version }
s.documentation_url = 'https://alamofire.github.io/Alamofire/'
@vikage
vikage / AppDelegate.swift
Created April 16, 2022 06:41
AppDelegate.swift configure firebase
import UIKit
import FirebaseCore
@main
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
self.window = UIWindow(frame: UIScreen.main.bounds)
@vikage
vikage / BUILD
Created April 16, 2022 06:34
App_Classes after add firebase crashlytics
swift_library(
name = "App_Classes",
srcs = glob([
"*.swift",
]),
data = [
"Base.lproj/LaunchScreen.storyboard",
"Base.lproj/Main.storyboard",
"//Assets",
],
@vikage
vikage / BUILD
Last active April 16, 2022 06:32
Bazel build for firebase crashlytics
load("@build_bazel_rules_apple//apple:apple.bzl", "apple_static_framework_import")
apple_static_framework_import(
name = "FirebaseAnalytics",
framework_imports = select({
"@//config:is_arm": glob(["Firebase/FirebaseAnalytics/FirebaseAnalytics.xcframework/ios-arm64_armv7/FirebaseAnalytics.framework/**"]),
"@//conditions:default": glob(["Firebase/FirebaseAnalytics/FirebaseAnalytics.xcframework/ios-arm64_i386_x86_64-simulator/FirebaseAnalytics.framework/**"]),
}),
visibility = ["//visibility:public"],
)
struct User {
var age: Int
var isActive: Bool
var isAdmin: Bool
}