π
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension ASLayoutElementStyle { | |
@discardableResult | |
func shrink(value: CGFloat = 1.0) -> Self { | |
self.flexShrink = value | |
return self | |
} | |
@discardableResult |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct A { | |
let p: Value? | |
let b: Value | |
} | |
_ = A(p: nil, b: Value()) | |
sturct A { | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <UIKit/UIKit.h> | |
@interface UIView (TLLayout) | |
@property (nonatomic, strong) NSArray *hiddenConstraints; | |
// set hidden and remove any constraints involving this view from its superview | |
- (void)hideAndRemoveConstraints; | |
- (void)showAndRestoreConstraints; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SlackMessage is SlackMessage object | |
type SlackMessage struct { | |
Type string `json:"response_type"` // key: type default: in_channel | |
Text string `json:"text"` | |
Attatchments []SlackMessageAttachment `json:"attachments"` | |
} | |
// SlackMessageAttachment is SlackMessage attachment object | |
type SlackMessageAttachment struct { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import RxSwift | |
import RxCocoa | |
// MARK: - Action | |
extension Reactive where Base: TestViewModel { | |
var refresh: Binder<Void> { | |
return Binder(base) { viewModel, _ in | |
guard let id = viewModel.viewState.value?.id else { return } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protocol DataPassing: class { | |
associatedtype DataSource | |
var dataSource: DataSource { get set } | |
} | |
protocol PromiseRepository: DataPassing { | |
func syncCache(_ promise: Promise<DataSource>) -> Promise<DataSource> | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import RxSwift | |
import RxCocoa | |
class Repository { | |
private let remoteDataSource: RemoteDataSource | |
private let localDataSource: LocalDataSource | |
private let errorRelay = PublishRelay<Error?>() | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CellNode { | |
struct State { | |
var id: Int | |
var title: String? | |
var isLike: Bool | |
} | |
public var state: State? | |
weak var action: Action? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct User { | |
var id: String | |
var username: String | |
} | |
extension User: ServiceLogics { | |
static func loadUser(id: String) -> Promise<User> { ... } | |
static func loadUserFromDB(id: String) -> Promise<User> { ... } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class GlobalHook { | |
static let shared = GlobalHook() | |
var updateModel = PublishRelay<Model>() | |
} | |
protcol ViewModelProcotol { | |
func hook() | |
} |