Git Product home page Git Product logo

flickr-app's Introduction

FlickrSearchApp

IMAGE ALT TEXT

Context:

Make an TVOS app with Swift/UIKit that the user can see an grid of popular photos from Flickr with infinite scrolling and search.

Important:

The api_key from Flickr on this project are deleted, you need to generate a new own and put on FlickrURLBuilder/apiKey

Useful commands:

  • Create XCode Project
./.tuist-bin/tuist generate

or just

make project

Architecture

Tuist graph Dependency Graph

Witch this architecture features are decopladed, so the grid screen itself don't knows who is populating the information, just sent the events.

Improvements

One improvement to make on this project is create a Service Locator to register cross-modules dependencies to make router's less repetitive and improve dependency management, like https://github.com/Swinject/Swinject library:

final class FlickrTradingTopRoute { 
	@Inject var service: FlickrService
	@Inject var imageLoader: ImageLoader

	static func makeViewController() -> UIViewController { 
        let adapter = GridAdapter<GridCellViewModel>()
        
        let grid = GridViewController(
            viewModel: FlickrTrandingTopGridViewModel(
                adapter: adapter,
                fetchPagedGridUseCase: FetchPagedFlickrGridPhotosUseCase(service: service),
                imageUseCaseFetchable: FetchImageUseCase(
                    imageLoader: imageLoader
                ),
                searchPagedGridUseCase: FetchPagedSearchFlickrPhotosUseCase(
                    service: service
                )
            )
        )
        grid.title = "Feed"
        return grid
	}
} 

And register the correct implementation on the app startup

@main
class AppDelegate: UIResponder, UIApplicationDelegate {
	//....
	func registerDependencies() { 
		Container.shared.register({ solve in FlickrServiceImpl(service: solve()) }, for: FlickrService.self)
		///...
	}
}

Another thing that can be improved is split the libraries in Two different target's (LibInterface and Lib) on Interface will just have protocols and another public stuff that any module can use without comprimise the decoupling. On the other module is the default implementation that can be replaced on future only changing the glue-layer (aka: AppDelegate).

And Split UseCases in another module to re-use them in multiple target's

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.