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 | |
public extension UIColor { | |
/// Initializes and returns a color object using the specified hex value | |
/// | |
/// - Parameter hex: hex value, example: `#ffffff` or `ffffff` | |
public convenience init(hex: String) { | |
let hexString = hex.trimmingCharacters(in: .whitespacesAndNewlines) | |
let scanner = Scanner(string: hexString) |
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
// | |
// WebViewWithProgressIndicatorController | |
// | |
// Created by Vasily Ulianov on 29.11.16. | |
// Copyright © 2016 Vasily Ulianov. All rights reserved. | |
// | |
import Cocoa | |
import WebKit |
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 | |
@IBDesignable | |
class RoundedLabel: UILabel { | |
var edgeInsets: UIEdgeInsets { | |
if autoPadding { | |
if cornerRadius == 0 { | |
return UIEdgeInsets.zero | |
} else { |
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
// Example: view.round([.TopLeft, .TopRight], radius: 15) | |
extension UIView { | |
/** | |
Rounds the given set of corners to the specified radius | |
- parameter corners: Corners to round | |
- parameter radius: Radius to round to | |
*/ | |
func round(corners: UIRectCorner, radius: CGFloat) { |
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 | |
import CoreData | |
public protocol FetchedResultsDelegate { | |
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath, object: AnyObject) -> UITableViewCell | |
} | |
public class FetchedResultsDataSource: NSObject, UITableViewDataSource, NSFetchedResultsControllerDelegate { | |
public weak var tableView: UITableView? |
NewerOlder