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 SwiftUI | |
extension Color { | |
static var label: Color { | |
return Color(UIColor.label) | |
} | |
static var secondaryLabel: 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 SwiftUI | |
import UIKit | |
struct PageViewController: UIViewControllerRepresentable { | |
var controllers: [UIViewController] | |
@Binding var currentPage: Int | |
func makeCoordinator() -> Coordinator { | |
Coordinator(self) | |
} |
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
ThemeData _buildTheme() { | |
final ThemeData base = ThemeData.light(); | |
return base.copyWith( | |
textTheme: base.textTheme.apply(fontFamily: 'Hiragino Kaku Gothic ProN'), | |
primaryTextTheme: | |
base.primaryTextTheme.apply(fontFamily: 'Hiragino Kaku Gothic ProN'), | |
accentTextTheme: | |
base.accentTextTheme.apply(fontFamily: 'Hiragino Kaku Gothic ProN')); | |
} |
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 | |
class HogeViewModel { | |
let d1: String | |
let d2: String | |
let d3: String | |
init(d1: String, d2: String, d3: String) { | |
self.d1 = d1 |
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
override func viewDidLoad() { | |
super.viewDidLoad() | |
// Do any additional setup after loading the view, typically from a nib. | |
do { | |
let htmlText: String = | |
"<html><head></head><body><h1>Hello World</h1><a href=\"https://www.apple.com\">link</a><p>This is a sample text</p><pre>This is also sample pre text</pre></body></html>" | |
let encodedData = htmlText.data(using: String.Encoding.utf8)! |
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 **ViewController: UIViewController { | |
var viewModel: **ViewModel! | |
... | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
self.viewModel.stateDidUpdate = { [unowned self] state in | |
switch state { |
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 | |
class ScaledModalAnimationController: NSObject, UIViewControllerAnimatedTransitioning { | |
let presenting: Bool | |
init(presenting: Bool) { | |
self.presenting = presenting | |
} | |