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 | |
struct EvolutionProposal: Codable { | |
var id: String | |
var title: String | |
var reviewStartDate: Date | |
var reviewEndDate: Date | |
enum CodingKeys: String, CodingKey { |
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 Data: Decodable { | |
var age: Int | |
var address: Address | |
struct Address: Decodable { | |
var street: String | |
var city: String | |
} | |
private enum CodingKeys: String, CodingKey { |
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 InputFieldButtonStyle<Content: View>: ButtonStyle { | |
@Environment(\.colorScheme) var colorScheme | |
let mimicksDropdown: Bool | |
let placeholderContent: () -> Content? | |
init( | |
mimicksDropdown: Bool = false, | |
@ViewBuilder placeholderContent: @escaping () -> Content? = { nil } |
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 GridView: View { | |
var lineWidth: CGFloat = 1.5 | |
var color = Color( | |
.displayP3, | |
red: 225/255, | |
green: 225/255, | |
blue: 225/255, | |
opacity: 1.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
struct CircleView: View { | |
@State var spacing: Double = 12 | |
var radius: Double = 250 | |
var body: some View { | |
GeometryReader { proxy in | |
let center = CGPoint(x: proxy.frame(in: .local).midX, y: proxy.frame(in: .local).midY) | |
Path { path in |
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
extension ButtonStyle where Self == InputFieldButtonStyle<AnyView> { | |
internal static func input<Content: View>(mimicksDropdown: Bool = false, | |
@ViewBuilder placeholderContent: @escaping () -> Content? = { nil }) -> InputFieldButtonStyle<AnyView> { | |
InputFieldButtonStyle(mimicksDropdown: mimicksDropdown, | |
placeholderContent: { | |
AnyView(placeholderContent()) | |
}) | |
} | |
} |
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
// | |
// BindingTest.swift | |
// MutatingState | |
// | |
// Created by Michael Nino Evensen on 21/12/2022. | |
// | |
import SwiftUI | |
struct Object: Identifiable, Hashable { |
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
// | |
// BindingTest.swift | |
// MutatingState | |
// | |
// Created by Michael Nino Evensen on 21/12/2022. | |
// | |
import SwiftUI | |
struct Object: Identifiable { |
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 Swift | |
import Foundation | |
let json = """ | |
{ | |
"amount": 3, | |
"confirmed": false, | |
"context": { | |
"wishlist": { | |
"mTy7R1Y7OI22w1jAqKvo": { |
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 | |
struct Film: Codable { | |
let actor: String | |
let year: Int | |
let key: String | |
// Объявляем ключи только для тех которые внутри модели | |
enum CodingKeys: CodingKey { | |
case actor |