This file contains 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
/// Adds a helper function to mutate a properties and help implement _Builder_ pattern | |
protocol Buildable { } | |
extension Buildable { | |
/// Mutates a property of the instance | |
/// | |
/// - Parameter keyPath: `WritableKeyPath` to the instance property to be modified | |
/// - Parameter value: value to overwrite the instance property |
This file contains 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
private var prepareForReuseBag: Int8 = 0 | |
@objc public protocol Reusable : class { | |
func prepareForReuse() | |
} | |
extension UITableViewCell: Reusable {} | |
extension UITableViewHeaderFooterView: Reusable {} | |
extension UICollectionReusableView: Reusable {} |
This file contains 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 | |
extension UIView { | |
open override func awakeAfter(using aDecoder: NSCoder) -> Any? { | |
let viewType = type(of: self) | |
let nibName = String(describing: Mirror(reflecting: self).subjectType) | |
let bundle = Bundle.main //Bundle(for: viewType) | |
//Prevents infinite loop from loadNibNamed internally-calling awakeAfterUsingCoder. Is false when called from storyboard, true when |
This file contains 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
#!/bin/sh | |
echo "Get version ..." | |
MAJOR_VERSION="0.1" | |
if [ -z "${PROJECT_DIR}" ]; then | |
PROJECT_DIR=`pwd` | |
fi |