Table of Contents
The project lists 10 different countries for users. By accessing the details of the desired country, the user encounters the flag of that country, the country code and the button for more details. In addition, the user can favorite/unfavorite the countries they wanted to and can list and remove them within the saved page in the tabbar.
- Swift
- XCode 13.2.1
- MVVM
- Swift Package Manager
- RapidAPI GeoDb Cities API
- SDWebImage
- SDWebImageSVGCoder
- CoreData
After install required pod files, you can directly launch the app in XCode. After opening the location where the folder is located, it will be enough by following the steps below
- Get a free API Key at RapidAPI
- Clone the repo
git clone https://github.com/aardaisenkul/Countries.git
- Install pod packages
If you have macbook with M1 Chip you can install pod files wia
pod install
sudo arch -x86_64 gem install ffi arch -x86_64 pod install
- Enter your API in
RapidAPI
let API_KEY = 'ENTER YOUR API';
- Xcode 13
- Swift 5
- IOS 15.x
Demo |
---|
- With the help of a custom cell, the cell with the star icon and the name of the required country was designed.
- This cell has been added to the home page, which is the first option in the tab bar.
- With a similar design of the home page, it was possible to sort the cells which is saved.
- Thanks to 2 different methods added to the custom cell, adding to favorites and going to country details actions are provided.
- With a design similar to the saved page, it was possible to sort the cells recorded in the plain.
- Started to design and code detail page
- Thanks to SDWebImageSVGCoder, the necessary image was fetched and placed on the detail page, which was a challenging detail as I had not used pod packages before.
- Other datas are fetched such as wikicode and country name from the relevant API. More info button has been added and it redirects with the help of wikicode to the wikipedia.
- The country name is fixed in the header.
- Finally, the star button on the right of the header was designed and coded to add that country to favorites.
- CoreData is used for handling to add/remove countries to the saved list
- Data layer(repository): includes model needs for api logic tabbar pages
- ViewModel layer: includes some methods and logic that can be useful
- View layer: includes of view controllers and storyboards
- Kazakhistan country flag size can be optimized because its size or type are not like others
- Instant refresh could be better on saved page when user interacts with favorite process.
- Some performance improvements can be made to make app durable
Distributed under the MIT License. See LICENSE.txt
for more information.
Ali Arda İsenkul - @LinkedIn - ardaisenkul@hotmail.com
Project Link: https://github.com/aardaisenkul/Countries