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
interface Destination | |
object NoDestination : Destination | |
abstract class Screen(val name: String) { | |
abstract val parent: Screen | |
abstract val destination: Destination | |
open fun route(): String = listOfNotNull( | |
parent.route().takeIf { it.isNotBlank() }, | |
name, | |
).joinToString("/") |
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
import RxSwift | |
import UIKit | |
/// セルの削除が可能なプロトコル | |
protocol CellRemovable: class { | |
var cellRemovedSubject: PublishSubject<Int> { get } | |
func removeConfiguration(at indexPath: IndexPath) -> UISwipeActionsConfiguration? | |
} | |
extension CellRemovable { |
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
import UIKit | |
/// Storyboardからインスタンスを生成可能なプロトコル | |
protocol Instantiatable: class { | |
/// Storyboardからインスタンスを生成する | |
static func instantiateFromStoryboard() -> Self | |
} | |
extension Instantiatable where Self: UIViewController { |
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
extension UIView { | |
func parentViewController() -> UIViewController? { | |
var parent: UIResponder? = self | |
while let next = parent?.next { | |
if let viewController = next as? UIViewController { | |
return viewController | |
} | |
parent = next | |
} | |
return nil |
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
import RxSwift | |
import UIKit | |
final class Indicator { | |
/// シングルトン | |
static let shared = Indicator() | |
/// モーダル用のView | |
private let modal = UIView() |
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
import RxSwift | |
import UIKit | |
struct HogeDialog { | |
// MARK: - Completables | |
/// OKをタップしたイベントのストリーム | |
var ok: Observable<String> { | |
return okSubject.asObservable() | |
} |
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
import Foundation | |
/// 日時 | |
struct DateTime { | |
/// 値 | |
let value: Date | |
/// DateTimeのインスタンスを生成する | |
/// | |
/// - Parameter value: 日時の値 |
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
import Foundation | |
/// データソースに関するエラー | |
enum DataSourceError: Error { | |
/// realmのエラー | |
case realmError(message: String) | |
/// キーチェーンのエラー | |
case keychainError(message: String) | |
} |
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
import Foundation | |
/// APIのエラー応答 | |
struct APIErrorResponse: Decodable { | |
/// ステータス | |
let status: String | |
/// メッセージ(単体の場合) | |
let message: String? | |
/// メッセージ(複数の場合) | |
let messages: [String]? |
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
import Foundation | |
struct HeartRateResponse: Decodable { | |
let dateTime: DateTime | |
let heartRate: Double | |
enum CodingKeys: String, CodingKey { | |
case dateTime = "DateTime" | |
case heartRate = "HeartRate" | |
} |
NewerOlder