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 | |
public extension ScrollView { | |
// NB: CaptureScrollingOffset.EnvironmentKey is a class, so the value can be "shared" between Views, | |
// allowing both GeometryReader and Environment to participate in the same view. | |
func trackScrolling() -> some View { | |
let coordinateSpace = UUID() | |
let environmentKey = CaptureScrollingOffset.EnvironmentKey(coordinateSpace: coordinateSpace) |
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
/* | |
Creates an array of C-strings that can be passed to C functions and automatically deallocated | |
Copyright 2020 Robert Salesas | |
*/ | |
public struct CStringArray { | |
public let pointer: UnsafeMutablePointer<UnsafeMutablePointer<CChar>?> | |
public let count: Int | |
private var data: Data |