Skip to content

Commit f005e52

Browse files
committed
Initial commit
0 parents  commit f005e52

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+3636
-0
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Xcode - Build and Analyze
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
9+
jobs:
10+
build:
11+
name: Build and analyse default scheme using xcodebuild command
12+
runs-on: macos-latest
13+
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v4
17+
- name: Set Default Scheme
18+
run: |
19+
scheme_list=$(xcodebuild -list -json | tr -d "\n")
20+
default=$(echo $scheme_list | ruby -e "require 'json'; puts JSON.parse(STDIN.gets)['project']['targets'][0]")
21+
echo $default | cat >default
22+
echo Using default scheme: $default
23+
- name: Build
24+
env:
25+
scheme: ${{ 'default' }}
26+
run: |
27+
if [ $scheme = default ]; then scheme=$(cat default); fi
28+
if [ "`ls -A | grep -i \\.xcworkspace\$`" ]; then filetype_parameter="workspace" && file_to_build="`ls -A | grep -i \\.xcworkspace\$`"; else filetype_parameter="project" && file_to_build="`ls -A | grep -i \\.xcodeproj\$`"; fi
29+
file_to_build=`echo $file_to_build | awk '{$1=$1;print}'`
30+
xcodebuild clean build analyze -scheme "$scheme" -"$filetype_parameter" "$file_to_build" | xcpretty && exit ${PIPESTATUS[0]}

.gitignore

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# macOS
2+
.DS_Store
3+
4+
# Xcode
5+
build/
6+
*.pbxuser
7+
!default.pbxuser
8+
*.mode1v3
9+
!default.mode1v3
10+
*.mode2v3
11+
!default.mode2v3
12+
*.perspectivev3
13+
!default.perspectivev3
14+
xcuserdata/
15+
DerivedData/
16+
*.xcuserstate
17+
18+
# Swift Package Manager
19+
.build/
20+
.swiftpm/xcode/
21+
.swiftpm/repositories/
22+
.swiftpm/config/
23+
24+
# CocoaPods
25+
Pods/
26+
*.xcworkspace
27+
!default.xcworkspace
28+
Podfile.lock
29+
Podfile
30+
podfile.lock
31+
32+
# Carthage
33+
Carthage/Build
34+
35+
# Fastlane
36+
fastlane/report.xml
37+
fastlane/Preview.html
38+
fastlane/screenshots
39+
fastlane/test_output
40+
*.lock
41+
42+
# Archives
43+
*.xcarchive
44+
45+
# Other
46+
.idea/
47+
*.moved-aside
48+
*.xcuserdatad
49+
*.swp
50+
*.swm
51+
.cache
52+
*.tmp

README.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# CleanArchitecture-SwiftUI
2+
This is Recipe list application. I have used a public API for network calls and fetched recipe data.
3+
4+
## Architecture concepts used here
5+
6+
- Clean Architecture.
7+
- Dependancy Injection.
8+
- SOLID Principles.
9+
- Navigation using Coordinator.
10+
- Network call using async/await.
11+
- Code coverage with unit testing : ~87%
12+
13+
## Includes
14+
15+
- Unit tests using XCTest.
16+
17+
## Requirements
18+
19+
- Xcode 16.2 Swift 5.5+
20+
21+
## Dependencies
22+
23+
- None.
24+
25+
## Supports
26+
27+
- iPhone Devices. Portrait Mode.
28+
29+
## How to use app
30+
31+
- Clone respository.
32+
33+
## Future Modification
34+
35+
- Add Analytics.
36+
- Snapshot Testing.

RecipeApp.xcodeproj/project.pbxproj

Lines changed: 818 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"colors" : [
3+
{
4+
"idiom" : "universal"
5+
}
6+
],
7+
"info" : {
8+
"author" : "xcode",
9+
"version" : 1
10+
}
11+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"images" : [
3+
{
4+
"idiom" : "universal",
5+
"platform" : "ios",
6+
"size" : "1024x1024"
7+
},
8+
{
9+
"appearances" : [
10+
{
11+
"appearance" : "luminosity",
12+
"value" : "dark"
13+
}
14+
],
15+
"idiom" : "universal",
16+
"platform" : "ios",
17+
"size" : "1024x1024"
18+
},
19+
{
20+
"appearances" : [
21+
{
22+
"appearance" : "luminosity",
23+
"value" : "tinted"
24+
}
25+
],
26+
"idiom" : "universal",
27+
"platform" : "ios",
28+
"size" : "1024x1024"
29+
}
30+
],
31+
"info" : {
32+
"author" : "xcode",
33+
"version" : 1
34+
}
35+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"info" : {
3+
"author" : "xcode",
4+
"version" : 1
5+
}
6+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"images" : [
3+
{
4+
"filename" : "receipe-placeholder.png",
5+
"idiom" : "universal",
6+
"scale" : "1x"
7+
},
8+
{
9+
"idiom" : "universal",
10+
"scale" : "2x"
11+
},
12+
{
13+
"idiom" : "universal",
14+
"scale" : "3x"
15+
}
16+
],
17+
"info" : {
18+
"author" : "xcode",
19+
"version" : 1
20+
}
21+
}
5.61 KB
Loading
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
//
2+
// RecipeCoordinator.swift
3+
// RecipeApp
4+
//
5+
// Created by Ravi Seta on 25/01/25.
6+
//
7+
8+
import SwiftUI
9+
10+
protocol RecipeCoordinator {
11+
associatedtype ContentView: View
12+
func start() -> ContentView
13+
}
14+
15+
class RecipeCoordinatorImpl: RecipeCoordinator {
16+
17+
func start() -> some View {
18+
19+
let recipeRepository = RecipeListRepository(netWorkManager: NetWorkManager())
20+
let recipeListUseCase = RecipeListUseCase(recipeListRepository: recipeRepository)
21+
let recipeListViewModel = RecipelistViewModel(recipeListUseCase: recipeListUseCase)
22+
let recipeListView = RecipeListView(viewModel: recipeListViewModel)
23+
return recipeListView
24+
25+
}
26+
}

0 commit comments

Comments
 (0)