Skip to content

Instantly share code, notes, and snippets.

View berkayoruc's full-sized avatar
🎯
Focusing

Berkay Oruç berkayoruc

🎯
Focusing
View GitHub Profile
@nixta
nixta / AGSGeometry+DecodeCompressedGeometry.swift
Last active December 9, 2022 18:06
Read polyline from ArcGIS Route Service compressed geometry.
extension AGSGeometry {
static func decodeCompressedGeometry(_ compressedString: String, spatialReference sr: AGSSpatialReference) -> AGSPolyline? {
// Break the string up into signed parts.
// The first part is a coefficient.
// Subsequent pairs of parts make up the remaining coordinates, encoded.
let pattern = #"((\+|\-)[^\+\-]+)"#
guard let regex = try? NSRegularExpression(pattern: pattern, options: []) else {
return nil
}
class PaymentViewModel : ObservableObject{
@Published var isLoadingRetrieveProducts = false
@Published var yearlySubscriptionPrice = ""
@Published var monthlySubscriptionPrice = ""
@Published var lifetimeSubscriptionPrice = ""
@Published var isLoadingPayment = false
@Published var showAlert = false