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 SwiftUI | |
import UIKit | |
/// - Note: The height must be specified explicitly. | |
public struct HorizontalPagingViewRepresentable<Content: View>: UIViewRepresentable { | |
private let currentIndex: Int | |
private let pageIndexChanged: (Int) -> Void | |
private let content: () -> Content | |
public init( |
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
protocol HungryState {} | |
// 幽霊型はインスタンス化する必要が無いのでenum | |
enum Hungry: HungryState {} | |
enum NotHungry: HungryState {} | |
struct Cat<State: HungryState> {} | |
extension Cat where State == Hungry { |