diff --git a/.github/workflows/beta-release.yml b/.github/workflows/beta-release.yml deleted file mode 100644 index 99031e6d..00000000 --- a/.github/workflows/beta-release.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: Public Beta Release - -on: - push: - tags: '*.*.*-beta.*' - - -jobs: - deploy_public_beta_pod: - runs-on: macOS-latest - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - token: ${{ secrets.PAT_ACTIONS }} - - - name: Get Previous tag - id: previoustag - uses: WyriHaximus/github-action-get-previous-tag@v1 - with: - fallback: 1.0.0 - - - - name: Deploy to Cocoapods - run: | - set -eo pipefail - pod lib lint Skyflow.podspec --allow-warnings - pod lib lint SkyflowFlowVault.podspec --allow-warnings - pod trunk push Skyflow.podspec --allow-warnings - pod trunk push SkyflowFlowVault.podspec --allow-warnings - env: - COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }} diff --git a/.github/workflows/bump_version.yml b/.github/workflows/bump_version.yml index 73e48e9c..a1e57d29 100644 --- a/.github/workflows/bump_version.yml +++ b/.github/workflows/bump_version.yml @@ -6,7 +6,6 @@ on: tags-ignore: - '*' paths-ignore: - - 'Skyflow.podspec' - '*.md' - 'SkyflowCore/Sources/Version.swift' branches: @@ -41,7 +40,6 @@ jobs: run: | git config user.name ${{ github.actor }} git config user.email ${{ github.actor }}@users.noreply.github.com - git add Skyflow.podspec SkyflowFlowVault.podspec git add SkyflowCore/Sources/Version.swift git commit -m "[AUTOMATED] Public Release ${{ steps.version.outputs.version }}" git push origin \ No newline at end of file diff --git a/.github/workflows/internal_release.yml b/.github/workflows/internal_release.yml deleted file mode 100644 index 25c168f5..00000000 --- a/.github/workflows/internal_release.yml +++ /dev/null @@ -1,58 +0,0 @@ - -name: Internal Release - -on: - push: - tags-ignore: - - '*' - paths-ignore: - - 'Skyflow.podspec' - - 'SkyflowFlowVault.podspec' - - '*.md' - - 'SkyflowCore/Sources/Version.swift' - branches: - - release/* - -jobs: - deploy_private_pod: - runs-on: macOS-latest - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - token: ${{ secrets.PAT_ACTIONS }} - - - name: Get Previous tag - id: previoustag - uses: WyriHaximus/github-action-get-previous-tag@v1 - with: - fallback: 1.0.0 - - - name: Bump Version - run: | - chmod +x ./scripts/bump_version.sh - ./scripts/bump_version.sh "${{ steps.previoustag.outputs.tag }}" "$(git rev-parse --short "$GITHUB_SHA")" - - - name: Commit changes - run: | - git config user.name ${{ github.actor }} - git config user.email ${{ github.actor }}@users.noreply.github.com - git add Skyflow.podspec SkyflowFlowVault.podspec - git add SkyflowCore/Sources/Version.swift - git commit -m "[AUTOMATED] Private Release ${{ steps.previoustag.outputs.tag }}.$(git rev-parse --short $GITHUB_SHA)" - git push origin - - - - - name: Add SSH key to Agent - uses: webfactory/ssh-agent@v0.5.3 - with: - ssh-private-key: ${{ secrets.SSH_ACTIONS }} - - - - name: Push updated spec file - run: | - pod repo add private_spec git@github.com:skyflowapi/skyflow-iOS-private-spec.git - pod repo push private_spec ./Skyflow.podspec --allow-warnings - pod repo push private_spec ./SkyflowFlowVault.podspec --allow-warnings - echo "Published as Private pod" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index f931eda3..00000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: Public Release - -on: - push: - tags: - - '*.*.*' - - -jobs: - deploy_private_pod: - runs-on: macOS-latest - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - ref: main - token: ${{ secrets.PAT_ACTIONS }} - - - name: Get Previous tag - id: previoustag - uses: WyriHaximus/github-action-get-previous-tag@v1 - with: - fallback: 1.0.0 - - - - name: Deploy to Cocoapods - run: | - set -eo pipefail - pod lib lint Skyflow.podspec --allow-warnings - pod lib lint SkyflowFlowVault.podspec --allow-warnings - pod trunk push Skyflow.podspec --allow-warnings - pod trunk push SkyflowFlowVault.podspec --allow-warnings - env: - COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }} diff --git a/.swiftlint.yml b/.swiftlint.yml index 1be172ce..f7c9f4e7 100644 --- a/.swiftlint.yml +++ b/.swiftlint.yml @@ -16,7 +16,6 @@ excluded: # paths to ignore during linting. Takes precedence over `included`. - .github - .swiftpm - Package.swift - - Skyflow.podspec - Tests # configurable rules can be customized from this configuration file @@ -51,7 +50,6 @@ reporter: "xcode" excluded: - ${PWD}/Samples - - ${PWD}/Pods - ${PWD}/DerivedData disabled_rules: diff --git a/MIGRATING_TO_SPM.md b/MIGRATING_TO_SPM.md new file mode 100644 index 00000000..5a845691 --- /dev/null +++ b/MIGRATING_TO_SPM.md @@ -0,0 +1,133 @@ +# Migrating from CocoaPods to Swift Package Manager + +CocoaPods trunk became read-only on **December 2, 2026**. Versions already published there keep installing, but new versions of `Skyflow` and `SkyflowFlowVault` are released only through **Swift Package Manager (SPM)**. + +To keep receiving updates and fixes, move your app from CocoaPods to SPM. The SDK API does not change: your `import` statements and code stay the same, including qualified names such as `Skyflow.Styles` or `SkyflowFlowVault.Configuration`. + +| | CocoaPods (frozen) | SPM | +|---|---|---| +| Last / current version | 1.26.0 | 1.26.0 and later | +| Package URL | — | `https://github.com/skyflowapi/skyflow-iOS.git` | +| PDB vault SDK | `pod 'Skyflow'` | product `Skyflow` | +| Flow vault SDK | `pod 'SkyflowFlowVault'` | product `SkyflowFlowVault` (1.26.0 or later) | +| Import | `import Skyflow` / `import SkyflowFlowVault` | unchanged | +| Minimum iOS | 13.0 | 13.0 | + +## Before you start + +- Use **Xcode 15 or later**. The package requires the Swift 5.9 toolchain. +- Note the version in your `Podfile.lock`, for example `Skyflow (1.25.1)`. Start SPM on the same version so the migration changes only how the SDK is installed. Upgrade the SDK separately afterwards. +- Commit or stash your work so you can easily compare and roll back. + +## Step 1: Remove the pod + +1. In your `Podfile`, delete the Skyflow line: + ```diff + target 'YourApp' do + - pod 'Skyflow', '1.25.1' + pod 'SomeOtherPod' + end + ``` +2. Run: + ```sh + pod install + ``` + +**If Skyflow was your only pod**, remove CocoaPods from the project entirely: +```sh +pod deintegrate # from the cocoapods-deintegrate plugin, bundled with CocoaPods +rm -rf Podfile Podfile.lock Pods YourApp.xcworkspace +``` +From now on, open `YourApp.xcodeproj` instead of the `.xcworkspace`. + +**If you use other pods**, keep using the `.xcworkspace`. CocoaPods and SPM can be used in the same project. + +## Step 2: Add the Swift package + +### Xcode project + +1. Open the project and choose **File → Add Package Dependencies…** +2. Enter `https://github.com/skyflowapi/skyflow-iOS.git`. +3. Set **Dependency Rule** to one of: + - **Exact Version** with your current version, e.g. `1.25.1`. Recommended for the migration itself. + - **Up to Next Major Version** starting from your current version, to receive minor and patch updates automatically. +4. Click **Add Package**. +5. In **Choose Package Products**, select only the product you were using and add it to your app target: + - `Skyflow` if you had `pod 'Skyflow'` + - `SkyflowFlowVault` if you had `pod 'SkyflowFlowVault'`. This product is available from **1.26.0**. The package manifest of earlier versions exports only `Skyflow`, so the version in your dependency rule must be 1.26.0 or later. + + Do not add `SkyflowCore`. It is an internal module that both products already include. + +### Swift package (`Package.swift`) + +```swift +// swift-tools-version:5.9 +import PackageDescription + +let package = Package( + name: "YourPackage", + platforms: [.iOS(.v13)], + dependencies: [ + .package(url: "https://github.com/skyflowapi/skyflow-iOS.git", exact: "1.26.0") + ], + targets: [ + .target( + name: "YourPackage", + dependencies: [ + .product(name: "Skyflow", package: "skyflow-iOS") + // or: .product(name: "SkyflowFlowVault", package: "skyflow-iOS") + // (requires 1.26.0 or later) + ] + ) + ] +) +``` + +## Step 3: Build and verify + +1. Clean the build folder (**Product → Clean Build Folder**, ⇧⌘K) and build. +2. Run the app and check the screens that use Skyflow elements: + - Collect and reveal elements render and submit as before. + - The card-brand icon and the copy / success icons appear. These images are loaded from the package's resource bundle. +3. Commit `Package.resolved`. It is located at `YourApp.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved`, or inside the `.xcworkspace` if you still use CocoaPods. It pins the exact SDK commit so that every machine and CI builds the same version. + +## Step 4: Update CI + +- Remove the `pod install` step if Skyflow was your only pod. +- Resolve packages before building, so that network problems fail early and clearly: + ```sh + xcodebuild -resolvePackageDependencies -project YourApp.xcodeproj -scheme YourApp + ``` +- To cache packages between CI runs, cache the directory you pass to `-clonedSourcePackagesDirPath`. + +## Upgrading after the migration + +- **Xcode:** right-click the package in the Project navigator → **Update Package**, or change the dependency rule in **Project → Package Dependencies**. +- **`Package.swift`:** change the version, then run `swift package update`. +- **Beta versions** (`X.Y.Z-beta.N`) are never selected by a version range. Use **Exact Version**, e.g. `exact: "1.27.0-beta.1"`. + +Release notes for every version are on the [GitHub Releases page](https://github.com/skyflowapi/skyflow-iOS/releases). + +## Troubleshooting + +**`No such module 'Skyflow'` (or `'SkyflowFlowVault'`)** +The product is not linked to the target that imports it. In the target's **General → Frameworks, Libraries, and Embedded Content**, click **+** and add the product. For a `Package.swift`, add the `.product(...)` entry to that target's `dependencies`. + +**`product 'SkyflowFlowVault' required by package '…' target '…' not found in package 'skyflow-iOS'`** +The dependency rule resolves to a version earlier than 1.26.0, whose package manifest exports only `Skyflow`. Set the version to 1.26.0 or later. + +**Duplicate symbol, or "ambiguous" type errors** +The SDK is installed through both CocoaPods and SPM. Make sure the pod is removed from the `Podfile`, run `pod install`, then clean the build folder. + +**Card-brand or copy icons are missing** +Make sure no leftover CocoaPods build products remain: run `pod deintegrate` (or `pod install` after removing the pod), delete DerivedData, and rebuild. Under SPM, the SDK loads its images from its own package resource bundle. Nothing needs to be added to your app's assets. + +**`Package resolution failed` / cannot fetch the package** +Check that the URL is exactly `https://github.com/skyflowapi/skyflow-iOS.git` and that the version you entered exists as a [release tag](https://github.com/skyflowapi/skyflow-iOS/tags). Version tags have no `v` prefix (`1.26.0`, not `v1.26.0`). If you are behind a proxy, make sure Xcode can reach `github.com`. + +**I need to stay on CocoaPods for now** +Versions already on trunk (up to 1.26.0) remain installable with `pod 'Skyflow'` or `pod 'SkyflowFlowVault'`, but you will not receive any later releases, including security fixes. Plan your migration to SPM. + +## Need help? + +Open an issue at [github.com/skyflowapi/skyflow-iOS/issues](https://github.com/skyflowapi/skyflow-iOS/issues) or contact Skyflow support. diff --git a/README.md b/README.md index 4cce8be3..5387279b 100644 --- a/README.md +++ b/README.md @@ -8,10 +8,14 @@ Skyflow's iOS SDKs let you securely collect, tokenize, and display sensitive dat This repository publishes two SDKs from a shared codebase. Pick the one that matches your vault type: -| SDK | Vault type | Install (CocoaPods / SPM product) | Import | Documentation | -|-----|------------|-----------------------------------|--------|---------------| -| **Skyflow** | PDB vault | `pod 'Skyflow'` / `Skyflow` | `import Skyflow` | [Skyflow/README.md](Skyflow/README.md) | -| **SkyflowFlowVault** | Flow vault | `pod 'SkyflowFlowVault'` / `SkyflowFlowVault` | `import SkyflowFlowVault` | [SkyflowFlowVault/README.md](SkyflowFlowVault/README.md) | +| SDK | Vault type | SPM product | Import | Documentation | +|-----|------------|-------------|--------|---------------| +| **Skyflow** | PDB vault | `Skyflow` | `import Skyflow` | [Skyflow/README.md](Skyflow/README.md) | +| **SkyflowFlowVault** | Flow vault | `SkyflowFlowVault` | `import SkyflowFlowVault` | [SkyflowFlowVault/README.md](SkyflowFlowVault/README.md) | + +Both SDKs are distributed through **Swift Package Manager** from `https://github.com/skyflowapi/skyflow-iOS.git`. + +> **CocoaPods:** CocoaPods trunk became read-only on December 2, 2026. Versions already published there (`pod 'Skyflow'`, `pod 'SkyflowFlowVault'`) remain installable, but new releases are published only through SPM. If you install with CocoaPods today, follow the [CocoaPods → SPM migration guide](MIGRATING_TO_SPM.md) to receive future updates. Not sure which one you need? If you are an existing Skyflow iOS customer, stay on **Skyflow** — it is fully backward compatible. **SkyflowFlowVault** is for Flow vaults; if you are moving from a PDB vault, follow its [Upgrading from PDB to FlowDB](SkyflowFlowVault/README.md#upgrading-from-pdb-to-flowdb) migration guide. diff --git a/Skyflow.podspec b/Skyflow.podspec deleted file mode 100644 index b2f16177..00000000 --- a/Skyflow.podspec +++ /dev/null @@ -1,33 +0,0 @@ -Pod::Spec.new do |spec| - - spec.name = "Skyflow" - - spec.version = "1.26.0" - - spec.summary = "skyflow-iOS" - - spec.description = "Skyflow iOS SDK" - - spec.homepage = "https://github.com/skyflowapi/skyflow-iOS.git" - - spec.license = { :type => "MIT", :file => "LICENSE" } - - spec.author = { "Skyflow" => "service-ops@skyflow.com" } - - spec.swift_version = '5.9' - - spec.platform = :ios, "13.0" - - spec.ios.deployment_target = "13.0" - - spec.source = { :git => "https://github.com/skyflowapi/skyflow-iOS.git", :tag => "1.26.0" } - - spec.source_files = "SkyflowCore/Sources/**/*.{swift}", "Skyflow/Sources/**/*.{swift}" - - spec.exclude_files = "Skyflow/Sources/Exports.swift" - - spec.pod_target_xcconfig = { 'OTHER_SWIFT_FLAGS' => '-package-name skyflow_ios_sdk' } - - spec.resource_bundles = {'Skyflow' => ['SkyflowCore/Sources/Resources/**/*.{xcassets}'] } - -end diff --git a/Skyflow/README.md b/Skyflow/README.md index 21fa76ba..3eed389d 100644 --- a/Skyflow/README.md +++ b/Skyflow/README.md @@ -24,19 +24,25 @@ Skyflow's iOS SDK can be used to securely collect, tokenize, and display sensiti ## Configuration --- ### SPM (Swift Package Manager) -- Go to File -> Swift Packages -> New Package Dependency (in Xcode IDE) -- Enter https://github.com/skyflowapi/skyflow-iOS.git and press ok. +- In Xcode: File → Add Package Dependencies → enter `https://github.com/skyflowapi/skyflow-iOS.git`. - In the "Choose Package Products" dialog, check the **Skyflow** product and add it to your app target. - -### Cocoapods -- To integrate skyflow-iOS into your Xcode project using CocoaPods, specify it in your Podfile: - ``` - #Mentioning the below source will pick the podspec from Skyflow repo - #Otherwise you can add cocoapod trunk as the source - #source 'https://github.com/skyflowapi/skyflow-iOS-spec.git' - - pod 'Skyflow', '1.26.0' +- Or, in a `Package.swift`: + ```swift + dependencies: [ + .package(url: "https://github.com/skyflowapi/skyflow-iOS.git", from: "1.26.0") + ], + targets: [ + .target(name: "YourApp", dependencies: [ + .product(name: "Skyflow", package: "skyflow-iOS") + ]) + ] ``` + +### CocoaPods (no new releases) +CocoaPods trunk became read-only on December 2, 2026. Versions already published to trunk can still be installed, but new releases are available only through SPM. To switch, follow the [CocoaPods → SPM migration guide](../MIGRATING_TO_SPM.md). +``` +pod 'Skyflow' +``` # Initializing skyflow-iOS diff --git a/SkyflowCore/Sources/Version.swift b/SkyflowCore/Sources/Version.swift index 99d3d40a..e2658f0d 100644 --- a/SkyflowCore/Sources/Version.swift +++ b/SkyflowCore/Sources/Version.swift @@ -11,8 +11,8 @@ import Foundation -// Both SDK products share this version (single source of truth, kept in sync -// with both podspecs by scripts/bump_version.sh). Version feeds error-message +// Both SDK products share this version (single source of truth, set by +// scripts/bump_version.sh and matching the release git tag). Version feeds error-message // prefixes. The per-instance SDK name (for the sdk_name_version vault metric) // lives on ContextOptions.sdkName instead of here, so that both SDKs // coexisting in one app process each report their own identity correctly. diff --git a/SkyflowCore/Sources/collect/elements/TextField.swift b/SkyflowCore/Sources/collect/elements/TextField.swift index 0557a935..b973824a 100644 --- a/SkyflowCore/Sources/collect/elements/TextField.swift +++ b/SkyflowCore/Sources/collect/elements/TextField.swift @@ -416,15 +416,7 @@ public class TextField: SkyflowElement, Element, BaseElement { if self.fieldType == .CARD_NUMBER, self.options.enableCardIcon { let imageView = UIImageView(frame: CGRect(x: 0, y: 0, width: 20, height: 20)) - #if SWIFT_PACKAGE var image = UIImage(named: "Unknown-Card", in: Bundle.module, compatibleWith: nil) - #else - let frameworkBundle = Bundle(for: TextField.self) - var bundleURL = frameworkBundle.resourceURL - bundleURL!.appendPathComponent(SkyflowAssetBundle.name) - let resourceBundle = Bundle(url: bundleURL!) - var image = UIImage(named: "Unknown-Card", in: resourceBundle, compatibleWith: nil) - #endif imageView.image = image imageView.contentMode = .center cardIconContainerView = UIView(frame: CGRect(x: 0, y: 0, width: 20 , height: 24)) @@ -477,15 +469,7 @@ public class TextField: SkyflowElement, Element, BaseElement { private func addCopyIcon(){ copyIconImageView = UIImageView(frame: CGRect(x: 0, y: 0, width: 24, height: 24)) - #if SWIFT_PACKAGE let image = UIImage(named: "Copy-Icon", in: Bundle.module, compatibleWith: nil) - #else - let frameworkBundle = Bundle(for: TextField.self) - var bundleURL = frameworkBundle.resourceURL - bundleURL!.appendPathComponent(SkyflowAssetBundle.name) - let resourceBundle = Bundle(url: bundleURL!) - var image = UIImage(named: "Copy-Icon", in: resourceBundle, compatibleWith: nil) - #endif copyIconImageView?.image = image copyIconImageView?.contentMode = .scaleAspectFit copyContainerView = UIView(frame: CGRect(x: 0, y: 0, width: 24 , height: 24)) @@ -502,28 +486,12 @@ public class TextField: SkyflowElement, Element, BaseElement { public override func copy(_ sender: Any?) { let pasteboard = UIPasteboard.general pasteboard.string = actualValue - #if SWIFT_PACKAGE let image = UIImage(named: "Success-Icon", in: Bundle.module, compatibleWith: nil) - #else - let frameworkBundle = Bundle(for: TextField.self) - var bundleURL = frameworkBundle.resourceURL - bundleURL!.appendPathComponent(SkyflowAssetBundle.name) - let resourceBundle = Bundle(url: bundleURL!) - var image = UIImage(named: "Success-Icon", in: resourceBundle, compatibleWith: nil) - #endif copyIconImageView?.image = image // Reset the copy icon after a delay DispatchQueue.main.asyncAfter(deadline: .now() + 1.0) { [weak self] in - #if SWIFT_PACKAGE let copyImage = UIImage(named: "Copy-Icon", in: Bundle.module, compatibleWith: nil) - #else - let frameworkBundle = Bundle(for: TextField.self) - var bundleURL = frameworkBundle.resourceURL - bundleURL!.appendPathComponent(SkyflowAssetBundle.name) - let resourceBundle = Bundle(url: bundleURL!) - var copyImage = UIImage(named: "Copy-Icon", in: resourceBundle, compatibleWith: nil) - #endif self?.copyIconImageView?.image = copyImage } @@ -540,15 +508,7 @@ public class TextField: SkyflowElement, Element, BaseElement { } let imageView = UIImageView(frame: CGRect(x: 0, y: 5, width: 40 + (0), height: 24)) - #if SWIFT_PACKAGE let image = UIImage(named: name, in: Bundle.module, compatibleWith: nil) - #else - let frameworkBundle = Bundle(for: TextField.self) - var bundleURL = frameworkBundle.resourceURL - bundleURL!.appendPathComponent(SkyflowAssetBundle.name) - let resourceBundle = Bundle(url: bundleURL!) - let image = UIImage(named: name, in: resourceBundle, compatibleWith: nil) - #endif imageView.image = image imageView.layer.cornerRadius = self.collectInput!.iconStyles.base?.cornerRadius ?? 0 let containerView = UIView(frame: CGRect(x: 0, y: 0, width: 60, height: 40)) @@ -625,15 +585,7 @@ public class TextField: SkyflowElement, Element, BaseElement { if #available(iOS 14.0, *) { setUpMenuView() dropdownButton.frame = CGRect(x: 0, y: 0, width: 12, height: 15) - #if SWIFT_PACKAGE dropdownButton.setImage(UIImage(named: "dropdown", in: Bundle.module, compatibleWith: nil), for: .normal) - #else - let frameworkBundle = Bundle(for: TextField.self) - var bundleURL = frameworkBundle.resourceURL - bundleURL!.appendPathComponent(SkyflowAssetBundle.name) - let resourceBundle = Bundle(url: bundleURL!) - dropdownButton.setImage(UIImage(named: "dropdown", in: resourceBundle, compatibleWith: nil), for: .normal) - #endif dropdownButton.isHidden = false dropdownButton.tintColor = .gray } diff --git a/SkyflowCore/Sources/reveal/UILabel+Copyable.swift b/SkyflowCore/Sources/reveal/UILabel+Copyable.swift index 72c64b0e..1d975fd6 100644 --- a/SkyflowCore/Sources/reveal/UILabel+Copyable.swift +++ b/SkyflowCore/Sources/reveal/UILabel+Copyable.swift @@ -99,28 +99,12 @@ public extension UILabel { if copyAfterReveal { let pasteboard = UIPasteboard.general pasteboard.string = actualValue - #if SWIFT_PACKAGE let image = UIImage(named: "Success-Icon", in: Bundle.module, compatibleWith: nil) - #else - let frameworkBundle = Bundle(for: TextField.self) - var bundleURL = frameworkBundle.resourceURL - bundleURL!.appendPathComponent(SkyflowAssetBundle.name) - let resourceBundle = Bundle(url: bundleURL!) - var image = UIImage(named: "Success-Icon", in: resourceBundle, compatibleWith: nil) - #endif copyIconImageView?.image = image // Reset the copy icon after a delay DispatchQueue.main.asyncAfter(deadline: .now() + 1.0) { [weak self] in - #if SWIFT_PACKAGE let copyImage = UIImage(named: "Copy-Icon", in: Bundle.module, compatibleWith: nil) - #else - let frameworkBundle = Bundle(for: TextField.self) - var bundleURL = frameworkBundle.resourceURL - bundleURL!.appendPathComponent(SkyflowAssetBundle.name) - let resourceBundle = Bundle(url: bundleURL!) - var copyImage = UIImage(named: "Copy-Icon", in: resourceBundle, compatibleWith: nil) - #endif self?.copyIconImageView?.image = copyImage } } @@ -130,15 +114,7 @@ public extension UILabel { let iconSize: CGFloat = 24.0 if copyIconImageView == nil { - #if SWIFT_PACKAGE let image = UIImage(named: "Copy-Icon", in: Bundle.module, compatibleWith: nil) - #else - let frameworkBundle = Bundle(for: TextField.self) - var bundleURL = frameworkBundle.resourceURL - bundleURL!.appendPathComponent(SkyflowAssetBundle.name) - let resourceBundle = Bundle(url: bundleURL!) - var image = UIImage(named: "Copy-Icon", in: resourceBundle, compatibleWith: nil) - #endif let imageView = UIImageView(frame: CGRect(x: 0, y: 0, width: iconSize, height: iconSize)) imageView.image = image imageView.contentMode = .center diff --git a/SkyflowCore/Sources/utils/SkyflowAssetBundle.swift b/SkyflowCore/Sources/utils/SkyflowAssetBundle.swift deleted file mode 100644 index 4902ca3e..00000000 --- a/SkyflowCore/Sources/utils/SkyflowAssetBundle.swift +++ /dev/null @@ -1,14 +0,0 @@ -/* - * Copyright (c) 2022 Skyflow -*/ - -// CocoaPods resource-bundle name for asset lookups in the shared core. -// Both pods ship their assets as "Skyflow.bundle" (declared in each podspec's -// resource_bundles) so the lookup is identical regardless of which product is -// built. (SPM builds use Bundle.module instead and never hit this path.) - -import Foundation - -package enum SkyflowAssetBundle { - package static let name = "Skyflow.bundle" -} diff --git a/SkyflowFlowVault.podspec b/SkyflowFlowVault.podspec deleted file mode 100644 index a5409d25..00000000 --- a/SkyflowFlowVault.podspec +++ /dev/null @@ -1,33 +0,0 @@ -Pod::Spec.new do |spec| - - spec.name = "SkyflowFlowVault" - - spec.version = "1.26.0" - - spec.summary = "SkyflowFlowVault" - - spec.description = "Skyflow FlowVault iOS SDK" - - spec.homepage = "https://github.com/skyflowapi/skyflow-iOS.git" - - spec.license = { :type => "MIT", :file => "LICENSE" } - - spec.author = { "Skyflow" => "service-ops@skyflow.com" } - - spec.swift_version = '5.9' - - spec.platform = :ios, "13.0" - - spec.ios.deployment_target = "13.0" - - spec.source = { :git => "https://github.com/skyflowapi/skyflow-iOS.git", :tag => "1.26.0" } - - spec.source_files = "SkyflowCore/Sources/**/*.{swift}", "SkyflowFlowVault/Sources/**/*.{swift}" - - spec.exclude_files = "SkyflowFlowVault/Sources/Exports.swift" - - spec.pod_target_xcconfig = { 'OTHER_SWIFT_FLAGS' => '-package-name skyflow_ios_sdk' } - - spec.resource_bundles = {'Skyflow' => ['SkyflowCore/Sources/Resources/**/*.{xcassets}'] } - -end diff --git a/SkyflowFlowVault/README.md b/SkyflowFlowVault/README.md index 84ae248c..965e8fa2 100644 --- a/SkyflowFlowVault/README.md +++ b/SkyflowFlowVault/README.md @@ -119,15 +119,23 @@ That's the whole round trip both ways - no card data ever touches your app code - Set Dependency Rule to **Exact Version** and enter `1.26.0`. - In the "Choose Package Products" dialog, check the **SkyflowFlowVault** product (not Skyflow) and add it to your app target. -### Cocoapods -- To integrate skyflow-iOS into your Xcode project using CocoaPods, specify it in your Podfile: - ``` - #Mentioning the below source will pick the podspec from Skyflow repo - #Otherwise you can add cocoapod trunk as the source - #source 'https://github.com/skyflowapi/skyflow-iOS-spec.git' - - pod 'SkyflowFlowVault', '1.26.0' +- Or, in a `Package.swift`: + ```swift + dependencies: [ + .package(url: "https://github.com/skyflowapi/skyflow-iOS.git", exact: "1.26.0") + ], + targets: [ + .target(name: "YourApp", dependencies: [ + .product(name: "SkyflowFlowVault", package: "skyflow-iOS") + ]) + ] ``` + +### CocoaPods (no new releases) +CocoaPods trunk became read-only on December 2, 2026. Versions already published to trunk can still be installed, but new releases are available only through SPM. To switch, follow the [CocoaPods → SPM migration guide](../MIGRATING_TO_SPM.md). +``` +pod 'SkyflowFlowVault' +``` # Initializing skyflow-iOS diff --git a/scripts/bump_version.sh b/scripts/bump_version.sh index 63677624..38b1c5f7 100755 --- a/scripts/bump_version.sh +++ b/scripts/bump_version.sh @@ -1,39 +1,20 @@ - - -# Both SDK products share one version line: this bumps Skyflow.podspec, -# SkyflowFlowVault.podspec, and the shared SDK_VERSION together. +# Both SDK products share one version line: this sets the shared SDK_VERSION +# in SkyflowCore/Sources/Version.swift. The release itself is the git tag +# (SPM resolves versions from tags), which must match this value. # # Usage: -# ./scripts/bump_version.sh 1.27.0 # release version, tag 1.27.0 -# ./scripts/bump_version.sh 1.27.0 # dev version pinned to a commit +# ./scripts/bump_version.sh 1.27.0 version=$1 -SEMVER=$version - -PODSPECS="Skyflow.podspec SkyflowFlowVault.podspec" VERSION_FILE="./SkyflowCore/Sources/Version.swift" -if [ -z $2 ] +if [ -z "$version" ] then - for podspec in $PODSPECS - do - sed -E "s/spec.version .+/spec.version = \"$SEMVER\"/g" "./$podspec" > tempfile - sed -E "s/source .+/source = { :git => \"https:\/\/github.com\/skyflowapi\/skyflow-iOS.git\", :tag => \"$1\" }/g" tempfile > "./$podspec" && rm -f tempfile - done - sed -E "s/var SDK_VERSION = .+/var SDK_VERSION = \"$SEMVER\"/g" $VERSION_FILE > tempfile && cat tempfile > $VERSION_FILE && rm -f tempfile - - - echo -------------------------- - echo "Done, Pods now at v$1" + echo "Usage: $0 " + exit 1 +fi -else - for podspec in $PODSPECS - do - sed -E "s/spec.version .+/spec.version = \"$SEMVER-dev.$2\"/g" "./$podspec" > tempfile - sed -E "s/source .+/source = { :git => \"https:\/\/github.com\/skyflowapi\/skyflow-iOS.git\", :commit => \"$2\" }/g" tempfile > "./$podspec" && rm -f tempfile - done - sed -E "s/var SDK_VERSION = .+/var SDK_VERSION = \"$SEMVER-dev.$2\"/g" $VERSION_FILE > tempfile && cat tempfile > $VERSION_FILE && rm -f tempfile +sed -E "s/var SDK_VERSION = .+/var SDK_VERSION = \"$version\"/g" $VERSION_FILE > tempfile && cat tempfile > $VERSION_FILE && rm -f tempfile - echo -------------------------- - echo "Done, Pods now at v$1-dev.$2" -fi +echo -------------------------- +echo "Done, SDK_VERSION now at v$version"