Просмотр исходного кода

Add UIKit Components extensions

Mx-Iris 1 год назад
Родитель
Сommit
38900fd172
2 измененных файлов с 14 добавлено и 40 удалено
  1. 0 39
      .github/workflows/UpstreamSync.yml
  2. 14 1
      Sources/Extensions/HasImageComponent+Kingfisher.swift

+ 0 - 39
.github/workflows/UpstreamSync.yml

@@ -1,39 +0,0 @@
-name: Upstream Sync
-
-permissions:
-  contents: write
-
-on:
-  schedule:
-    - cron: "0 0 * * *" # every day
-  workflow_dispatch:
-
-jobs:
-  sync_latest_from_upstream:
-    name: Sync latest commits from upstream repo
-    runs-on: ubuntu-latest
-    if: ${{ github.event.repository.fork }}
-
-    steps:
-      # Step 1: run a standard checkout action
-      - name: Checkout target repo
-        uses: actions/checkout@v3
-
-      # Step 2: run the sync action
-      - name: Sync upstream changes
-        id: sync
-        uses: aormsby/Fork-Sync-With-Upstream-action@v3.4
-        with:
-          upstream_sync_repo: onevcat/Kingfisher
-          upstream_sync_branch: master
-          target_sync_branch: master
-          target_repo_token: ${{ secrets.GITHUB_TOKEN }} # automatically generated, no need to set
-
-          # Set test_mode true to run tests instead of the true action!!
-          test_mode: false
-
-      - name: Sync check
-        if: failure()
-        run: |
-          echo "::error::Due to insufficient permissions, synchronization failed (as expected). Please go to the repository homepage and manually perform [Sync fork]."
-          exit 1

+ 14 - 1
Sources/Extensions/HasImageComponent+Kingfisher.swift

@@ -1,5 +1,5 @@
 //
 //
-//  AppKit+Kingfisher.swift
+//  KingfisherHasImageComponent+Kingfisher.swift
 //  Kingfisher
 //  Kingfisher
 //
 //
 //  Created by JH on 2023/12/5.
 //  Created by JH on 2023/12/5.
@@ -55,6 +55,19 @@ extension NSCell: KingfisherHasImageComponent {}
 
 
 #endif
 #endif
 
 
+#if canImport(UIKit)
+import UIKit
+
+@available(iOS 13.0, *)
+extension UIAction: KingfisherHasImageComponent {}
+
+@available(iOS 13.0, *)
+extension UICommand: KingfisherHasImageComponent {}
+
+extension UIBarItem: KingfisherHasImageComponent {}
+
+#endif
+
 extension KingfisherWrapper where Base: KingfisherHasImageComponent {
 extension KingfisherWrapper where Base: KingfisherHasImageComponent {
     // MARK: Setting Image
     // MARK: Setting Image