How to build a modular architecture in iOS
['Benoit Pasquier']
Benoit Pasquier - Swift, Data and more
Assuming we create a new app for e-commerce, we need to create a specific dependency that represent the core concept of our app. public protocol ProductServiceProtocol { func getAllProducts () -> [ Product ] } public final class ProductService : ProductServiceProtocol { public init () { } public func getAllProducts () -> [ Product ] { // imagine we fetch products from server let products = [ Product ( name : "shoe" , price : 100 ), Product ( name : "t-shirt" , price : 30 )] return products } } To import Core framework within the App and be able to use it, I only drag & drop the framework file to the Linked Framework and Libraries section of my main app.