-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from ramyaimansabry/feature/uikit-version
Feature/uikit version
- Loading branch information
Showing
264 changed files
with
26,979 additions
and
183 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
|
||
ADVA Photos Task.xcodeproj/project.xcworkspace/xcuserdata/ramysabry.xcuserdatad/UserInterfaceState.xcuserstate | ||
ADVA Photos Task.xcworkspace/xcuserdata/ramysabry.xcuserdatad/UserInterfaceState.xcuserstate | ||
*.xcuserstate |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
|
||
disabled_rules: # rule identifiers to exclude from running | ||
- force_cast | ||
- notification_center_detachment | ||
- trailing_whitespace | ||
- unused_closure_parameter | ||
|
||
|
||
opt_in_rules: | ||
- empty_count | ||
|
||
#Customized Rules | ||
line_length: | ||
warning: 250 | ||
error: 300 | ||
ignores_function_declarations: true | ||
ignores_comments: true | ||
ignores_urls: true | ||
|
||
|
||
file_length: | ||
warning: 1000 | ||
error: 1500 | ||
ignore_comment_only_lines: true | ||
|
||
type_body_length: | ||
warning: 300 | ||
error: 500 | ||
|
||
function_body_length: | ||
warning: 300 | ||
error: 500 | ||
|
||
function_parameter_count: | ||
warning: 10 | ||
error: 11 | ||
|
||
cyclomatic_complexity: | ||
warning: 15 | ||
error: 25 | ||
|
||
vertical_whitespace: | ||
warning: 3 | ||
max_empty_lines: 2 | ||
|
||
identifier_name: | ||
min_length: 2 | ||
|
||
|
||
|
||
excluded: # paths to ignore during linting. Takes precedence over `included`. | ||
- Pods | ||
- Carthage | ||
- SwiftLint/Common/3rdPartyLib | ||
- Fructus/Data/FruitData.swift | ||
|
||
reporter: "xcode" # reporter type (xcode, json, csv, checkstyle, junit, html, emoji, sonarqube, markdown) |
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file modified
BIN
+98 KB
(950%)
...eproj/project.xcworkspace/xcuserdata/ramysabry.xcuserdatad/UserInterfaceState.xcuserstate
Binary file not shown.
6 changes: 6 additions & 0 deletions
6
...otos Task.xcodeproj/xcuserdata/ramysabry.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<Bucket | ||
uuid = "193C4103-84E7-41B5-8011-96B2C5F53E2C" | ||
type = "1" | ||
version = "2.0"> | ||
</Bucket> |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
8 changes: 8 additions & 0 deletions
8
ADVA Photos Task.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>IDEDidComputeMac32BitWarning</key> | ||
<true/> | ||
</dict> | ||
</plist> |
Binary file added
BIN
+137 KB
ADVA Photos Task.xcworkspace/xcuserdata/ramysabry.xcuserdatad/UserInterfaceState.xcuserstate
Binary file not shown.
6 changes: 6 additions & 0 deletions
6
...os Task.xcworkspace/xcuserdata/ramysabry.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<Bucket | ||
uuid = "5EB738FE-AAD3-4FB9-9038-5FDF723B3378" | ||
type = "0" | ||
version = "2.0"> | ||
</Bucket> |
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// | ||
// AppDelegate.swift | ||
// ADVA Photos Task | ||
// | ||
// Created by Ramy Sabry on 28/03/2022. | ||
// | ||
|
||
import UIKit | ||
|
||
@main | ||
class AppDelegate: UIResponder, UIApplicationDelegate { | ||
|
||
var window: UIWindow? | ||
private var coordinator: Coordinator? | ||
|
||
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { | ||
|
||
// create the main navigation controller to be used for our app | ||
let navigationController = UINavigationController() | ||
|
||
// send that into our coordinator so that it can display view controllers | ||
coordinator = AppCoordinator(navigationController: navigationController) | ||
|
||
// tell the coordinator to take over control | ||
coordinator?.start() | ||
|
||
window = UIWindow(frame: UIScreen.main.bounds) | ||
window?.rootViewController = navigationController | ||
window?.makeKeyAndVisible() | ||
return true | ||
} | ||
} |
File renamed without changes.
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>SERVER_HOST</key> | ||
<string>$(SERVER_HOST)</string> | ||
<key>SERVER_SCHEME</key> | ||
<string>$(SERVER_SCHEME)</string> | ||
</dict> | ||
</plist> |
26 changes: 26 additions & 0 deletions
26
ADVA Photos Task/Home Module/Home Screen/Data/Repository/HomeRepository.swift
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// | ||
// HomeRepository.swift | ||
// ADVA Photos Task | ||
// | ||
// Created by Ramy Sabry on 30/03/2022. | ||
// | ||
|
||
import Combine | ||
|
||
final class HomeRepository: DisposeObject, HomeRepositoryContract { | ||
private let service: HomeServiceContract | ||
|
||
init(service: HomeServiceContract = HomeService()) { | ||
self.service = service | ||
super.init() | ||
} | ||
|
||
func fetchPhotosList( | ||
with pageIndex: Int, | ||
and pageSize: Int | ||
) -> AnyPublisher<[PhotoData], BaseError> { | ||
return service.fetchphotosList(with: pageIndex, and: pageSize) | ||
.eraseToBaseError() | ||
.eraseToAnyPublisher() | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
ADVA Photos Task/Home Module/Home Screen/Data/Service/HomeService.swift
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// | ||
// HomeService.swift | ||
// ADVA Photos Task | ||
// | ||
// Created by Ramy Sabry on 30/03/2022. | ||
// | ||
|
||
import Combine | ||
|
||
final class HomeService: DisposeObject, HomeServiceContract { | ||
private var apiService: APIServiceContract | ||
|
||
init(apiService: APIServiceContract = APIService.shared) { | ||
self.apiService = apiService | ||
super.init() | ||
} | ||
|
||
func fetchphotosList( | ||
with pageIndex: Int, | ||
and pageSize: Int | ||
) -> AnyPublisher<[PhotoData], BaseError> { | ||
let request = APIBuilder() | ||
.setPath(using: .fetchPhotosList, argument: ["\(pageIndex)", "\(pageSize)"]) | ||
.setMethod(using: .get) | ||
.build() | ||
|
||
return apiService | ||
.request( | ||
using: request, | ||
responseType: [PhotoData].self | ||
) | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
...os Task/Home Module/Home Screen/Domain/Interfaces/Repository/HomeRepositoryContract.swift
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// | ||
// HomeRepositoryContract.swift | ||
// ADVA Photos Task | ||
// | ||
// Created by Ramy Sabry on 30/03/2022. | ||
// | ||
|
||
import Combine | ||
|
||
protocol HomeRepositoryContract { | ||
func fetchPhotosList( | ||
with pageIndex: Int, | ||
and pageSize: Int | ||
) -> AnyPublisher<[PhotoData], BaseError> | ||
} |
15 changes: 15 additions & 0 deletions
15
... Photos Task/Home Module/Home Screen/Domain/Interfaces/Services/HomeServiceContract.swift
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// | ||
// HomeServiceContract.swift | ||
// ADVA Photos Task | ||
// | ||
// Created by Ramy Sabry on 30/03/2022. | ||
// | ||
|
||
import Combine | ||
|
||
protocol HomeServiceContract { | ||
func fetchphotosList( | ||
with pageIndex: Int, | ||
and pageSize: Int | ||
) -> AnyPublisher<[PhotoData], BaseError> | ||
} |
15 changes: 15 additions & 0 deletions
15
.../Home Module/Home Screen/Domain/Interfaces/Use Cases/FetchPhotosListUseCaseContract.swift
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// | ||
// FetchPhotosListUseCaseUseCaseContract.swift | ||
// ADVA Photos Task | ||
// | ||
// Created by Ramy Sabry on 30/03/2022. | ||
// | ||
|
||
import Combine | ||
|
||
protocol FetchPhotosListUseCaseContract { | ||
func execute( | ||
with pageIndex: Int, | ||
and pageSize: Int | ||
) -> AnyPublisher<[PhotoData], BaseError> | ||
} |
20 changes: 20 additions & 0 deletions
20
...otos Task/Home Module/Home Screen/Domain/Interfaces/ViewModel/HomeViewModelContract.swift
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// | ||
// HomeViewModelContract.swift | ||
// ADVA Photos Task | ||
// | ||
// Created by Ramy Sabry on 30/03/2022. | ||
// | ||
|
||
import Foundation | ||
|
||
typealias HomeViewModelContract = BaseViewModel & ObservableObject & HomeViewModelInput & HomeViewModelOutput | ||
|
||
protocol HomeViewModelInput { | ||
func loadPhotos() | ||
func loadMorePhotos() | ||
} | ||
|
||
protocol HomeViewModelOutput { | ||
func getPhotoData(for indexPath: IndexPath) -> PhotoData? | ||
func getPhotoSize(for indexPath: IndexPath) -> (Float, Float) | ||
} |
27 changes: 27 additions & 0 deletions
27
ADVA Photos Task/Home Module/Home Screen/Domain/Models/PhotoData.swift
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// | ||
// PhotosListResponse.swift | ||
// ADVA Photos Task | ||
// | ||
// Created by Ramy Sabry on 30/03/2022. | ||
// | ||
|
||
import Foundation | ||
|
||
struct PhotoData: Decodable { | ||
let id: String | ||
let createdAt: String? | ||
let updatedAt: String? | ||
let promotedAt: String? | ||
let width: Float? | ||
let height: Float? | ||
let color: String? | ||
let blurHash: String? | ||
let welcomeDescription: String? | ||
let altDescription: String? | ||
let urls: PhotoURLs? | ||
let links: PhotoDownloadLinks? | ||
let likes: Int? | ||
let likedByUser: Bool? | ||
let sponsorship: PhotoSponsorship? | ||
let user: PhotoOwner? | ||
} |
15 changes: 15 additions & 0 deletions
15
ADVA Photos Task/Home Module/Home Screen/Domain/Models/PhotoDownloadLinks.swift
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// | ||
// PhotoDownloadLinks.swift | ||
// ADVA Photos Task | ||
// | ||
// Created by Ramy Sabry on 03/04/2022. | ||
// | ||
|
||
import Foundation | ||
|
||
struct PhotoDownloadLinks: Decodable { | ||
let linksSelf: String? | ||
let html: String? | ||
let download: String? | ||
let downloadLocation: String? | ||
} |
Oops, something went wrong.