Skip to content

Commit

Permalink
Support extra data (#35)
Browse files Browse the repository at this point in the history
* SeatsioObject exposes extraData

* Added .build folder to .gitignore

* Fix build

* Fix build?

* Dropped CocoaPods suppor

* Support CocoaPods again

* Release CocoaPod again
  • Loading branch information
mroloux authored Jan 8, 2025
1 parent 8455017 commit 72aad72
Show file tree
Hide file tree
Showing 19 changed files with 50 additions and 863 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ jobs:

steps:
- uses: actions/checkout@v2
- run: swift build
- run: pod lib lint
3 changes: 1 addition & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,11 @@ jobs:
- uses: fregante/setup-git-user@v2
- name: Install dependencies
run: yarn add -D -E [email protected] [email protected]
- name: Run release script
- name: Run release script
run: yarn zx ./release.mjs -v $VERSION_TO_BUMP
env:
VERSION_TO_BUMP: ${{ inputs.versionToBump }}
GH_TOKEN: ${{ github.token }}
- run: pod lib lint
- run: pod trunk push
env:
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@
xcuserdata
Pods/
.DS_Store
.swiftpm/
.build/
42 changes: 0 additions & 42 deletions Example/AppDelegate.swift

This file was deleted.

98 changes: 0 additions & 98 deletions Example/Assets.xcassets/AppIcon.appiconset/Contents.json

This file was deleted.

6 changes: 0 additions & 6 deletions Example/Assets.xcassets/Contents.json

This file was deleted.

24 changes: 0 additions & 24 deletions Example/Base.lproj/Main.storyboard

This file was deleted.

48 changes: 0 additions & 48 deletions Example/Info.plist

This file was deleted.

48 changes: 0 additions & 48 deletions Example/SeatingChartSample.swift

This file was deleted.

14 changes: 14 additions & 0 deletions Package.resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"pins" : [
{
"identity" : "swiftyjson",
"kind" : "remoteSourceControl",
"location" : "https://github.com/SwiftyJSON/SwiftyJSON.git",
"state" : {
"revision" : "af76cf3ef710b6ca5f8c05f3a31307d44a3c5828",
"version" : "5.0.2"
}
}
],
"version" : 2
}
10 changes: 8 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,18 @@ let package = Package(
.library(
name: "Seatsio",
targets: ["Seatsio"]
),
)
],
dependencies: [
.package(url: "https://github.com/SwiftyJSON/SwiftyJSON.git", from: "5.0.2"),
],
targets: [
.target(
name: "Seatsio",
dependencies: [
.product(name: "SwiftyJSON", package: "SwiftyJSON")
],
path: "Seatsio/Sources"
),
)
]
)
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@ Add this to your podfile:
pod 'seatsio', '18.0.0'
```

Or if you prefer Swift Package Manager:

```
dependencies: [
.package(url: "https://github.com/seatsio/seatsio-ios", from: "18.0.0")
]
```

## Usage

```swift
Expand Down
1 change: 0 additions & 1 deletion Seatsio/Sources/JustBridge.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
// Copyright (c) 2018 Xiaoye220 <[email protected]>
//

import UIKit
import WebKit

public class JustBridge: NSObject {
Expand Down
5 changes: 4 additions & 1 deletion Seatsio/Sources/SeatsioObject.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import Foundation
import SwiftyJSON

public struct SeatsioObject: Decodable {
public let objectType: String
Expand All @@ -21,6 +22,7 @@ public struct SeatsioObject: Decodable {
public let disabledBySocialDistancingRules: Bool?
public let parent: SeatParent?
public let displayObjectType: String?
public let extraData: JSON?

public let capacity: Int?
public let numBooked: Int?
Expand All @@ -36,7 +38,7 @@ public struct SeatsioObject: Decodable {

public init(objectType: String, label: String, labels: Labels, id: String, category: Category? = nil, center: Point? = nil, pricing: Pricing? = nil, status: String? = nil, forSale: Bool? = nil,
selectable: Bool? = nil, inSelectableChannel: Bool? = nil, selected: Bool? = nil, selectedTicketType: String? = nil, accessible: Bool? = nil, companionSeat: Bool? = nil, restrictedView: Bool? = nil,
disabledBySocialDistancingRules: Bool? = nil, parent: SeatParent?, displayObjectType: String?, capacity: Int? = nil, numBooked: Int? = nil, numFree: Int? = nil, numSelected: Int? = nil, selectionPerTicketType: [String: Int]? = nil,
disabledBySocialDistancingRules: Bool? = nil, parent: SeatParent?, displayObjectType: String?, extraData: JSON?, capacity: Int? = nil, numBooked: Int? = nil, numFree: Int? = nil, numSelected: Int? = nil, selectionPerTicketType: [String: Int]? = nil,
sectionCategory: Category? = nil, numberOfSelectableObjects: Int? = nil, numberOfSelectedObjects: Int? = nil, selectableCategories: [Category]? = nil, isInteractive: Bool? = nil) {
self.objectType = objectType
self.label = label
Expand All @@ -58,6 +60,7 @@ public struct SeatsioObject: Decodable {
self.disabledBySocialDistancingRules = disabledBySocialDistancingRules
self.parent = parent
self.displayObjectType = displayObjectType
self.extraData = extraData

self.capacity = capacity
self.numBooked = numBooked
Expand Down
Loading

0 comments on commit 72aad72

Please sign in to comment.