All Projects → HelmMobile → Clean Swift Templates

HelmMobile / Clean Swift Templates

Licence: other

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Clean Swift Templates

Propertyfindar
🏘 🎃 Real Estate Sample App with RxJava3+Coroutines Flow, Dynamic Feature Modules, Dagger Hilt, Offline First, ConcatAdapter, Animations and tests for Room, Retrofit, useCase and ViewModels with TDD.
Stars: ✭ 133 (-7.64%)
Mutual labels:  clean-architecture
Php Programming Best Practices
Referencia para los desarrolladores de Tiendanube y para la comunidad de PHP.
Stars: ✭ 138 (-4.17%)
Mutual labels:  clean-architecture
Clean Architecture Delivery Example
A example of clean architecture in Java 8 and Spring Boot 2.0
Stars: ✭ 140 (-2.78%)
Mutual labels:  clean-architecture
Eve
Eve and Wall-e
Stars: ✭ 133 (-7.64%)
Mutual labels:  clean-architecture
Go Ddd Sample
DDD like architecture sample application
Stars: ✭ 135 (-6.25%)
Mutual labels:  clean-architecture
Pagingroom
Demonstrates various ways of using Paging library with Room (LiveData, RxJava, custom datasource)
Stars: ✭ 139 (-3.47%)
Mutual labels:  clean-architecture
Go Bank Transfer
Simple API for banking routines using a Clean Architecture in Golang. 💳 💰 💸
Stars: ✭ 123 (-14.58%)
Mutual labels:  clean-architecture
Kotlinmvparchitecture
Clean MVP Architecture with Dagger2 + Retrofit2 + Mockito + Fresco + EasiestGenericRecyclerAdapter using Kotlin. Added Unit Tests(Kotlin Tests)!
Stars: ✭ 143 (-0.69%)
Mutual labels:  clean-architecture
Coolstore Microservices
A full-stack .NET microservices build on Dapr and Tye
Stars: ✭ 1,903 (+1221.53%)
Mutual labels:  clean-architecture
Mvvm
A sample Android application using MVVM, Clean Architecture, Android Architecture Components
Stars: ✭ 141 (-2.08%)
Mutual labels:  clean-architecture
React With Clean Architecture
Clean architecture based react project sample code.
Stars: ✭ 132 (-8.33%)
Mutual labels:  clean-architecture
Kotlinmultiplatform mvvm
Android & iOS App using MVVM pattern and LiveData on the presentation layer + Clean Arch on the common shared code.
Stars: ✭ 135 (-6.25%)
Mutual labels:  clean-architecture
Android Modular Architecture
📚 Sample Android Components Architecture on a modular word focused on the scalability, testability and maintainability written in Kotlin, following best practices using Jetpack.
Stars: ✭ 2,048 (+1322.22%)
Mutual labels:  clean-architecture
Swift Cleanarchitecture
Simple Swift project applying concepts inspired on the Clean Architecture
Stars: ✭ 133 (-7.64%)
Mutual labels:  clean-architecture
Cleanarchitecture.workerservice
A solution template using Clean Architecture for building a .NET Core Worker Service.
Stars: ✭ 142 (-1.39%)
Mutual labels:  clean-architecture
Modular App Core
Core implementations for a modular Android App
Stars: ✭ 127 (-11.81%)
Mutual labels:  clean-architecture
Android Clean Architecture Mvvm Dagger Rx
Implemented by Clean Architecture, Dagger2, MVVM, LiveData, RX, Retrofit2, Room, Anko
Stars: ✭ 138 (-4.17%)
Mutual labels:  clean-architecture
Practical Dapr
A full-stack .NET microservices build on Dapr and Tye
Stars: ✭ 140 (-2.78%)
Mutual labels:  clean-architecture
Android Clean Architecture Boilerplate
Apply clean architecture on Android
Stars: ✭ 141 (-2.08%)
Mutual labels:  clean-architecture
Done it
DoneIt is a sample note app 📝 Flutter application 📱 built to demonstrate use of Clean Architecture tools. Dedicated to all Flutter Developers with ❤️.
Stars: ✭ 140 (-2.78%)
Mutual labels:  clean-architecture

Clean-swift templates

This is a modification of Clean Swift Templates (http://clean-swift.com) made by HELM (www.helm.cat)

To learn more about Clean Swift and the VIP cycle, read:

http://clean-swift.com/clean-swift-ios-architecture

Changelog

This modification aims to create work-ready templates and snippets to achieve the maximum efficiency for people who are already familiar with them. Furthermore we added some extra features in order to attempt to solve some issues.

Here is a list of what is modified:

Added features:

  • Awesome snippet to create usecases
  • New data-passing method
  • Added Store Template

Snippet

alt text

New data-passing method

Previously to pass data we need to do something like this in the source Router:

let user = sourceViewController.output.selectedUser
destinationViewController.output.user = user

We think this is wrong because:

  1. We are not trying to output anything from the ViewController.
  2. We are assuming the output === Interactor and the architecture loses sense (no component should know about what kind of object its output/input is).
  3. We dont want the ViewController to know anything about Business model.
  4. We want the Interactor to handle this data but we don't want the ViewController to know anything about it.

So we added 2 new protocols on the router

protocol RouterDataSource: class {

}
protocol RouterDataDestination: class {

}
  • The RouterDataSource protocol is used to determine what business data has to be passed somewhere.
  • The RouterDataDestination protocol is used to determine what data has to be received and handled by this scene.

So following the example before we would add this in the source Router:

protocol UserListRouterDataSource: class {
    var selectedUser: User! { get }
}

protocol UserListRouterDataDestination: class {

}

And this in the destination:

protocol UserDetailRouterDataSource: class {

}

protocol UserDetailRouterDataDestination: class {
    var user: User! { get set }
}

As we added a dataSource object and a dataDestination object in the Router, we can now do this:

let user = dataSource.selectedUser
userDetailViewController.router.dataDestination.user = user

As previously mentioned we believe this handling should be done by the Interactor aswell but without the ViewController knowing it so we added the protocols there and changed the Configurator.swift in order to connect both protocols.

So the source Interactor would look like this:

protocol UserListDataSource {
    var selectedUser: User! { get }
}

protocol UserListDataDestination {

}

class UserListInteractor: UserListInteractorInput, UserListDataSource, UserListDataDestination {

And as you would assume, the destination Interactor looks like this:

protocol UserDetailDataSource {

}

protocol UserDetailDataDestination {
    var user: User! { get set }
}

class UserDetailInteractor: UserDetailInteractorInput, UserDetailDataSource, UserDetailDataDestination {

You can see a working example in the Example folder.

Installation

To install the Clean Swift Xcode HELM templates and snippets, run:

./configure
make install

To uninstall the Clean Swift Xcode templates and snippets, run:

make uninstall

To try the Example project you need carthage:

brew update
brew install carthage

Then run

./cartupdate.sh

In the project folder (/Example)

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].