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
// | |
// CollectionIndexView.swift | |
// Created by Ben Kreeger on 9/26/16. | |
// | |
import UIKit | |
@objc(BDKCollectionIndexView) | |
class CollectionIndexView: UIControl { | |
enum Direction { |
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
// Many thanks to Code Different: http://stackoverflow.com/a/42749141/3440266 | |
import Foundation | |
struct ClassInfo : CustomStringConvertible, Equatable { | |
let classObject: AnyClass | |
let classNameFull: String | |
let className: String | |
init?(_ classObject: AnyClass?) { | |
guard classObject != nil else { return nil } |
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 Fluent | |
func fetchChildren<Parent, ParentID, Child: Model, Result>( | |
of parents: [Parent], | |
idKey: KeyPath<Parent, ParentID?>, | |
via reference: KeyPath<Child, ParentID>, | |
on conn: DatabaseConnectable, | |
combining: @escaping (Parent, [Child]) -> Result) -> Future<[Result]> where ParentID: Hashable & Encodable { | |
let parentIDs = parents.compactMap { $0[keyPath: idKey] } | |
let children = Child.query(on: conn) |
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
extension Publisher { | |
func waitForCompletion(timeout: TimeInterval = 1.0, file: StaticString = #file, line: UInt = #line) throws -> [Output] { | |
let expectation = XCTestExpectation(description: "wait for completion") | |
var completion: Subscribers.Completion<Failure>? | |
var output = [Output]() | |
let subscription = self.collect() | |
.sink(receiveCompletion: { receiveCompletion in | |
completion = receiveCompletion | |
expectation.fulfill() |
I had some trouble attempting to build an XCFramework of OpenCV, but I finally got a successful build with the following steps:
- Clone the OpenCV repo:
git clone git@github.com:opencv/opencv.git cd opencv
- Disable building with
libjpeg-turbo
[^1] by applying a patch:git apply path/to/opencv-5-28-50.patch