Created
January 17, 2020 13:20
-
-
Save stleamist/0a804b531832a0f078ac20c9e081c39a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
extension URLComponents { | |
var fragmentItems: [URLQueryItem]? { | |
get { | |
var components = URLComponents() | |
components.query = fragment | |
return components.queryItems | |
} | |
set { | |
var components = URLComponents() | |
components.queryItems = newValue | |
self.fragment = components.query | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment