Skip to content

Instantly share code, notes, and snippets.

View koingdev's full-sized avatar
🤖
Stay focus

Saingkoing Sea koingdev

🤖
Stay focus
  • Tokyo, Japan
View GitHub Profile
@koingdev
koingdev / Brightness.swift
Created June 26, 2020 07:36
Simple Swift Brightness Manager class
final class Brightness {
// Config
private let maxBrightness: CGFloat
private(set) var defaultBrightness: CGFloat = 1.0
var isEnabled = true {
didSet {
if isEnabled {
@koingdev
koingdev / solid-principle.md
Last active June 20, 2022 09:57
S.O.L.I.D Design Principe Explanation with Example by me

Single-responsibility Principle

A class should have only one responsibility.

Bad

class ViewController: UIViewController {
	func fetchDataFromServer() { //Perform network request code... }
	func insertDataIntoDatabase() { //Perform database insertion code... }
@koingdev
koingdev / Fastfile
Created December 29, 2021 07:14
Fastlane to upload TestFlight on pushing git tag
lane :upload_testflight_on_pushing_tag do |options|
# Tag: Release-1.0.0-100 (Release-Version-Build)
tag_components = sh("git tag --sort=taggerdate | tail -1").split("-")
version = tag_components[1]
build = tag_components[2]
# Increment version and build number
increment_version_and_build_number(version: version, build: build)
# Generate iPA