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
public extension MKMultiPoint { | |
var coordinates: [CLLocationCoordinate2D] { | |
var coords = [CLLocationCoordinate2D](repeating: kCLLocationCoordinate2DInvalid, | |
count: pointCount) | |
getCoordinates(&coords, range: NSRange(location: 0, length: pointCount)) | |
return coords | |
} | |
} |
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
extension Array where Element: Identifiable { | |
public subscript(id: Element.ID) -> Element? { | |
first { $0.id == id } | |
} | |
} | |
// let arrayOfIdentifiables = [] | |
// let itemWithId = arrayOfIdentifiables[id] |
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 { | |
public func interactiveDismissDisabled(_ isDisabled: Bool = true, onAttemptToDismiss: (() -> Void)? = nil) -> some View { | |
InteractiveDismissableView(view: self, isDisabled: isDisabled, onAttemptToDismiss: onAttemptToDismiss) | |
} | |
public func interactiveDismissDisabled(_ isDisabled: Bool = true, attemptToDismiss: Binding<Bool>) -> some View { | |
InteractiveDismissableView(view: self, isDisabled: isDisabled) { | |
attemptToDismiss.wrappedValue.toggle() |