How I built an iOS app for my WordPress site

After a major update on, I decided to re-build a new iOS app that actually works with the new site. Thanks to Anton who got me into Swift!

There are many ways to build an app but in my situation and resources I have, it made sense to me to build an web app base on the website I already have. Since I designed the website(Responsive web design) works well on smaller screens (Smart phones & tablets), I did not have to do anything on the website to make it work on iOS app.

This article is mostly for myself since I don’t work on Swift in Xcode on daily bases but also wanted to share what I have learned with you 😉

This is how I build an iOS app utilizing an web view with Swift in Xcode v 7.3.

Things you need to get started

  • Xcode + Apple developer account to publish the app on App store.
  • You don’t need to know Swift but little bit of knowledge on Xcode UI will help.

1. Set up a project

2. Set up UI on Main.storyboard

Add an Web View by drag and drop as you did for Tab Bar then add proper constraints. I also added 3 more Tab Bar Items on the Tab Bar in a same way. If you want to add custom icons on the Tab Bar Item, please see this page.

You will end up with something like this.

Setting up UI

Make sure you have the connections(Outlets & Referencing Outlets) look like an image above. For Referencing Outlets, you can drag it to Tab bar and select delegate.

3. Add functions to buttons(Tab Bar Items)

  • 1st button > Load homepage
  • 2nd button > Load subpage
  • 3rd button > Web View goBack
  • 4th button > Web View goForward
  • 5th button > Web View Reload

In order to make this work, first we need to set Tag for each button. Add Tag 0 to 4 for each button(Tab Bar Items). Assign 0 for the first button, 1 for the second button, 2 for the third button, 3 for the forth button and 4 for the fifth and last button. Please see the image below.

Add tag on each button

Now we can use those Tags in our Swift code to make it work.
Here is a code you need to have on ViewController.swift file to make it work.

Actual Swift code to make the Web View app works is pretty simple and self explanatory. We are loading the homepage on app launch then update the Web View as you click the buttons on Tab Bar with switch statement.

4. Add art assets

5. Publish to App Store


This is what I got for As always, I would love to get your feedback and comment. Also, feel free to correct me if I’m wrong at something :)

GoodnightJournal iOS App

Originally published at

Writing journals at Goodnight Journal

Writing journals at Goodnight Journal