Swiftpack.co -  will-lumley/FaviconFinder as Swift Package
Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
A small swift library for iOS & macOS to detect favicons used by a website.
.package(url: "https://github.com/will-lumley/FaviconFinder.git", from: "2.3.0")

FaviconFinder: Simple Favicon Finding


CI Status Version Carthage Compatible SPM Compatible Swift 5.0 Platform License Twitter

FaviconFinder is a small, pure Swift library designed for iOS and macOS applications that allows you to detect favicons used by a website.

Why not just download the file that exists at https://site.com/fav.ico? There are multiple places that a developer can place there favicon, not just at the root directory with the specific filename of fav.ico. FaviconFinder handles the dirty work for you and iterates through the numerous locations that the favicon could be located at, and simply delivers the image to you in a closure, once the image is found.

Favicon will:

  • ☑ Detect the favicon in the root directory
  • ☑ Will automatically check if the favicon is located within the root URL if the subdomain failed (Will check https://site.com/fav.ico if https://subdomain.site.com/fav.ico fails)
  • ☑ Detect and parse the HTML at the URL for the declaration of the favicon

To do:

  • ☐ Detect and parse web application manifest JSON files
  • ☐ Detect and parse web application Microsoft browser configuration XML


FaviconFinder uses simple syntax to allow you to easily download the favicon you need, and get on with your project. Just insert this code into your project:

FaviconFinder(url: url).downloadFavicon { result in
    switch result {
    case .success(let favicon):
        print("URL of Favicon: \(favicon.url)")
        self.imageView.image = favicon.image

    case .failure(let error):
        print("Error: \(error)")

Example Project

To run the example project, clone the repo, and run pod install from the Example directory first.


FaviconFinder supports iOS 10.0 and above & macOS 10.10 and above.



FaviconFinder is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'FaviconFinder', '~> 2.3.0'


FaviconFinder is also available through Carthage. To install it, simply add the following line to your Cartfile:

github "will-lumley/FaviconFinder" == 2.3.0

Swift Package Manager

FaviconFinder is also available through Swift Package Manager. To install it, simply add the dependency to your Package.Swift file:

dependencies: [
    .package(url: "https://github.com/will-lumley/FaviconFinder.git", from: "2.3.0"),
targets: [
    .target( name: "YourTarget", dependencies: ["FaviconFinder"]),


William Lumley, will@lumley.io


FaviconFinder is available under the MIT license. See the LICENSE file for more info.


Stars: 5
Last commit: 1 week ago

Ad: Job Offers

iOS Software Engineer @ Perry Street Software
Perry Street Software is Jack’d and SCRUFF. We are two of the world’s largest gay, bi, trans and queer social dating apps on iOS and Android. Our brands reach more than 20 million members worldwide so members can connect, meet and express themselves on a platform that prioritizes privacy and security. We invest heavily into SwiftUI and using Swift Packages to modularize the codebase.


Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API