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
| @objc func onRotated() { | |
| // portrait | |
| if UIDeviceOrientationIsPortrait(UIDevice.current.orientation) { | |
| } | |
| // landscape | |
| else if UIDeviceOrientationIsLandscape(UIDevice.current.orientation) { | |
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
| @objc func onRotated() { | |
| // portrait | |
| if UIDeviceOrientationIsPortrait(UIDevice.current.orientation) { | |
| playerController.view.frame = CGRect(x: 0, y: 200, width: UIScreen.main.bounds.width, height: 250) | |
| } | |
| // landscape | |
| else if UIDeviceOrientationIsLandscape(UIDevice.current.orientation) { | |
| playerController.view.frame = CGRect(x: 0, y: 0, width: UIScreen.main.bounds.width, height: UIScreen.main.bounds.height) |
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 | |
| import AVKit | |
| class ViewController: UIViewController { | |
| let playerController = AVPlayerViewController() | |
| override func viewDidLoad() { | |
| super.viewDidLoad() | |
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 | |
| import StoreKit | |
| @UIApplicationMain | |
| class AppDelegate: UIResponder, UIApplicationDelegate { | |
| var window: UIWindow? | |
| func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { | |
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
| class HomeInteractor { | |
| var presenter: HomeInteractorOutputProtocol! | |
| } | |
| extension HomeInteractor: HomeInteractorInputProtocol {} |
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
| class HomePresenter { | |
| var view: HomeViewProtocol! | |
| var interactor: HomeInteractorInputProtocol! | |
| var router: HomeWireframeProtocol! | |
| } | |
| extension HomePresenter: HomePresenterProtocol {} | |
| extension HomePresenter: HomeInteractorOutputProtocol {} |
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
| // MARK: Wireframe | |
| protocol HomeWireframeProtocol: class {} | |
| // MARK: Presenter | |
| protocol HomePresenterProtocol: class { | |
| var interactor: HomeInteractorInputProtocol! { get set } | |
| } | |
| // MARK: Interactor | |
| // Interactor -> Presenter |
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
| class HomeRouter: NSObject { | |
| var controller: HomeTableController! | |
| var presenter: HomePresenter! | |
| var interactor: HomeInteractor! | |
| required override init() { | |
| super.init() | |
| interactor = HomeInteractor() | |
| presenter = HomePresenter() |
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
| class HomeTableController: UITableViewController { | |
| var presenter: HomePresenterProtocol! | |
| } | |
| extension HomeTableController: HomeViewProtocol {} |
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
| func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { | |
| let homeNavigationController = UINavigationController(rootViewController: HomeRouter().controller) | |
| window = UIWindow(frame: UIScreen.main.bounds) | |
| window?.rootViewController = homeNavigationController | |
| window?.makeKeyAndVisible() | |
| return true | |
| } |