Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix using TripKitUI via SPM #346

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/swift.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:

jobs:
build_spm:
runs-on: macos-13
runs-on: macos-14

steps:
- uses: maxim-lobanov/setup-xcode@v1
Expand All @@ -18,13 +18,13 @@ jobs:
- name: Build
run: swift build --target TripKit

build_spm_monterey:
runs-on: macos-12
build_spm_macos13:
runs-on: macos-13

steps:
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: 14.2
xcode-version: 15
- uses: actions/checkout@v4
- name: Build
run: swift build --target TripKit
Expand Down
8 changes: 4 additions & 4 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
"repositoryURL": "https://github.com/onevcat/Kingfisher.git",
"state": {
"branch": null,
"revision": "c1f60c63f356d364f4284ba82961acbe7de79bcc",
"version": "7.8.1"
"revision": "5b92f029fab2cce44386d28588098b5be0824ef5",
"version": "7.11.0"
}
},
{
Expand All @@ -33,8 +33,8 @@
"repositoryURL": "https://github.com/skedgo/TGCardViewController.git",
"state": {
"branch": null,
"revision": "b96668ef9bd28972f75ff9087b822fad8fb0ad84",
"version": "2.2.10"
"revision": "7b1350d669c6870d7b5cfbcd201d69def3c246d4",
"version": "2.2.12"
}
}
]
Expand Down
27 changes: 16 additions & 11 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version:5.3
// swift-tools-version:5.9
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription
Expand All @@ -7,17 +7,16 @@ let package = Package(
name: "TripKit",
defaultLocalization: "en",
platforms: [
.iOS(.v13),
.iOS(.v15),
.macOS(.v11),
],
products: [
.library(
name: "TripKit",
targets: ["TripKit"]
),
.library(
name: "TripKitUI",
targets: ["TripKitUI"]),
.library(name: "TripKit", targets: ["TripKit"]),
.library(name: "TripKitUI", targets: ["TripKitUI"]),
.library(name: "TripKitInterApp", targets: ["TripKitInterApp"]),
.library(name: "TripKit-Dynamic", type: .dynamic, targets: ["TripKit"]),
.library(name: "TripKitUI-Dynamic", type: .dynamic, targets: ["TripKitUI"]),
.library(name: "TripKitInterApp-Dynamic", type: .dynamic, targets: ["TripKitInterApp"]),
],
dependencies: [
.package(url: "https://github.com/ReactiveX/RxSwift.git", .upToNextMajor(from: "6.1.0")),
Expand All @@ -34,14 +33,21 @@ let package = Package(
.target(
name: "TripKitUI",
dependencies: [
.target(name: "TripKit"),
"TripKit",
"Kingfisher",
.product(name: "RxCocoa", package: "RxSwift"),
"TGCardViewController",
"GeoMonitor",
],
exclude: ["Supporting Files/Info.plist", "vendor/RxCombine/LICENSE"]
),
.target(
name: "TripKitInterApp",
dependencies: [
"TripKit",
],
exclude: ["Supporting Files/Info.plist"]
),
.testTarget(
name: "TripKitTests",
dependencies: [
Expand All @@ -50,7 +56,6 @@ let package = Package(
],
exclude: [
"Data",
"polygon/data",
"Supporting Files/Info.plist",
]
),
Expand Down
4 changes: 4 additions & 0 deletions Sources/TripKitUI/TripKitUIBundle.swift
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,11 @@ class TripKitUIBundle: NSObject {
}

fileprivate static func bundle() -> Bundle {
#if SWIFT_PACKAGE
return Bundle.module
#else
return Bundle(for: self)
#endif
}

}
Expand Down
2 changes: 1 addition & 1 deletion Sources/TripKitUI/controller/TKUIAlertViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public class TKUIAlertViewController: UITableViewController {

tableView.rowHeight = UITableView.automaticDimension
tableView.estimatedRowHeight = 150
tableView.register(UINib(nibName: "TKUIAlertCell", bundle: Bundle(for: TKUIAlertCell.self)), forCellReuseIdentifier: "TKUIAlertCell")
tableView.register(UINib(nibName: "TKUIAlertCell", bundle: .tripKitUI), forCellReuseIdentifier: "TKUIAlertCell")
tableView.backgroundColor = .tkBackgroundGrouped
tableView.separatorStyle = .none
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="TKUIAttributionTableViewController" customModule="TripGoAppKit" customModuleProvider="target">
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="TKUIAttributionTableViewController" customModule="TripGoAppKit">
<connections>
<outlet property="view" destination="i5M-Pr-FkT" id="NJI-Xf-1l5"/>
</connections>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public class TKUISectionedAlertViewController: UIViewController {
// MARK: - Constructor

public static func newInstance(region: TKRegion) -> TKUISectionedAlertViewController {
let controller = TKUISectionedAlertViewController(nibName: "TKUISectionedAlertViewController", bundle: Bundle(for: self))
let controller = TKUISectionedAlertViewController(nibName: "TKUISectionedAlertViewController", bundle: .tripKitUI)
controller.region = region
return controller
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="TKUISectionedAlertViewController" customModule="TripKitUI" customModuleProvider="target">
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="TKUISectionedAlertViewController" customModule="TripKitUI">
<connections>
<outlet property="searchBar" destination="QcU-yO-3Wu" id="wCd-hn-t5M"/>
<outlet property="tableView" destination="M79-lI-HaZ" id="00q-mE-2fP"/>
Expand Down
12 changes: 6 additions & 6 deletions Sources/TripKitUI/views/TKUIDepartureCell.xib
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="TKUIDepartureCell" rowHeight="96" id="KGk-i7-Jjw" customClass="TKUIDepartureCell" customModule="TripKitUI" customModuleProvider="target">
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="TKUIDepartureCell" rowHeight="96" id="KGk-i7-Jjw" customClass="TKUIDepartureCell" customModule="TripKitUI">
<rect key="frame" x="0.0" y="0.0" width="435" height="96"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM">
Expand All @@ -33,7 +33,7 @@
<view contentMode="scaleToFill" horizontalHuggingPriority="253" verticalHuggingPriority="253" translatesAutoresizingMaskIntoConstraints="NO" id="wWl-tx-YGV">
<rect key="frame" x="24" y="0.0" width="50" height="24"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="E84" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="uZ8-Tg-CEt" customClass="TKUIStyledLabel" customModule="TripKitUI" customModuleProvider="target">
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="E84" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="uZ8-Tg-CEt" customClass="TKUIStyledLabel" customModule="TripKitUI">
<rect key="frame" x="4" y="0.0" width="42" height="24"/>
<fontDescription key="fontDescription" style="UICTFontTextStyleFootnote"/>
<color key="textColor" systemColor="lightTextColor"/>
Expand Down Expand Up @@ -67,7 +67,7 @@
<stackView opaque="NO" contentMode="scaleToFill" alignment="center" spacing="4" translatesAutoresizingMaskIntoConstraints="NO" id="YdC-yY-o8m">
<rect key="frame" x="0.0" y="26" width="145.5" height="20"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="249" verticalCompressionResistancePriority="751" text="On time · 3:35pm" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="NG5-pD-VCL" customClass="TKUIStyledLabel" customModule="TripKitUI" customModuleProvider="target">
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="249" verticalCompressionResistancePriority="751" text="On time · 3:35pm" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="NG5-pD-VCL" customClass="TKUIStyledLabel" customModule="TripKitUI">
<rect key="frame" x="0.0" y="2" width="105.5" height="16"/>
<fontDescription key="fontDescription" style="UICTFontTextStyleFootnote"/>
<color key="textColor" systemColor="darkTextColor"/>
Expand All @@ -89,7 +89,7 @@
</imageView>
</subviews>
</stackView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" verticalCompressionResistancePriority="751" text="Stand C · Mona Vale Junction" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="yLh-U7-4mz" customClass="TKUIStyledLabel" customModule="TripKitUI" customModuleProvider="target">
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" verticalCompressionResistancePriority="751" text="Stand C · Mona Vale Junction" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="yLh-U7-4mz" customClass="TKUIStyledLabel" customModule="TripKitUI">
<rect key="frame" x="0.0" y="48" width="178" height="16"/>
<fontDescription key="fontDescription" style="UICTFontTextStyleFootnote"/>
<color key="textColor" systemColor="darkTextColor"/>
Expand All @@ -100,13 +100,13 @@
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" alignment="center" translatesAutoresizingMaskIntoConstraints="NO" id="iaM-1r-elk">
<rect key="frame" x="375" y="30" width="40" height="36.5"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="252" verticalHuggingPriority="251" horizontalCompressionResistancePriority="751" text="Now" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Yhb-5V-Syb" customClass="TKUIStyledLabel" customModule="TripKitUI" customModuleProvider="target">
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="252" verticalHuggingPriority="251" horizontalCompressionResistancePriority="751" text="Now" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Yhb-5V-Syb" customClass="TKUIStyledLabel" customModule="TripKitUI">
<rect key="frame" x="3" y="0.0" width="34.5" height="20.5"/>
<fontDescription key="fontDescription" style="UICTFontTextStyleBody"/>
<color key="textColor" systemColor="darkTextColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="WIX-KC-bMq" customClass="TKUIStyledLabel" customModule="TripKitUI" customModuleProvider="target">
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="WIX-KC-bMq" customClass="TKUIStyledLabel" customModule="TripKitUI">
<rect key="frame" x="3.5" y="20.5" width="33" height="16"/>
<fontDescription key="fontDescription" style="UICTFontTextStyleFootnote"/>
<color key="textColor" systemColor="darkTextColor"/>
Expand Down
6 changes: 3 additions & 3 deletions Sources/TripKitUI/views/TKUIHomeCustomizerCell.xib
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="17701" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="32700.99.1234" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="17703"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22684"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="TKUIHomeCustomizerCell" id="KGk-i7-Jjw" customClass="TKUIHomeCustomizerCell" customModule="TripKitUI" customModuleProvider="target">
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="TKUIHomeCustomizerCell" id="KGk-i7-Jjw" customClass="TKUIHomeCustomizerCell" customModule="TripKitUI">
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<tableViewCellContentView key="contentView" opaque="NO" multipleTouchEnabled="YES" contentMode="center" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM">
Expand Down
6 changes: 3 additions & 3 deletions Sources/TripKitUI/views/TKUIModePickerCell.xib
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="19455" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="32700.99.1234" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="19454"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22684"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="System colors in document resources" minToolsVersion="11.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<collectionViewCell opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" reuseIdentifier="TKUIModePickerCell" id="gTV-IL-0wX" customClass="TKUIModePickerCell" customModule="TripKitUI" customModuleProvider="target">
<collectionViewCell opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" reuseIdentifier="TKUIModePickerCell" id="gTV-IL-0wX" customClass="TKUIModePickerCell" customModule="TripKitUI">
<rect key="frame" x="0.0" y="0.0" width="80" height="40"/>
<autoresizingMask key="autoresizingMask"/>
<view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center">
Expand Down
2 changes: 1 addition & 1 deletion Sources/TripKitUI/views/TKUINearbyCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public class TKUINearbyCell: UITableViewCell {
}

public static var nib: UINib {
return UINib(nibName: "TKUINearbyCell", bundle: Bundle(for: TKUINearbyCell.self))
return UINib(nibName: "TKUINearbyCell", bundle: .tripKitUI)
}

public override func awakeFromNib() {
Expand Down
Loading
Loading