init: init proj

This commit is contained in:
2026-02-26 22:15:35 +08:00
commit 7ef5348f65
43 changed files with 3085 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
import Foundation
import SwiftUI
// MARK: - URL Extensions
extension URL {
var isHLS: Bool {
pathExtension.lowercased() == "m3u8" || absoluteString.contains(".m3u8")
}
}
// MARK: - String Extensions
extension String {
var trimmed: String {
trimmingCharacters(in: .whitespacesAndNewlines)
}
func extractNumbers() -> [Int] {
components(separatedBy: CharacterSet.decimalDigits.inverted)
.compactMap { Int($0) }
}
}
// MARK: - View Extensions
extension View {
@ViewBuilder
func `if`<Content: View>(_ condition: Bool, transform: (Self) -> Content) -> some View {
if condition {
transform(self)
} else {
self
}
}
}