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
| package com.example.demo.repository | |
| import com.example.demo.data.Person | |
| import org.springframework.data.mongodb.repository.MongoRepository | |
| import org.springframework.stereotype.Repository | |
| @Repository | |
| interface PersonRepository : MongoRepository<Person, String> { | |
| fun findByNameLike(name: String): List<Person> | |
| } |
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
| package com.example.demo.data | |
| import org.springframework.data.mongodb.core.mapping.Document | |
| import java.util.* | |
| import javax.persistence.Id | |
| @Document(collection="person") | |
| data class Person( | |
| @Id | |
| val id: String = UUID.randomUUID().toString(), |
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 | |
| import CoreNavigation | |
| struct Color: Destination { | |
| typealias ViewControllerType = ColorViewController | |
| static func resolve(context: Context<ViewControllerType>) { | |
| guard let rgbHexString = context.parameters?["color"] as? String else { | |
| context.complete() | |
| return |
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 CoreNavigation | |
| @UIApplicationMain | |
| class AppDelegate: UIResponder, UIApplicationDelegate { | |
| var window: UIWindow? = UIWindow() | |
| func application(_ application: UIApplication, willFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey : Any]? = nil) -> Bool { | |
| registerRoutes() |
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: ChromaColorPickerDelegate | |
| extension ColorViewController: ChromaColorPickerDelegate { | |
| func colorPickerDidChooseColor(_ colorPicker: ChromaColorPicker, color: UIColor) { | |
| // MARK: navigation to destination | |
| Navigate.push { $0 | |
| .to(Color()) | |
| .passData(color) | |
| } | |
| } | |
| } |
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 CoreNavigation | |
| struct Color: Destination { | |
| typealias ViewControllerType = ColorViewController | |
| } |
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: DataReceivable | |
| extension ColorViewController: DataReceivable { | |
| typealias DataType = UIColor | |
| func didReceiveData(_ data: UIColor) { | |
| view.backgroundColor = data | |
| } | |
| } |
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 CoreNavigation | |
| import ChromaColorPicker | |
| class ColorViewController: UIViewController { | |
| lazy var colorPicker: ChromaColorPicker = { | |
| let view = ChromaColorPicker(frame: CGRect(x: 0, y: 0, width: 300, height: 300)) | |
| view.padding = 5 | |
| view.stroke = 3 | |
| view.hexLabel.textColor = UIColor.black |