Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
new work, new life

Bosn Bosn

💭
new work, new life
View GitHub Profile
View URLSession_Synchronizationn.swift
import Foundation
enum BoError: Error {
case CommonError
}
func fetchWorker() -> Result<Int, BoError> {
var result: Result<Int, BoError>!
let semaphore = DispatchSemaphore(value: 0)
URLSession.shared.dataTask(with: URL(string: "https://actin.tech/worker")!) { data, response, error in
@Bosn
Bosn / URLSession POST.swift
Created May 13, 2020 — forked from dmathewwws/URLSession POST.swift
URLSession POST request example
View URLSession POST.swift
private static func createUserEventData(user:SKUser, eventType:SKEventType, sticker:Sticker?) {
// server endpoint
let endpoint = "https://app.stickerkit.io/userEvent/v1/\(user.projectID)"
guard let endpointUrl = URL(string: endpoint) else {
return nil
}
//Make JSON to send to send to server
@Bosn
Bosn / loading_mask.md
Last active Oct 16, 2018
Loading Mask
View loading_mask.md
.loading-mask {
  position: absolute;
  top: calc(50% - 25px);
  left: calc(50% - 25px);
  z-index: 1000;
}

.loading-mask::before {
  content: '';