Skip to content

Instantly share code, notes, and snippets.

View ElonPark's full-sized avatar
📱
 iOS Software Engineer

Elon Park ElonPark

📱
 iOS Software Engineer
View GitHub Profile
// MARK: - DummyInteractor
final class DummyInteractor:
PresentableInteractor<DummyPresentable>,
DummyInteractable,
DummyPresentableListener
{
private let dummyUseCase = DummyUseCase()
🌞 Morning 12 commits ▍░░░░░░░░░░░░░░░░░░░░ 2.0%
🌆 Daytime 99 commits ███▌░░░░░░░░░░░░░░░░░ 16.8%
🌃 Evening 269 commits █████████▌░░░░░░░░░░░ 45.5%
🌙 Night 211 commits ███████▍░░░░░░░░░░░░░ 35.7%
import RIBs
import RxSwift
import RxRelay
import ReactorKit

protocol FAQsRouting: ViewableRouting {
  func routeToFAQ(_ faq: FAQ)
  func detachFAQ()
}
@ElonPark
ElonPark / CustomBot.py
Last active January 27, 2020 12:34
like test
import instabot
class CustomBot:
def __init__(self):
self.bot = instabot.Bot()
self.bot.login(username='', password='',
use_cookie=False)
def test_like(self):
//:
//: UIView Animation Syntax Sugar
//:
//: Created by Andyy Hope on 18/08/2016.
//: Twitter: @andyyhope
//: Medium: Andyy Hope, https://medium.com/@AndyyHope
import UIKit
extension UIView {
@ElonPark
ElonPark / BetterXcodeJumpToCounterpartSwift.org
Created November 19, 2019 12:26 — forked from danielmartin/BetterXcodeJumpToCounterpartSwift.org
Add support for a better Xcode's Jump to Next Counterpart in Swift

If you work on a Swift project that follows the Model-View-ViewModel (MVVM) architecture or similar, you may want to jump to counterpart in Xcode from your view to your model, and then to your view model. (ie. by using Ctrl+Cmd+Up and Ctrl+Cmd+Down).

You can do this in recent versions of Xcode by setting a configuration default.

From a terminal, just type this command and press Enter:

defaults write com.apple.dt.Xcode IDEAdditionalCounterpartSuffixes -array-add "ViewModel" "View"
//
// ViewController.swift
// Rainist
//
// Created by Elon on 23/04/2019.
// Copyright © 2019 Elon. All rights reserved.
//
import UIKit
import RxSwift
enum AppStoryboard: String {
case main = "Main"
}
extension UIViewController {
static func instantiate<T: UIViewController>(by storyboardName: AppStoryboard) -> T? {
let type = String(describing: T.Type.self)
guard let identifier = type.components(separatedBy: ".").first else { return nil }
let storyboard = UIStoryboard(name: storyboardName.rawValue, bundle: nil)
@ElonPark
ElonPark / StringAttributeExtension.swift
Created March 23, 2019 20:49
어트리뷰트 스트링을 편하게 사용하기 위한 익스텐션
extension String {
/**
## bold
- Parameter size: 폰트 크기
- Parameter color: 폰트 컬러
*/
func bold(size fontSize: CGFloat, color: UIColor? = nil) -> NSMutableAttributedString {
var attributes: [NSAttributedString.Key : Any] = [
@ElonPark
ElonPark / ArrayTransform.swift
Created February 26, 2019 18:23
Realm, ObjectMapper 사용시 JSON Array를 Realm Object List로 변경하기 위해 사용한다.
import RealmSwift
import ObjectMapper
class ArrayTransform<T: RealmSwift.Object>: TransformType where T: Mappable {
typealias Object = List<T>
typealias JSON = Array<AnyObject>
/**
- Parameter value: JSON Value
- Returns: if value is `nil` or not Array will be return empty List<T>