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 scripting additions | |
set desktopPath to (path to desktop as text) | |
set folderPath to desktopPath & "exports" | |
set exportFolder to "" | |
tell application "Finder" | |
if (exists folder folderPath) is false then | |
make new folder at desktopPath with properties {name:"exports"} | |
end if |
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 { | |
var body: some View { | |
List { | |
ScrollySection(sectionName: "Section 1") | |
ScrollySection(sectionName: "Section 2") | |
ScrollySection(sectionName: "Section 3") | |
} |
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 Combine | |
extension Publisher { | |
/// A single value sink function that coalesces either one `Output` or one `Failure` as a `Result`-type. | |
public func sink(result: @escaping ((Result<Self.Output, Self.Failure>) -> Void)) -> AnyCancellable { | |
return sink(receiveCompletion: { completion in | |
switch completion { | |
case .failure(let error): | |
result(.failure(error)) |