Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
156 lines (78 sloc) 9.95 KB

Platform iOS Swift 3 codecov App Installs

Sortons Events

An events and news aggregator released for Irish universities.

Sortons, from the French verb sortir (/soɾˈtiɾ/) to go out. Nous sortons – we are going out!

Originally written as a Java web-app to be used as a Facebook Page tab, the backend runs on Google App Engine. Later an Objective-C client was written which has since been rewritten in Swift from scratch using a TDD approach as described by Clean Swift.

Check it out on the App Store for:

---| |-----| |------| |----

| Dublin City University | Trinity College Dublin | University College Dublin |

Build

Clone, run pod install, open SortonsEvents.xcworkspace and remember to set the Signing Team under one of the targets. There are no API keys to set.

Views

There are four views: Events, News, Directory, About. Events shows a list of upcoming events that were created or posted by Facebook pages related to the university. The News view is a merged newsfeed of all posts made by the related pages. Directory is that list of pages. About is meta, contact and sharing.

Events

Events is pretty straightforward. It pulls JSON from GAE using Alamofire, parses it with ObjectMapper and displays it in a UITableViewController, caching as a text file for a neater UX the next time the app is opened. AlamofireImage is used to async fetch and cache the event images. When an event is clicked it checks is the Facebook app installed and opens the event details either there or in Safari.

News

The news view wasn't part of the original plan, but in order to find all the events a Facebook Page has posted, I needed to read its wall. I save the post ids and use a WKWebView to display a merged newsfeed of all the relevant pages with the Facebook Embedded Posts widget, loading more as the users scrolls.

All link clicks are intercepted and opened in the Facebook app or Safari. The URLs are parsed to remove Facebook redirects which were showing a security warning and to convert http Facebook URLs into the Facebook app's URL scheme.

Directory

The Directory is again a UITableView with a pretty straightforward search. I had an update to the app rejected by Apple for creating "a misleading association with DCU" – the screenshot had a list with the word "DCU" in it too many times. The president of DCU has installed and tried the app, so I think they're ok with it. I now take the screenshots using Fastlane Snapshot and the app detects when it is being run in a simulator and filters out terms such as "DCU".

About

The About tab was added so people can communicate with me. The app stopped working for a few weeks when Facebook deprecated an API I was using. Nobody told me! The view is a static UITableView showing basic About, Changelog, and Privacy Policy information in a UIWebView, and now people can email me feedback (MFMailComposeViewController), share the app (UIActivityViewController) and rate the app (UIApplication.shared.openURL!).

Story Time

In March 2016 I was living in Dublin on the route of the St. Patrick's Day Parade. Naturally, we were watching it and once it was over we invited some Americans into the apartment for drinks and fun. Some of them were studying in University College Dublin so I started talking about this app. One of the girls already had it installed on her phone!

One of the main things I've learned through this and other events apps I've made is that people don't care about them. I think most people's lives are too busy for them to need to go looking for things to do.

Resources

Some tools I used as I built this.

A great website which applies Uncle Bob's Clean architecture to iOS with Swift. There's a lot of content on the site that isn't apparent from the homepage, so dig in.

This handy tool takes a single image and outputs all the required app icon sizes as an .xcassets folder you can drag and drop into Xcode.

This is a handy site for the UITabBarController icons. They have a free licence that requires attribution. Apple rejected the app once for having a link in my App Store description to a site that offers purchases. I've since paid for the icons.

SwiftLint runs on every build to highlight poor code formatting. I'm far from adhering to all its suggestions but it's certainly improved my code a little.

mergepbx addresses git merge problems on Xcode .pbxproj files.

Handy page for figuring out the correct regular expressions needed. I used it here when parsing the URLs from the News view but it's a tool I find myself using regularly.

This is a tool I wrote myself especially for this README. The badges at the top of the page are neat but there was no app installs count badge. I used mikebarlow/itc-reporter to put it together in a few hours.

I set up continuous integration as a prerequisite for the next tool!

The other important metric I wanted for the top of this README was code coverage. Codecov gets called at the end of the Travis build and provides the badge image. My percentage coverage dropped significantly after I stopped loading AppDelegate when running tests.

The other badges at the top are made by Shields IO with a simple configurable URL.

The animated gif in this README was made by recording my iPhone's screen with QuickTime – select New Movie Recording, select your iPhone in the drop-down beside the record button, and when finished recording use the Edit menu, Trim to cut it down – then simply dragging and dropping the mov into Drop to GIF.

Fabric is a five minute install (pod, build script and two lines) which provides usage data and crash reports.

Part of Fabric, I've set up FastLane to automatically take app screenshots in order to ease submitting the different versions of the app for different colleges.

I had implemented my own gesture recognisers to swipe between tabs but it wasn't as smooth an experience as is typical of other apps. This library made it easy to implement an improved UX. I've needed to make a few changes to this class as its properties were often marked as fileprivate which impeded subclassing.

A very easy to use library for placing a message in UITableView when there is no content, i.e. an icon, loading message and refresh button.

Roadmap

UX Improvements

  • Loading/error messages
  • The Events view should show which clubs/societies the event is related to. Particularly, there's plenty of space for this on iPad.
  • The News view's performance needs attention.

Push Notifications / Widget

I think a weekly push notification of what's coming up would be nice, and a "Today" app extension (lock screen widget) would be an appropriate UI.

Facebook Ads

I'm a little disappointed with the number of users. When the above few points are complete, I'll take out some ads on Facebook to get the word out.

Server Updates

I'm not yet dealing with dead events or pages, so I should write a cron for that.

Finding new pages to add to each directory is currently manual. A list of suggestions is built from the Facebook likes of the currently included pages. I'd like to build a recommender and have it automatically added pages above a confidence threshold.

The server code is all at BrianHenryIE/Sortons-Events.

Android

I once wrote an Android client but I don't use Android so never 100% finished and published it. Its code is at BrianHenryIE/Sortons-Events-Android-Client.

Contact

All my social profiles can be found at BrianHenry.ie or you can email me: brian.henry@sortons.ie.

Licence

I'm happy to share my code for others to see and learn from, but I think it's fair that others don't earn money off this without me also getting something. Get in touch!

You can’t perform that action at this time.