• This repository has been archived on 29/Oct/2021
  • Stars
    star
    204
  • Rank 192,063 (Top 4 %)
  • Language
    Swift
  • License
    MIT License
  • Created about 7 years ago
  • Updated almost 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Intelygenz iOS Architecture

Intelygenz iOS Architecture

Twitter Build Status License codebeat badge

This repository contains an iOS architecture documentation with a sample application that uses OMDb API and implements the Archit architecture.

🔨 Xcode Configuration

  • You should enable Xcode Text Editing options:

    1. Line numbers. (Specify a line to a mate or search for a crash)
    2. Code folding ribbon. (Optional)
    3. Page guide at column: 140 (No line should exceed it, so we will all read the same code)
    4. Including whitespace-only lines. (Lighter files)

    Xcode Text Editing

🔧 Project Configuration

  • Create your application core framework:

    Open Xcode and select File -> New -> Target...

    New Target

    Select Cocoa Touch Framework:

    Cocoa Touch Framework

    Configure your application core:

    New Core

    This core framework will include API clients, persistence... everything you need to reuse in the future, for example, in an application extension.

    Remember provide protocols for every service or storage that you create, everything must work syncronous.

    Don't import to the core framework anything related with UIKit or any other forbidden framework or dependency (pod) in an application extension. If you need it in the future, you can make an extension in the application target.

  • Create your application domain framework:

    This domain framework will include domain models.

    Don't import to the domain framework anything related with UIKit or any other forbidden framework or dependency (pod) in an application extension. If you need it in the future, you can make an extension in the application target.

  • Configure the schemes:

    Edit all schemes:

    Edit Scheme

    For each scheme, enable "Gather Coverage Data" option and "Share" the scheme:

    Gather Coverage Data

    In the Breakpoint navigator, create an "Exception Breakpoint...":

    Exception Breakpoint

    And "Share Breakpoint":

    Share Breakpoint

    Also create a "Symbolic Breakpoint..." with "UIViewAlertForUnsatisfiableConstraints" as "Symbol" and "Share Breakpoint":

    Unsatisfiable Constraints Breakpoint

🤓 Usage

AppManager

We delegate all responsibilities of the AppDelegate to an AppManager under our control, testable and that will be in charge of initializing all third-party frameworks that need initialization in the didFinishLaunching for example.

In addition, if we need location services, notifications, etc. We will create independent managers for each of them, and only their implementation will have access to the specific frameworks.

AppManager

VCI (ViewController Controller Interactor)

We will create base view controllers for each of the native view controllers we need, all the application view controllers will inherit from these base view controllers.

Each view controller will be injected with the corresponding controller depending on whether we are developing, testing or in production, so we can mock what we want.

Each controller will have an interactor who will be in charge of calling the asynchronous core framework tasks, generating a Kommand and passing it to the controller for execution and response handling.

VCI (ViewController Controller Interactor)

Core Framework

Only the StorageManager knows the existence of the persistence framework that is used.

There will be intermediate StorageModels to map/parse the application model and store/update/fetch them in the database.

Only the HTTPClient knows the existence of the networking framework that is used.

There will be intermediate NetworkModels to map/parse the application model and get/post/put them to the network.

The service has tasks for each network API call related with the same context (application model, use case, web service).

Core Framework

CocoaPods

Every networking layer must be implemented around Net protocol.

By default, we'll use NetClient for networking.

We can use Kommander to manage asynchronous processes, but always outside the Core Framework.

To instantiate or reuse Storyboards, ViewControllers, Views, UITableViewCells or UICollectionViewCells, you must use Reusable.

To handle Dates and Timezones, we could use SwiftDate.

We MUST use ATTD with HonestCode, therefore we'll need Cucumberish.

In order to use user location, we will use IGZLocation.

When we need to modify Auto Layout programmatically, we could use SnapKit.

For async image loading we could use Kingfisher.

To use NotificationCenter, SwiftNotificationCenter is recommended.

To display the progress of an ongoing task, you could use SVProgressHUD or SkeletonView.

To securely store data, we use Valet.

As logging library, we love XCGLogger.

❤️ Etc.

  • Contributions are very welcome.
  • Attribution is appreciated (let's spread the word!), but not mandatory.

👨🏻‍💻 Authors

alexruperez, [email protected]

👮🏻 License

Archit is available under the MIT license. See the LICENSE file for more info.

More Repositories

1

Kommander-iOS

A lightweight, pure-Swift library for manage the task execution in different threads. Through the definition a simple but powerful concept, Kommand.
Swift
172
star
2

NetClient-iOS

Versatile HTTP Networking in Swift
Swift
122
star
3

the-real-devops-challenge

This challenge was designed to look for your DevOps skills. This repository contains challenges to demostrates your knowledge.
HCL
33
star
4

IGZLocation

CLLocationManager Swift wrapper with multiple closure handlers and delegates allowed, notifications, sequential geofencing, self-authorization and, of course, everything is testable. #InCodeWeTrust
Swift
31
star
5

lab-microk8s-pod-security-policies

This laboratory is developed to have a first contact with the Pod Security Policies locally using microk8s
Shell
16
star
6

App2WebHandoff

Resume in-app web browsing in the default web-browser of the continuing platform adopting handoff.
Swift
12
star
7

serverless

Docker image containing the Serverless Framework – Build web, mobile and IoT applications with serverless architectures using AWS Lambda, Azure Functions, Google CloudFunctions & more!
Makefile
7
star
8

intelygenz.github.io

6
star
9

monorepo-tagger-action

Action to manage tag life-cycle in a mono-repo with multiple components
JavaScript
5
star
10

ansible-image

Ansible Docker Image
Makefile
5
star
11

action-product-version-tags

Github action to manage the versioning life cycle of a product in monorepo
JavaScript
5
star
12

the-real-sre-challenge

This challenge was designed to look for your SRE skills.
Python
2
star
13

github-actions-poc

github-actions-poc
TypeScript
1
star
14

swift-style-guide

1
star
15

bci-x

Brain Computer Interface X is a complete tool to perform experiments with EEG compatible with OpenBCI devices. The focus of BCI-X is to capture raw data while labeling it during experiments in order to facilitate the work with Deep Learning.
1
star