Skip to content

Commit

Permalink
Tweaks (#20)
Browse files Browse the repository at this point in the history
* Make a few more things public

* SPM update, align platform requirement with GeoJSONKit-Turf, VisionOS support

* Also test Swift 5.9.1

And update to latest checkout action
  • Loading branch information
nighthawk authored Nov 22, 2023
1 parent 9b2ac0e commit 81395c8
Show file tree
Hide file tree
Showing 7 changed files with 51 additions and 40 deletions.
61 changes: 32 additions & 29 deletions .github/workflows/swift.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,59 +2,62 @@ name: Swift

on:
push:
branches: [ main ]
branches: [main]
pull_request:
branches: [ main ]
branches: [main]

jobs:
spm_macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- name: Build
run: swift build
- name: Test
run: swift test
- uses: actions/checkout@v4
- name: Build
run: swift build
- name: Test
run: swift test

spm_linux:
runs-on: ubuntu-latest
strategy:
matrix:
swift: ["5.9.1", "5.7.3"]
container:
image: swift:5.7
image: swift:${{ matrix.swift }}
steps:
- uses: actions/checkout@v3
- name: Build
run: swift build
- name: Test
run: swift test
- uses: actions/checkout@v4
- name: Build
run: swift build
- name: Test
run: swift test

xcode_macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- name: Build
run: xcodebuild build -scheme GeoProjector-Package -destination 'platform=macOS'
- uses: actions/checkout@v4
- name: Build
run: xcodebuild build -scheme GeoProjector-Package -destination 'platform=macOS'

xcode_ios:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- name: Build
run: xcodebuild build -scheme GeoProjector-Package -destination 'name=iPhone 14' -sdk iphoneos
- uses: actions/checkout@v4
- name: Build
run: xcodebuild build -scheme GeoProjector-Package -destination 'name=iPhone 14' -sdk iphoneos

cassini_macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- name: Build
run: |
cd Examples
xcodebuild build -scheme 'Cassini' -destination 'platform=macOS'
- uses: actions/checkout@v4
- name: Build
run: |
cd Examples
xcodebuild build -scheme 'Cassini' -destination 'platform=macOS'
cassini_ios:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- name: Build
run: |
cd Examples
xcodebuild build -scheme 'Cassini' -destination 'name=iPhone 14' -sdk iphoneos
- uses: actions/checkout@v4
- name: Build
run: |
cd Examples
xcodebuild build -scheme 'Cassini' -destination 'name=iPhone 14' -sdk iphoneos
8 changes: 4 additions & 4 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/maparoni/geojsonkit-turf",
"state" : {
"revision" : "7e5d8bad4bc842e27caacf0a89223c7e047fbe64",
"version" : "0.1.4"
"revision" : "21452ac7ee183930325e786575d552129c21b165",
"version" : "0.2.0"
}
},
{
"identity" : "swift-argument-parser",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-argument-parser",
"state" : {
"revision" : "fddd1c00396eed152c45a46bea9f47b98e59301d",
"version" : "1.2.0"
"revision" : "8f4d2753f0e4778c76d5f05ad16c74f707390531",
"version" : "1.2.3"
}
}
],
Expand Down
4 changes: 4 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ import PackageDescription

let package = Package(
name: "GeoProjector",
platforms: [
.macOS(.v12), .iOS(.v15), .watchOS(.v8), .tvOS(.v15),
.custom("xros", versionString: "1.0")
],
products: [
.library(
name: "GeoProjector",
Expand Down
10 changes: 7 additions & 3 deletions Sources/GeoDrawer/GeoDrawer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -128,17 +128,21 @@ public struct GeoDrawer {
self.converter = { (converter($0), false) }
}

let projection: Projection?
public let projection: Projection?

let size: Size
public let size: Size

let zoomTo: Rect?

let insets: EdgeInsets
public let insets: EdgeInsets

var invertCheck: ((GeoJSON.Polygon) -> Bool)? { projection?.invertCheck }

let converter: (GeoJSON.Position) -> (Point, Bool)?

public func point(for position: GeoJSON.Position) -> Point? {
converter(position)?.0
}
}

// MARK: - Content
Expand Down
2 changes: 1 addition & 1 deletion Sources/GeoDrawer/GeoJSON+Continents.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import UIKit
#endif

extension GeoJSON.GeometryObject {
public var geometries: [GeoJSON.Geometry] {
var geometries: [GeoJSON.Geometry] {
switch self {
case .single(let geo): return [geo]
case .multi(let geos): return geos
Expand Down
2 changes: 1 addition & 1 deletion Sources/GeoDrawer/GeoMap+AppKit.swift
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ public struct GeoMap: NSViewRepresentable {
}

#if DEBUG
@available(iOS 13.0, macOS 11.0, *)
@available(iOS 13.0, visionOS 1.0, macOS 11.0, *)
struct GeoMap_Previews: PreviewProvider {
static var previews: some View {
GeoMap(
Expand Down
4 changes: 2 additions & 2 deletions Sources/GeoDrawer/GeoMap+UIKit.swift
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public class GeoMapView: UIView {
}
}

@available(iOS 13.0, *)
@available(iOS 13.0, visionOS 1.0, *)
public struct GeoMap: UIViewRepresentable {

public init(contents: [GeoDrawer.Content] = [], projection: Projection = Projections.Equirectangular(), zoomTo: GeoJSON.BoundingBox? = nil, insets: GeoProjector.EdgeInsets = .zero, mapBackground: UIColor? = nil, mapOutline: UIColor? = nil) {
Expand Down Expand Up @@ -167,7 +167,7 @@ public struct GeoMap: UIViewRepresentable {
}

#if DEBUG
@available(iOS 13.0, macOS 11.0, *)
@available(iOS 13.0, visionOS 1.0, macOS 11.0, *)
struct GeoMap_Previews: PreviewProvider {
static var previews: some View {
GeoMap(
Expand Down

0 comments on commit 81395c8

Please sign in to comment.