This file contains hidden or 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
protocol TaskListModelOutput: class { | |
func didUpdate(task: TaskDataType) | |
} |
This file contains hidden or 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 Foundation | |
final class TaskListModel: TaskListModelInput { | |
weak var output: TaskListModelOutput! | |
var card: CardDataModel! | |
init() { | |
card = CardDataModel.mock(option: 0) |
This file contains hidden or 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
protocol TaskListViewControllerInput: ImagePickerOutput, LinkHandlerType { | |
func startTask() | |
func doLaterTask() | |
func didSelect(task: TaskDataType) | |
} |
This file contains hidden or 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 UIKit | |
final class TaskListViewController: UIViewController, InfoPresenterProtocol, ActivityIndicatorProtocol { | |
@IBOutlet weak var collectionView: UICollectionView! | |
var model: TaskListModelInput! | |
var imagePicker: ImagePickerInput! | |
private var collectionDataSource: TaskListCollectionViewDataSource! | |
private var selectedTask: TaskDataType? | |
This file contains hidden or 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 UIKit | |
final class TaskListModuleConfigurator { | |
func configureModuleForViewInput<UIViewController>(viewInput: UIViewController) { | |
if let viewController = viewInput as? TaskListViewController { | |
configure(viewController: viewController) | |
} | |
} | |
This file contains hidden or 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 UIKit | |
final class TaskListModuleInitializer: NSObject { | |
@IBOutlet weak var viewController: TaskListViewController! | |
override func awakeFromNib() { | |
let configurator = TaskListModuleConfigurator() | |
configurator.configureModuleForViewInput(viewInput: viewController) | |
} |
This file contains hidden or 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
//: A UIKit based Playground for presenting user interface | |
import UIKit | |
import PlaygroundSupport | |
final class MyViewController: UIViewController { | |
override func loadView() { | |
let view = UIView() | |
view.backgroundColor = .white |
This file contains hidden or 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
final class InteractiveModalTransitioningDelegate: NSObject, UIViewControllerTransitioningDelegate { | |
var interactiveDismiss = true | |
init(from presented: UIViewController, to presenting: UIViewController) { | |
super.init() | |
} | |
// MARK: - UIViewControllerTransitioningDelegate | |
func animationController(forDismissed dismissed: UIViewController) -> UIViewControllerAnimatedTransitioning? { |
This file contains hidden or 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
final class MyViewController: UIViewController { | |
private var detailsTransitioningDelegate: InteractiveModalTransitioningDelegate! | |
/* | |
Some code | |
*/ | |
@objc | |
private func labelDidTap() { |
This file contains hidden or 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
enum ModalScaleState { | |
case presentation | |
case interaction | |
} | |
final class InteractiveModalPresentationController: UIPresentationController { | |
private let presentedYOffset: CGFloat = 150 | |
private var direction: CGFloat = 0 | |
private var state: ModalScaleState = .interaction |