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
// 引用・参考リスト | |
// @hicka04 [VIPERアーキテクチャ まとめ](https://qiita.com/hicka04/items/09534b5daffec33b2bec#router) | |
// @mizchi [CLINEに全部賭けろ](https://zenn.dev/mizchi/articles/all-in-on-cline) | |
## 重要 | |
ユーザーはあなたよりプログラミングが得意ですが、時短のためにあなたにコーディングを依頼しています。 | |
2回以上連続でテストを失敗した時は、現在の状況を整理して、一緒に解決方法を考えます。 |
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
struct ContentView: View { | |
var body: some View { | |
FloatingCard { | |
VStack { | |
Image(systemName: "globe") | |
.imageScale(.large) | |
.foregroundStyle(.tint) | |
Text("Hello, world!") | |
} | |
.padding() |
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 | |
// Add refinements to this official practice: | |
// https://developer.apple.com/tutorials/swiftui/interfacing-with-uikit | |
struct PageView<Page : View> : View { | |
var pages: () -> [Page] | |
@State private var currentIndex: Int = 0 |
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 | |
/// Use `VStack` when the Dynamic Type size is bigger than `.accessibility1`, otherwise; `HStack`. | |
struct DynamicLabeledContentStyle: LabeledContentStyle { | |
@Environment(\.dynamicTypeSize) var dynamicTypeSize | |
func makeBody(configuration: Configuration) -> some View { | |
if dynamicTypeSize.isAccessibilitySize { |
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 | |
struct EdgeLines: Shape { | |
struct Edge: OptionSet { | |
static let top = Edge(rawValue: 1 << 0) | |
static let bottom = Edge(rawValue: 1 << 1) | |
static let left = Edge(rawValue: 1 << 2) | |
static let right = Edge(rawValue: 1 << 3) | |
static let all = Edge([.top, .bottom, .left, .right]) |
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
/// 多角形のシェープ. | |
struct Polygon : Shape { | |
/// 多角形の頂点の数. デフォルト値は`3` | |
var numberOfVertex: Int | |
/// 角の半径. デフォルト値は`3`. | |
var cornerRadius: CGFloat | |
/// 直線をトップに配置するかどうかのBool値. デフォルト値は`false`. |
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
/// Extended Range sRGB, 拡張範囲sRGBの構造体. | |
/// | |
/// ユーザーがカラーピッカーで選択した色を保存する際、 | |
/// 拡張sRGBに変換して取り回せばDisplay P3やAdobe RGBなどRGB系の別カラースペースの場合でも気にせず取り扱え便利なため中心的に利用する. | |
struct ExtendedSRGB: Hashable, Codable { | |
/// 負数と1以上の値も扱える赤の値. 0.0~1.0はsRGBと互換性がある。 | |
var red: CGFloat | |
/// 負数と1以上の値も扱える緑の値. 0.0~1.0はsRGBと互換性がある。 |
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
/// データをコミットすべきタイミングで実行されるModifier | |
/// | |
/// コミットされるタイミングは下記の3つ: | |
/// 1. `UIApplication.willTerminateNotification`通知を受け取ったとき | |
/// 2. `onDissapear`が呼び出されたとき | |
/// 3. `scenePhase`が`.background`に切り替わったとき | |
/// | |
/// このModifierは上記の3つをまとめて汎用的に取り扱えるシンタックスシュガーとなっている. | |
struct OnCommitModifier: ViewModifier { | |
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
/// UIKit製のUISplitViewController. | |
struct UIKitSplitView<Primary, Secondary>: UIViewControllerRepresentable where Primary : View, Secondary : View { | |
typealias UIViewControllerType = UISplitViewController | |
/// プライマリPaneのビューを生成するクロージャ | |
var primary: () -> Primary | |
/// セカンダリPaneのビューを生成するクロージャ | |
var secondary: () -> Secondary |
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
// | |
// UIKitTableView.swift | |
// | |
// Created by yosshi4486 on 2023/07/18. | |
// | |
import SwiftUI | |
private struct MoveActionEnvironmentKey: EnvironmentKey { | |
NewerOlder