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 UIKit | |
import SwiftUI | |
struct ContentView2: View { | |
var body: some View { | |
VStack { | |
SimpleRepresentable(text: "Test") | |
} | |
} | |
} |
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 | |
extension View { | |
func pipe<R>(@ViewBuilder _ f: (Self) -> R) -> R { | |
f(self) | |
} | |
} | |
struct ContentView: View { | |
@State var flag: Bool = false |
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
// | |
// ContentView.swift | |
// Shared | |
// | |
// Created by Peter Steinberger on 20.02.21. | |
// | |
import SwiftUI | |
struct SettingsGroup<Content: View>: View { |
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
//: A Cocoa based Playground to present user interface | |
import SwiftUI | |
struct ContentView: View { | |
var body: some View { | |
HStack { | |
Text("Highlight :") | |
.background(Color.green) | |
.frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .topTrailing) |
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
(use-package org | |
:hook ((org-mode . org-display-inline-images)) | |
:config | |
(use-package ob | |
:bind (:map org-mode-map | |
("C-c C-c" . org-ctrl-c-ctrl-c)) | |
:config | |
(use-package ob-swift |
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
// | |
// ContentView.swift | |
// FlowLayoutST | |
// | |
// Created by Chris Eidhof on 22.08.19. | |
// Copyright © 2019 Chris Eidhof. All rights reserved. | |
// | |
import SwiftUI | |
struct FlowLayout { |
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
// Eat/seek/peek | |
extension Collection where SubSequence == Self, Element: Equatable { | |
mutating func eat(_ element: Element) -> Bool { | |
guard let f = first, f == element else { return false } | |
eat() | |
return true | |
} | |
mutating func eat(asserting on: Element) -> Element { |
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 Foundation | |
struct Handler { | |
let handleJSON: (Data) throws -> Void | |
init<T: Decodable>(handler: @escaping (T) -> Void) { | |
handleJSON = { data in | |
let object = try JSONDecoder().decode(T.self, from: data) | |
handler(object) | |
} |
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
// Eat/seek/peek | |
extension Collection where SubSequence == Self, Element: Equatable { | |
mutating func eat() -> Element { | |
defer { self = self.dropFirst() } | |
return peek() | |
} | |
mutating func eat(_ n: Int) -> SubSequence { | |
let (pre, rest) = self.seek(n) | |
defer { self = rest } |
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
// ------------------------------------ | |
// Network | |
// ------------------------------------ | |
struct MeetupResponse { | |
var groupName: String = "" | |
var groupOrganizers: [String] = [] | |
var meetupTitle: String = "" | |
var meetupAttendes: Int = 0 |
NewerOlder