mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Delete some unused code.
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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())
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user