Skip to content
This is a simple iOS project where a user wants to see which country he/she is currently in from the app and in the today widget.
Swift
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
TodayExtension
Wiki Countries.xcodeproj
Wiki Countries
Wiki CountriesTests
.DS_Store
IMG_1172.png
IMG_1173.png
IMG_1174.png
IMG_1175.png
IMG_1176.png
README.md

README.md

Country search

This is a simple iOS project where a user wants to see which country he/she is currently in from the app and in the today widget. Additionally he/she should be able to search for a country using free text, capital city or language code sorted closest/furthest to the user's current location.

Technical Details

API specification for search: ​https://restcountries.eu/#api-endpoints For flag image Flagpedia can be used in this format: http://flagpedia.net/data/flags/normal/{{country​ code}}.png e.g. for Germany: ​http://flagpedia.net/data/flags/normal/de.png

Acceptance Criteria

  • As the user opens the app a list of countries should be shown from closest to furthest depending on my current location;
  • The user should be able to search for a country by: name | capital city | language;
  • The user should get the result in a list, which shows me the name of the country, picture of the flag (if present), population and area size;
  • The user should have access to the current country information from anywhere in the app;
  • The user should be able to see the current country information in the today widget;
  • Current country information I need to see: Name & Flag & Population & Capital & Region & Regional blocks & Language & Currency.

Documentation

The application is developed using MVC (model-view-controller) architecture. The app has basically one main Controller: MainTableViewController.swift. The country search results is the SearchResultsTableViewController.swift and both are subclass of BaseTableViewController.swift. When the user opens the app, a list of countries is shown from closest to furthest, depending on the current location of that user. If the user has not enabled location services, the list is sorted by country name (a>z). Using the UISearchController, the user can search for a country by typing/pasting the country name or capital or the language code. The result is then shown a list, showing the name of the country, the picture of the flag when present, population and area size. When the location services is enabled, the user has the current country information from anywhere in the app. The same information is shown in the today widget: Name, Flag, Population, Capital, Region, Regional blocks, Language, Currency

I have developed the apps using Storyboard.

Development

Tools in place

  • MVC (Model-View-Controller) architecture
  • Storyboard implementation
  • Delegate (one-to-one relationship)
  • Notifications (one-to-many relationship)
  • HTTPS GET requests to the server
  • API handler
  • Custom classes and objects
  • Layout constraint
  • Completion blocks

Points to pay attention to

  • Increment Bundle Version (Build Phases -> Run script)
  • Localizable string to multiple languages
  • Extension helpers

Screenshots

Home screen 3D touch Today widget Wiki Countries Home Wiki Countries Search

You can’t perform that action at this time.