Delete some unused code.

This commit is contained in:
Brent Simmons
2025-02-02 11:02:43 -08:00
parent 57cf732f5a
commit 0e7d6ce6bb
4 changed files with 0 additions and 40 deletions

View File

@@ -15,14 +15,4 @@ public extension Array {
Array(self[$0 ..< Swift.min($0 + size, count)])
}
}
}
public extension Array where Element: Equatable {
mutating func removeFirst(object: Element) {
guard let index = firstIndex(of: object) else {return}
remove(at: index)
}
}

View File

@@ -11,12 +11,6 @@ import Foundation
public typealias VoidBlock = () -> Void
public typealias VoidCompletionBlock = VoidBlock
/// Call a VoidCompletionBlock on the main thread.
/// - Parameter block: The block to call.
public func callVoidCompletionBlock(_ block: @escaping VoidCompletionBlock) {
DispatchQueue.main.async(execute: block)
}
public typealias VoidResult = Result<Void, Error>
public typealias VoidResultCompletionBlock = (VoidResult) -> Void

View File

@@ -21,10 +21,4 @@ public extension Calendar {
static func dateIsToday(_ date: Date) -> Bool {
return cached.isDateInToday(date)
}
/// The first moment of today.
static var startOfToday: Date {
cached.startOfDay(for: Date())
}
}

View File

@@ -11,23 +11,6 @@ import SwiftUI
extension UIViewController {
// MARK: Autolayout
public func addChildAndPinView(_ controller: UIViewController) {
view.addChildAndPin(controller.view)
addChild(controller)
}
public func replaceChildAndPinView(_ controller: UIViewController) {
for subview in view.subviews {
subview.removeFromSuperview()
}
for child in children {
child.removeFromParent()
}
addChildAndPinView(controller)
}
// MARK: Error Handling
public func presentError(title: String, message: String, dismiss: (() -> Void)? = nil) {
@@ -39,7 +22,6 @@ extension UIViewController {
alertController.addAction(dismissAction)
self.present(alertController, animated: true, completion: nil)
}
}
// MARK: SwiftUI