Foundations(iOS Sourceset): Provide implementation for Rfc3986 on iOS, using the Swift Rfc3986UriBridge.
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
//
|
||||
// Created by NullDev on 31/12/2025.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import RFC_3986
|
||||
|
||||
@objcMembers public class Rfc3986UriBridge: NSObject {
|
||||
public func normalizeUrl(url: String) throws -> String {
|
||||
let uri = try RFC_3986.URI(url)
|
||||
let normalized = uri.normalized()
|
||||
return normalized.value
|
||||
}
|
||||
|
||||
public func isUrlValid(url: String) -> Bool {
|
||||
return RFC_3986.isValidURI(url)
|
||||
}
|
||||
|
||||
public func hostFromUri(url: String) throws -> String {
|
||||
let actualUri = try RFC_3986.URI(url)
|
||||
return actualUri.host!
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user