-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#127: Initiate moving to Clean Architecture for Choose File Scene
- Loading branch information
1 parent
165584a
commit 133544f
Showing
9 changed files
with
233 additions
and
17 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
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,40 @@ | ||
// | ||
// ChooseFileConfigurator.swift | ||
// GroupLock | ||
// | ||
// Created by Sergej Jaskiewicz on 12.07.16. | ||
// Copyright (c) 2016 Lanit-Tercom School. All rights reserved. | ||
// | ||
|
||
import UIKit | ||
|
||
// MARK: - Connect View, Interactor, and Presenter | ||
|
||
extension ChooseFileViewController: ChooseFilePresenterOutput { | ||
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { | ||
router.passDataToNextScene(segue) | ||
} | ||
} | ||
|
||
extension ChooseFileInteractor: ChooseFileViewControllerOutput {} | ||
|
||
extension ChooseFilePresenter: ChooseFileInteractorOutput {} | ||
|
||
class ChooseFileConfigurator { | ||
|
||
// MARK: - Configuration | ||
|
||
static func configure(viewController: ChooseFileViewController) { | ||
let router = ChooseFileRouter() | ||
router.viewController = viewController | ||
|
||
let presenter = ChooseFilePresenter() | ||
presenter.output = viewController | ||
|
||
let interactor = ChooseFileInteractor() | ||
interactor.output = presenter | ||
|
||
viewController.output = interactor | ||
viewController.router = router | ||
} | ||
} |
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 @@ | ||
// | ||
// ChooseFileInteractor.swift | ||
// GroupLock | ||
// | ||
// Created by Sergej Jaskiewicz on 12.07.16. | ||
// Copyright (c) 2016 Lanit-Tercom School. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
protocol ChooseFileInteractorInput { | ||
|
||
} | ||
|
||
protocol ChooseFileInteractorOutput { | ||
|
||
} | ||
|
||
class ChooseFileInteractor: ChooseFileInteractorInput { | ||
|
||
var output: ChooseFileInteractorOutput! | ||
var worker: ChooseFileWorker! | ||
|
||
// MARK: - Business logic | ||
|
||
|
||
} |
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,21 @@ | ||
// | ||
// ChooseFileModels.swift | ||
// GroupLock | ||
// | ||
// Created by Sergej Jaskiewicz on 12.07.16. | ||
// Copyright (c) 2016 Lanit-Tercom School. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
struct ChooseFileRequest { | ||
|
||
} | ||
|
||
struct ChooseFileResponse { | ||
|
||
} | ||
|
||
struct ChooseFileViewModel { | ||
|
||
} |
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 @@ | ||
// | ||
// ChooseFilePresenter.swift | ||
// GroupLock | ||
// | ||
// Created by Sergej Jaskiewicz on 12.07.16. | ||
// Copyright (c) 2016 Lanit-Tercom School. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
protocol ChooseFilePresenterInput { | ||
|
||
} | ||
|
||
protocol ChooseFilePresenterOutput: class { | ||
|
||
} | ||
|
||
class ChooseFilePresenter: ChooseFilePresenterInput { | ||
|
||
weak var output: ChooseFilePresenterOutput! | ||
|
||
// MARK: - Presentation logic | ||
|
||
|
||
} |
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,36 @@ | ||
// | ||
// ChooseFileRouter.swift | ||
// GroupLock | ||
// | ||
// Created by Sergej Jaskiewicz on 12.07.16. | ||
// Copyright (c) 2016 Lanit-Tercom School. All rights reserved. | ||
// | ||
|
||
import UIKit | ||
|
||
protocol ChooseFileRouterInput { | ||
|
||
} | ||
|
||
class ChooseFileRouter: ChooseFileRouterInput { | ||
|
||
weak var viewController: ChooseFileViewController! | ||
|
||
|
||
// MARK: - Communication | ||
|
||
func passDataToNextScene(segue: UIStoryboardSegue) { | ||
// NOTE: Teach the router which scenes it can communicate with | ||
|
||
if segue.identifier == "encryptFiles" { | ||
passDataToKeyTypeScene(segue) | ||
} | ||
} | ||
|
||
func passDataToKeyTypeScene(segue: UIStoryboardSegue) { | ||
|
||
let destination = segue.destinationViewController as! KeyTypeViewController | ||
let conveyedFiles = Array(viewController.selectedFiles.values) | ||
destination.files = conveyedFiles | ||
} | ||
} |
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
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 @@ | ||
// | ||
// ChooseFileWorker.swift | ||
// GroupLock | ||
// | ||
// Created by Sergej Jaskiewicz on 12.07.16. | ||
// Copyright (c) 2016 Lanit-Tercom School. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
class ChooseFileWorker { | ||
|
||
// MARK: Business Logic | ||
|
||
} |
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