Skip to content

A Swift package that uses the Public Suffix List to parse domain names.

License

Notifications You must be signed in to change notification settings

jameshurst/PublicSuffix-Swift

Repository files navigation

PublicSuffix

A Swift package that uses the Public Suffix List to parse domain names.

Usage

let components = SuffixList.default.parse("www.example.com")
print(components?.tld) // com
print(components?.sld) // example
print(components?.domain) // example.com
print(components?.subdomain) // www

SuffixList

A SuffixList is used to parse domain names.

A bundled version of the public suffix list is included as SuffixList.default. You may also use your own custom suffix list.

Installation

Xcode 11+

  • Select File > Swift Packages > Add Package Dependency...
  • Enter the package repository URL: https://github.com/jameshurst/PublicSuffix-Swift.git
  • Confirm the version and let Xcode resolve the package

License

This library is released under the MIT license. See LICENSE for details.

About

A Swift package that uses the Public Suffix List to parse domain names.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published