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
// | |
// LeftAlignedFlowLayout.swift | |
// | |
// Created by Wanbok Choi on 19/05/2017 | |
// | |
import UIKit | |
final class LeftAlignedFlowLayout: UICollectionViewFlowLayout { | |
override func layoutAttributesForElements(in rect: CGRect) -> [UICollectionViewLayoutAttributes]? { |
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
// | |
// EnumCollection.swift | |
// Created by Wanbok Choi on 2017. 4. 12.. | |
// | |
protocol EnumCollection: Hashable { | |
static var iterator: AnyIterator<Self> { get } | |
static var allValues: [Self] { get } | |
} |
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
// | |
// CancelableTapGestureRecognizer.swift | |
// | |
// Created by Wanbok Choi on 2017. 5. 4.. | |
// | |
import UIKit.UIGestureRecognizerSubclass | |
import RxSwift | |
import RxCocoa |
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
// | |
// Created by Wanbok Choi on 2017. 5. 4.. | |
// | |
import ObjectMapper | |
import SwiftDate | |
enum DateFormat: String { | |
case time = "hh:mm a" | |
case normal = "yyyy-MM-dd" |
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
convert ./* -crop 4x1@ -set filename:fname '%t_%[fx:(page.x/page.width)*4+1]' './%[filename:fname].png' |
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 | |
extension UIViewController { | |
/// Returns the current application's top most view controller. | |
public class func topMostViewController() -> UIViewController? { | |
let rootViewController = UIApplication.sharedApplication().windows.first?.rootViewController | |
return self.topMostViewControllerOfViewController(rootViewController) | |
} | |
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 CollectionType where Self.Generator.Element : NSAttributedString { | |
func join(separator: String? = nil) -> NSAttributedString { | |
let mutableAttributedString = NSMutableAttributedString() | |
self.forEach { | |
if let separator = separator where self.first != $0 { | |
mutableAttributedString.appendAttributedString(NSAttributedString(string: separator)) | |
} | |
mutableAttributedString.appendAttributedString($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
extension ViewController: UISearchControllerDelegate { | |
func willPresentSearchController(searchController: UISearchController) { | |
tabBarController?.tabBar.hidden = true | |
searchBarBackground(true) | |
dimmingBackground(true) | |
} | |
func willDismissSearchController(searchController: UISearchController) { | |
tabBarController?.tabBar.hidden = false | |
searchBarBackground(false) |
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
// | |
// CopyableLabel.swift | |
// | |
// Created by Wanbok Choi on 2016. 3. 17.. | |
// | |
import UIKit | |
final class CopyableLabel: UILabel { | |
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
// | |
// MockingServer.swift | |
// Frip | |
// | |
// Created by 최완복 on 2016. 1. 6.. | |
// Copyright © 2016년 Wanbok. All rights reserved. | |
// | |
import UIKit | |
import AMYServer |
NewerOlder