This repository has been archived by the owner on Jun 30, 2021. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
add OffGame RIB files
- Loading branch information
Showing
5 changed files
with
135 additions
and
0 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,34 @@ | ||
// | ||
// OffGameBuilder.swift | ||
// RIBsPractice | ||
// | ||
// Created by Eunyeong Kim on 2020/06/10. | ||
// Copyright © 2020 Eunyeong Kim. All rights reserved. | ||
// | ||
|
||
import RIBs | ||
|
||
protocol OffGameDependency: Dependency {} | ||
|
||
final class OffGameComponent: Component<OffGameDependency> {} | ||
|
||
// MARK: - Builder | ||
protocol OffGameBuildable: Buildable { | ||
func build(withListener listener: OffGameListener) -> OffGameRouting | ||
} | ||
|
||
final class OffGameBuilder: Builder<OffGameDependency>, OffGameBuildable { | ||
|
||
override init(dependency: OffGameDependency) { | ||
super.init(dependency: dependency) | ||
} | ||
|
||
func build(withListener listener: OffGameListener) -> OffGameRouting { | ||
_ = OffGameComponent(dependency: dependency) | ||
let viewController = OffGameViewController() | ||
let interactor = OffGameInteractor(presenter: viewController) | ||
interactor.listener = listener | ||
|
||
return OffGameRouter(interactor: interactor, viewController: viewController) | ||
} | ||
} |
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,30 @@ | ||
// | ||
// OffGameInteractor.swift | ||
// RIBsPractice | ||
// | ||
// Created by Eunyeong Kim on 2020/06/10. | ||
// Copyright © 2020 Eunyeong Kim. All rights reserved. | ||
// | ||
|
||
import RIBs | ||
import RxSwift | ||
|
||
protocol OffGameRouting: ViewableRouting {} | ||
|
||
protocol OffGamePresentable: Presentable { | ||
var listener: OffGamePresentableListener? { get set } | ||
} | ||
|
||
protocol OffGameListener: class {} | ||
|
||
final class OffGameInteractor: PresentableInteractor<OffGamePresentable>, OffGameInteractable, OffGamePresentableListener { | ||
|
||
weak var router: OffGameRouting? | ||
weak var listener: OffGameListener? | ||
|
||
override init(presenter: OffGamePresentable) { | ||
super.init(presenter: presenter) | ||
|
||
presenter.listener = self | ||
} | ||
} |
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,25 @@ | ||
// | ||
// OffGameRouter.swift | ||
// RIBsPractice | ||
// | ||
// Created by Eunyeong Kim on 2020/06/10. | ||
// Copyright © 2020 Eunyeong Kim. All rights reserved. | ||
// | ||
|
||
import RIBs | ||
|
||
protocol OffGameInteractable: Interactable { | ||
var router: OffGameRouting? { get set } | ||
var listener: OffGameListener? { get set } | ||
} | ||
|
||
protocol OffGameViewControllable: ViewControllable {} | ||
|
||
final class OffGameRouter: ViewableRouter<OffGameInteractable, OffGameViewControllable>, OffGameRouting { | ||
|
||
override init(interactor: OffGameInteractable, viewController: OffGameViewControllable) { | ||
super.init(interactor: interactor, viewController: viewController) | ||
|
||
interactor.router = self | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
RIBsPractice/RIBsPractice/OffGame/OffGameViewController.storyboard
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,28 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13529" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="vKn-9P-Ny8"> | ||
<device id="retina4_7" orientation="portrait"> | ||
<adaptation id="fullscreen"/> | ||
</device> | ||
<dependencies> | ||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13527"/> | ||
<capability name="Safe area layout guides" minToolsVersion="9.0"/> | ||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> | ||
</dependencies> | ||
<scenes> | ||
<!--product Name View Controller--> | ||
<scene sceneID="GzV-lN-fg7"> | ||
<objects> | ||
<viewController id="vKn-9P-Ny8" customClass="OffGameViewController" customModuleProvider="target" sceneMemberID="viewController"> | ||
<view key="view" contentMode="scaleToFill" id="BNZ-bO-rhc"> | ||
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/> | ||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> | ||
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> | ||
<viewLayoutGuide key="safeArea" id="HgA-Aw-ocO"/> | ||
</view> | ||
</viewController> | ||
<placeholder placeholderIdentifier="IBFirstResponder" id="k0X-am-vwV" userLabel="First Responder" sceneMemberID="firstResponder"/> | ||
</objects> | ||
<point key="canvasLocation" x="244" y="205"/> | ||
</scene> | ||
</scenes> | ||
</document> |
18 changes: 18 additions & 0 deletions
18
RIBsPractice/RIBsPractice/OffGame/OffGameViewController.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,18 @@ | ||
// | ||
// OffGameViewController.swift | ||
// RIBsPractice | ||
// | ||
// Created by Eunyeong Kim on 2020/06/10. | ||
// Copyright © 2020 Eunyeong Kim. All rights reserved. | ||
// | ||
|
||
import RIBs | ||
import RxSwift | ||
import UIKit | ||
|
||
protocol OffGamePresentableListener: class {} | ||
|
||
final class OffGameViewController: UIViewController, OffGamePresentable, OffGameViewControllable { | ||
|
||
weak var listener: OffGamePresentableListener? | ||
} |