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
// swift-tools-version:4.0 | |
import PackageDescription | |
#if os(Linux) | |
import Glibc | |
#else | |
import Darwin.C | |
#endif | |
enum Enviroment: String { |
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
// Created by Vasily Ulianov on 09.02.17, updated in 2019. | |
// License: MIT | |
import Foundation | |
/// Subclass of `Operation` that adds support of asynchronous operations. | |
/// 1. Call `super.main()` when override `main` method. | |
/// 2. When operation is finished or cancelled set `state = .finished` or `finish()` | |
open class AsynchronousOperation: Operation { | |
public override var isAsynchronous: Bool { |
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? |
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
import UIKit | |
/// Observer that will fire events when keyboard frame will be changed (shown, hidden or resized) | |
/// - Note: Call `addKeyboardFrameChangesObserver()` on init, e.g. on `viewWillAppear` | |
/// and `removeKeyboardFrameChangesObserver()` on deinit, e.g. on `viewDidDisappear` | |
public protocol KeyboardChangeFrameObserver: class { | |
func willChangeKeyboardFrame(height: CGFloat, animationDuration: TimeInterval, animationOptions: UIView.AnimationOptions) | |
} | |
public extension KeyboardChangeFrameObserver { |
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
protocol FRCCollectionViewDelegate: class { | |
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell | |
} | |
class FRCCollectionViewDataSource<FetchRequestResult: NSFetchRequestResult>: NSObject, UICollectionViewDataSource, NSFetchedResultsControllerDelegate { | |
let frc: NSFetchedResultsController<FetchRequestResult> | |
weak var collectionView: UICollectionView? | |
weak var delegate: FRCCollectionViewDelegate? | |
NewerOlder