This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import re | |
import sys | |
def find_swift_files(directory): | |
swift_files = [] | |
for root, _, files in os.walk(directory): | |
for file in files: | |
if file.endswith(".swift"): | |
swift_files.append(os.path.join(root, file)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
| |
# Function to install the 'xcodeproj' gem | |
install_xcodeproj() { | |
gem install xcodeproj | |
} | |
| |
# Check if 'xcodeproj' gem is installed | |
if ! gem spec xcodeproj > /dev/null 2>&1; then | |
echo "Installing 'xcodeproj' gem..." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Module: CleanArchitectureRestaurant | |
import Domain | |
import Data | |
import Presentation | |
final class DinningHallDIContainer { | |
func makeKitchenUseCase() -> KitchenUseCase { | |
let cooker = ItalianCooker() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Module: Data | |
import Domain | |
public struct KitchenLocalDataSource: KitchenLocalRepository { | |
public func getIngredients(_ recipe: Recipe) -> [Ingredient]? { | |
// do something to fetch the ingredients needed from some local store: UserDefaults, CoreData, Memory Cache, KeychainManager etc | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Module: Data | |
import Domain | |
public struct: ItalianCooker: CookerProtocol { | |
func cook(_ recipe: Recipe) { | |
switch recipe { | |
case recipe is SpaghettiCarbonara: | |
cookSpaghettiCarbonara(recipe) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public protocol KitchenLocalRepository { | |
public func getIngredients(_ recipe: Recipe) -> [Ingredient]? | |
} | |
public protocol KitchenRemoteRepository { | |
public func getIngredients(_ recipe: Recipe, completion: ([Ingredient]?) -> Void)) | |
} | |
public protocol CookerProtocol { | |
public func cook(_ recipe: Recipe) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Module: Domain | |
protocol Cookable { | |
func cook() | |
} | |
protocol Recipe: Cookable { | |
// Recipe definition | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Module: Domain | |
struct KitchenUseCase { | |
// Obtains stuff already stored in some place inside the restaurant | |
// For example: fetching it from CoreData, KeychainManager, UserDefaults and so on. | |
private let localDataSource: KitchenLocalRepository | |
// Obtains stuff needed from outside of our restaurant. | |
// For example: doing API calls to a NetworkManager. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"themeName": "base", | |
"colors": [ | |
{ | |
"name": "colorPrimary", | |
"hex": "fafafa" | |
}, | |
{ | |
"name": "colorOnPrimary", |
NewerOlder