| Path | Protocol |
|---|---|
| /swift/stdlib/public/core/AnyHashable.swift:16 | _HasCustomAnyHashableRepresentation |
| /swift/stdlib/public/core/BidirectionalCollection.swift:21 | _BidirectionalIndexable |
| /swift/stdlib/public/core/BridgeObjectiveC.swift:19 | _ObjectiveCBridgeable |
| /swift/stdlib/public/core/Collection.swift:20 | _IndexableBase |
| /swift/stdlib/public/core/Collection.swift:176 | _Indexable |
| /swift/stdlib/public/core/CompilerProtocols.swift:193 | _ExpressibleByBuiltinIntegerLiteral |
| /swift/stdlib/public/core/CompilerProtocols.swift:240 | _ExpressibleByBuiltinFloatLiteral |
| /swift/stdlib/public/core/CompilerProtocols.swift:283 | _ExpressibleByBuiltinBooleanLiteral |
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
| /// An opaque type that represents a method in a class definition. | |
| public struct Method { | |
| public struct Description { | |
| /**< The name (selector) of the method */ | |
| public var selector: Selector | |
| /**< The types of the method arguments */ | |
| public var types: UnsafeMutablePointer<Int8> | |
A trully custom container view controller written in Swift 3.0.1. The view of this object is fully resizable and works great with layout constraints.
- Mimic
UINavigationControllerwithout any bar APIs - More flexible delegate methods
- Simple non-interactive transition
- Interactive transition
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 Storage { | |
| // not empty for testing | |
| var keys: [String] = ["0"] | |
| var values: [Int] = [0] | |
| } | |
| public struct Document { | |
| var _storageReference: Storage |
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
| func _convertToBytes<T>(_ value: T, withCapacity capacity: Int) -> [UInt8] { | |
| var mutableValue = value | |
| return withUnsafePointer(to: &mutableValue) { | |
| return $0.withMemoryRebound(to: UInt8.self, capacity: capacity) { | |
| return Array(UnsafeBufferPointer(start: $0, count: capacity)) | |
| } | |
| } |
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
| // Swift 3.0: | |
| // This functuion makes use of the custom operator `?!`: | |
| // https://gist.github.com/DevAndArtist/dad641ee833e60b02fd1db2dbb488c6a | |
| @available(iOS 9.0, *) | |
| func forDevice<T>( | |
| phone: @autoclosure () -> T? = nil, | |
| pad: @autoclosure () -> T? = nil, | |
| tv: @autoclosure () -> T? = nil, | |
| carPlay: @autoclosure () -> T? = nil) -> T { |
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
| // | |
| // UnwrapOrTrap.swift | |
| // | |
| infix operator ?! : NilCoalescingPrecedence | |
| /// Performs a nil-coalescing operation, returning the wrapped value of an | |
| /// `Optional` instance or uses the rhs function to stop the program. | |
| /// | |
| /// - Parameters: |
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
| // we generate the boundary with `A | B` or directly OneOf<A, B> | |
| enum OneOf<...T> { | |
| ...case $#(T) | |
| // Bikeshedding variadic enum casses: | |
| // we might need an index to set the value? | |
| init(index: Int, value: T) { | |
| self = .$index(value) |
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 | |
| protocol NSLayoutConstraintSearchable: class {} | |
| extension NSLayoutConstraintSearchable { | |
| // this function does add support for UIView and UILayoutGuide | |
| private func getConstraints() -> [NSLayoutConstraint]? { | |
| // only UIView's hold constraints |
NewerOlder