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
| final class Example { | |
| func emptyTask() { | |
| TODO | |
| } | |
| func slowTask() { | |
| FIXME | |
| print("This still executes") | |
| } |
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
| // | |
| // NibLoadable.swift | |
| // KoreanAir | |
| // | |
| // Created by Shahpour Benkau on 27/04/2017. | |
| // Copyright © 2017 Korean Air. All rights reserved. | |
| // | |
| import UIKit |
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
| // | |
| // IndexPathSelection.swift | |
| // Credit: https://www.raizlabs.com/dev/2016/05/smarter-animated-row-deselection-ios/ | |
| // | |
| // This version by Shahpour Benkau on 21/05/2017 – based on the version from raizlabs.com | |
| // | |
| import UIKit | |
| // Represents a view that provides indexPath selection (e.g. UITableView, UICollectionView) |
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 CGRect { | |
| public static func reversible(from: CGPoint, to: CGPoint) -> CGRect { | |
| let size = CGSize(width: to.x - from.x, height: to.y - from.y) | |
| return CGRect(origin: from, size: size).standardized | |
| } | |
| } |
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
| weakify(observer, updates)(self) |
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 Foundation | |
| public struct InfiniteIterator<Base: Collection>: IteratorProtocol { | |
| private let collection: Base | |
| private var index: Base.Index | |
| public init(collection: Base) { | |
| self.collection = collection | |
| self.index = collection.startIndex |
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
| public enum Direction { | |
| case forward | |
| case backward | |
| } | |
| internal var player: AVPlayer? | |
| private var isSeekInProgress = false | |
| private var chaseTime = kCMTimeZero | |
| private var preferredFrameRate: Float = 23.98 |
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
| // | |
| // AppDelegate.swift | |
| // Scheduling | |
| // | |
| // Created by Shaps Benkau on 19/02/2018. | |
| // Copyright © 2018 152percent Ltd. All rights reserved. | |
| // | |
| import UIKit |
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
| #if os(iOS) | |
| import UIKit | |
| #else | |
| import Cocoa | |
| public typealias UIView = NSView | |
| public typealias UILayoutPriority = NSLayoutConstraint.Priority | |
| #endif | |
| public typealias Constraint = (_ view: UIView, _ otherView: UIView?) -> NSLayoutConstraint |
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
| public extension Optional where Wrapped: Collection { | |
| /// Equivalent to `if let value = value, !value.isEmpty` | |
| /// | |
| /// Useful when you need to know whether or not an underlying value exists at all. | |
| /// | |
| /// string.isNilOrEmpty | |
| /// | |
| /// Returns true if `string` is nil or empty. False otherwise | |
| var isNilOrEmpty: Bool { |