Book Image

Swift Cookbook

By : Cecil Costa, Cecil Costa
Book Image

Swift Cookbook

By: Cecil Costa, Cecil Costa

Overview of this book

Table of Contents (18 chapters)
Swift Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Links on our website


In this chapter, we created an application that can help us position our website by checking its word frequency, but as you might know, SEO is not only about counting words, it's also about website links.

In this recipe, we will check the links on a website; in this case, as we are using the networks, we can do tasks in parallel.

Getting ready

Create a project called Chapter 5 weblinks and add a file called LinkChecker.swift. Please check whether you have an Internet connection on your simulator or device.

How to do it…

Once you have checked that your device or simulator has an Internet connection, follow these steps to create the Link Checker app:

  1. Before we start creating the LinkChecker class, we will need to create an auxiliary class that will store the common information between objects of the type LinkChecker. This class will be called UrlManager and this needs to store the queue, a file handler to log the found URLs, an array with the URLs, and a constant to indicate...