Application Omni LITE is based on API available at http://omni-content.omni.news.
Application is simple article & topic presenter. Based on http://omni-content.omni.news.
Tested on:
- iPhone Xr (Simulator)
- iPhone Xs Max (Simulator)
- iPhone 8 Plus (Physical Device)
- Main features:
- Option to find article by query.
- Display list of articles that was fetched from server.
- Display details of article from articles list.
- It only use Storyboard for launchScreen.
- Views are generated in code.
- Implements dependency injection stored in initDependencies() function in AppDelegate.swift
-
Views:
Articles List
List contains navigation bar with button that gives possibility to search for articles for user typed query. It also has table to display all articles. As default it shows articles for query = ""
Article Search
Article search its popup view that gives possibility to pass query and fetch articles connected with that query.
Article Details
Article details display details of article. It can be reached from Articles list by selecting cell with specific article.
-
Project structure:
Description:
Folder contains every swift extension.
Files:
UIBarButtonItemExtension.swift - extension contains everything that can be connected with UIBarButtonItem from UIKit
Description:
Folder contains two folders:
-
Components:
Contains UIKit custom components, modified to fit more to project requirements
Files:
OmniNavBar.swift - modified UINavigationBar class with custom constructors which at default create UINavigationItem and add it to OmniNavBar
OmniNavButton.swift - modified UIBarButtonItem class with custom constructors which creates custom views of UIBarButtonItem.OmniNavButton need to be added to OmniNavBar.
OmniTableView.swift - modified UITableView class with implemented UITableViewDelegate and UITableViewDataSource classes.
OmniSearchAlert.swift - modified UIAlertController with custom buttons and UITextField to pass searched query.
-
Cells:
Contains custom UITableViewCell classes with custom UIKit classes added.
Files:
ArticleCell.swift - custom cell for article displaying contains: UIView, UILabel, UIImageView.
Description
Folder contains every swift protocol.
Files:
ApiProtocol.swift - protocol that contains what have to be implemented to API class
Description:
Folder contains two folders:
-
Base:
Base folder contains Http classes that are inherited by classes included in Custom folder.
Files:
API.swift - class contains base of http requests. It also implements ApiProtocol protocol
-
Custom:
Custom folder contains Http classes for specific actions more detailed. Every Custom class inherits class from Base folder.
Files:
Omni.swift - class contains HTTP Requests connected with Omni API. It also is responsible to sort data from JSONs to Models or Swift data types.
Description:
Folder contains Models that are containers of data for example data fetched from server.
Files:
Article.swift - struct that sorts and store data fetched from search/ function from http://omni-content.omni.news API.
Description:
Folder contains every data that doesn't fits requirements of any other folder.
Files:
Info.plist - Information Property List that are required for iOS Projects. Here are stored information about project.
Omni_Lite.xcdatamodeld - It is file that is used by CoreData framework.
Statics.swift - It is a swift struct that contains static values like strings or integers that can be reused in many situations.
uiPreferences.swift - It is a class that contains UI options like screen size.
Description:
Folder contains storyboard files but like it was mention in main features application only uses LaunchScreen.storyboard
Files:
LaunchScreen.storyboard - Launch Screen of application
Main.storyboard - Main storyboard of application. This application doesn't use it at all because all view are generated in swift files.
Description:
Folder contains two folders:
-
Base:
Base folder contains Controller classes that are inherited by classes included in Custom folder. Base Controllers are inherit from UIViewController
Files:
ViewController.swift - This is a base Controller that has collection of methods that can be used in every Custom ViewController. It also has custom constructor that are responsible for dependency injection.
-
Custom:
Custom folder contains Controller classes for specific actions more detailed. Every Custom class inherits class from Base folder.
Files:
ArticlesListController.swift - It is main Controller of Application it inherits from ViewController from Base folder. It is responsible for displaying OmniTableView and presents all data fetched from server.
ArticleDetailsController.swift - It can be presented from ArticlesListController and it also inherits from ViewController.
Description:
Folder contains Delegates.
Files:
AppDelegate.swift - It is a main UIApplicationDelegate that is generated with new xCode Project. In this project it contains custom function initDependencies() that is responsible for initialize dependencies to ViewControllers. initDependencies() is called in application.didFinishLaunchingWithOptions
-
CocoaPods for Omni Lite
- AlamoFire - Used HTTP Requests
- Material Design - UI Components (Need to be added)
- SwiftyJSON - Used for JSON Collections
- Kingfisher - Used for download images from URL
- SnapKit - Used for easier AutoLayout
To run application just download repository and open Omni Lite.xcworkspace in xCode (Omni Lite.xcworkspace open application with CocoaPods included). Don't forget to change signing certificate to run application in your environment. When xCode doesn't show any error press Run button to install application on your simulator/device
- Fix landscape mode
- Add Topics UITableView - Right now can't fetch any topics (Array was always empty) so it was skipped for now.
- Implement tests
- Fix UI - make it more modern
- Add Animations
- Fix UI to different types of device.