Foundations(iOS Sourceset): Provide implementation for Rfc3986 on iOS, using the Swift Rfc3986UriBridge.

This commit is contained in:
KotlinGeekDev
2026-01-12 14:55:24 +01:00
parent b94f8c9083
commit d90f3f4f98
2 changed files with 48 additions and 4 deletions
@@ -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!
}
}