Skip to content

Instantly share code, notes, and snippets.

@Bumsuk
Bumsuk / MyApp.swift
Last active July 3, 2021 04:23
iOS 14+ SwiftUI Main
import SwiftUI
// MARK: - CheckVersion
@main
struct CheckVersion {
static func main() {
if #available(iOS 14.0, *) {
MyApp.main()
} else {
@Bumsuk
Bumsuk / iOS14EnvironmentApp.swift
Created July 3, 2021 04:06
iOS 14+ SwiftUI LifeCycle Observe
//
// iOS14EnvironmentApp.swift
// iOS14Environment
//
// Created by brown on 2021/07/03.
//
import SwiftUI
@main
@Bumsuk
Bumsuk / print.swift
Created October 24, 2020 06:15
Debug 모드에서만 출력시키는 print 함수(Swift.print 대체)
//
// Log_Latest.swift
// MyLibrary
//
// Created by brown on 2020/10/24.
// Copyright © 2020 brown. All rights reserved.
//
import Foundation
@Bumsuk
Bumsuk / RealmManager.swift
Last active September 6, 2021 01:17
Realm을 멀티스레드 환경에서 쉽게 사용하기 위한 구조체
import RealmSwift
struct RealmManager {
enum Thread {
case main, worker
var queue: DispatchQueue {
(self == .main) ? RealmManager.mainThread : RealmManager.workerThread
}
}
@Bumsuk
Bumsuk / fastlane_beta_lane.rb
Created June 12, 2020 15:41
[임시] fastlane beta 버전 lane 동작 OK > 보완필요
# This file contains the fastlane.tools configuration
# You can find the documentation at https://docs.fastlane.tools
#
# For a list of all available actions, check out
#
# https://docs.fastlane.tools/actions
#
# For a list of all available plugins, check out
#
# https://docs.fastlane.tools/plugins/available-plugins
# Define a class with the class keyword
class Human
# A class variable. It is shared by all
# instances of this class.
@@species = "H. sapiens"
# Basic initializer
def initialize(name, age=0)
# Assign the argument to the "name"
@Bumsuk
Bumsuk / 1-setup.md
Created April 30, 2020 06:55 — forked from troyfontaine/1-setup.md
Signing your Git Commits using GPG on MacOS Sierra/High Sierra

Methods of Signing with GPG

There are now two ways to approach this:

  1. Using gpg and generating keys
  2. Using Kryptonite by krypt.co

This Gist explains how to do this using gpg in a step-by-step fashion. Kryptonite is actually wickedly easy to use-but you will still need to follow the instructions

For using a GUI-based GIT tool such as Tower or Github Desktop, follow the steps here for signing with either GPG or Krypt.co.

@Bumsuk
Bumsuk / closer_complex.swift
Created April 20, 2020 10:25
이중으로 꼬여있는 클로저 함수 예제
//
// ViewController.swift
// closerFinal
//
// Created by brown on 2020/04/20.
// Copyright © 2020 brown. All rights reserved.
//
import UIKit
@Bumsuk
Bumsuk / Currying_Samples.swift
Last active April 20, 2020 01:05
currying 함수의 예
//
// Currying_Samples.swift
// MyLibrary
//
// Created by brown on 2020/04/20.
// Copyright © 2020 brown. All rights reserved.
//
import Foundation
@Bumsuk
Bumsuk / ViewController.swift
Created April 18, 2020 11:37
Objective-C 런타임을 사용한 동적 객체 프로퍼티 추가 예제
//
// ViewController.swift
// objc_runtime
//
// Created by brown on 2020/04/18.
// Copyright © 2020 brown. All rights reserved.
//
import UIKit