View BottomSheet.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 | |
// Shared | |
// | |
// Created by Chris Eidhof on 05.05.22. | |
// | |
import SwiftUI | |
struct ContentView: View { |
View Jump.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 | |
// Shared | |
// | |
// Created by Chris Eidhof on 16.04.22. | |
// | |
import SwiftUI | |
struct Jump: AnimatableModifier { |
View BrokenAsyncImage.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
import SwiftUI | |
let url = URL(string: "https://www.objc.io/images/books/thinking-in-swiftui/thinking-in-swiftui-hero-original_216a663.png")! | |
struct ContentView: View { | |
var image: some View { | |
AsyncImage(url: url, content: { image in | |
image | |
.resizable() | |
.aspectRatio( contentMode: .fit) |
View AsyncZipped.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
/* | |
Make sure to compile this with the following flags: | |
-Xfrontend -warn-concurrency -Xfrontend -enable-actor-data-race-checks | |
*/ | |
extension AsyncIteratorProtocol { | |
func newAndNext() async throws -> (Self, Element)? { |
View gist.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
struct AsyncZippedSequence<L, R>: AsyncSequence where L: AsyncSequence, R: AsyncSequence { | |
typealias Element = (L.Element, R.Element) | |
var l: L | |
var r: R | |
func makeAsyncIterator() -> AsyncZippedIterator<L.Element, R.Element> { | |
AsyncZippedIterator(l, r) | |
} | |
} |
View is_this_a_bug.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
import SwiftUI | |
struct ContentView: View { | |
@State var cond = false | |
var body: some View { | |
ZStack { | |
Color.blue | |
Test(cond: cond).onTapGesture { | |
withAnimation(.easeInOut(duration: 2)) { | |
cond.toggle() |
View SwiftUI-pipe.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
import SwiftUI | |
extension View { | |
func pipe<R>(@ViewBuilder _ f: (Self) -> R) -> R { | |
f(self) | |
} | |
} | |
struct ContentView: View { | |
@State var flag: Bool = false |
View Package.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
// swift-tools-version:5.3 | |
// The swift-tools-version declares the minimum version of Swift required to build this package. | |
import PackageDescription | |
let package = Package( | |
name: "TomlToYaml", | |
products: [ | |
// Products define the executables and libraries a package produces, and make them visible to other packages. | |
.executable( |
NewerOlder