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
// | |
// UITextViewPlaceholder.swift | |
// TextViewPlaceholder | |
// | |
// Copyright (c) 2017 Tijme Gommers <tijme@finnwea.com> | |
// | |
// Permission is hereby granted, free of charge, to any person obtaining a copy | |
// of this software and associated documentation files (the "Software"), to deal | |
// in the Software without restriction, including without limitation the rights | |
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
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
#!/usr/bin/env bash | |
rm -rf "${HOME}/Library/Caches/CocoaPods" | |
rm -rf "`pwd`/Pods/" | |
pod update |
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
~/Library/MobileDevice/Provisioning Profiles/ |
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
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
mr Marathi | |
bs Bosnian | |
ee_TG Ewe (Togo) | |
ms Malay | |
kam_KE Kamba (Kenya) | |
mt Maltese | |
ha Hausa | |
es_HN Spanish (Honduras) | |
ml_IN Malayalam (India) | |
ro_MD Romanian (Moldova) |
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 Delegated<Input> { | |
private(set) var callback: ((Input) -> Void)? | |
mutating func delegate<Object : AnyObject>(to object: Object, with callback: @escaping (Object, Input) -> Void) { | |
self.callback = { [weak object] input in | |
guard let object = object else { | |
return | |
} | |
callback(object, input) |
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 ReSwift | |
import ReactiveKit | |
class ObservableStore<State: StateType>: Store<State> { | |
let observable: Observable<State> | |
var reducer: AnyReducer! | |
override var state: State! { | |
didSet { |
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 ReSwift | |
import ReactiveKit | |
class ObservableStore<State: StateType>: Store<State> { | |
let observable: Observable<State> | |
var reducer: AnyReducer! | |
override var state: State! { | |
didSet { |
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 MockUserDefaults: UserDefaults { | |
convenience init() { | |
self.init(suiteName: "MockUserDefaults")! | |
} | |
override init?(suiteName suitename: String?) { | |
UserDefaults().removePersistentDomain(forName: suitename!) | |
super.init(suiteName: suitename) | |
} | |
} |
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 UICollectionView { | |
func register<T: UICollectionViewCell>(_: T.Type) where T: Reusable & NibLoadable { | |
let nib = UINib(nibName: T.nibName, bundle: nil) | |
register(nib, forCellWithReuseIdentifier: T.reuseIdentifier) | |
} | |
func registerSupplementaryView<T: UICollectionReusableView>(_: T.Type, for kind: String) where T: Reusable, T: NibLoadable { | |
let nib = UINib(nibName: T.nibName, bundle: nil) | |
register(nib, forSupplementaryViewOfKind: kind, withReuseIdentifier: T.reuseIdentifier) | |
} |
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 Reusable: class {} | |
extension Reusable where Self: UIView { | |
static var reuseIdentifier: String { | |
return String(describing: self) | |
} | |
} | |
protocol NibLoadable: class { } |