From f8c26b1435dbd8defccd9814bb5c759a2d8043bc Mon Sep 17 00:00:00 2001 From: wenbingzuo Date: Wed, 30 Aug 2023 14:01:11 +0800 Subject: [PATCH 1/2] fix: xcode 15 warning --- .../Collections/CollectionSkeleton.swift | 4 +-- .../SkeletonExtensions/SkeletonTextNode.swift | 16 +++++----- .../UIView+AssociatedObjects.swift | 32 +++++++++---------- 3 files changed, 26 insertions(+), 26 deletions(-) diff --git a/SkeletonViewCore/Sources/Internal/Collections/CollectionSkeleton.swift b/SkeletonViewCore/Sources/Internal/Collections/CollectionSkeleton.swift index 578ad596..6456bf95 100644 --- a/SkeletonViewCore/Sources/Internal/Collections/CollectionSkeleton.swift +++ b/SkeletonViewCore/Sources/Internal/Collections/CollectionSkeleton.swift @@ -9,8 +9,8 @@ import UIKit enum CollectionAssociatedKeys { - static var dummyDataSource = "dummyDataSource" - static var dummyDelegate = "dummyDelegate" + static var dummyDataSource: UInt8 = 0 + static var dummyDelegate: UInt8 = 0 } protocol CollectionSkeleton { diff --git a/SkeletonViewCore/Sources/Internal/SkeletonExtensions/SkeletonTextNode.swift b/SkeletonViewCore/Sources/Internal/SkeletonExtensions/SkeletonTextNode.swift index 84233486..8f2615d2 100644 --- a/SkeletonViewCore/Sources/Internal/SkeletonExtensions/SkeletonTextNode.swift +++ b/SkeletonViewCore/Sources/Internal/SkeletonExtensions/SkeletonTextNode.swift @@ -29,14 +29,14 @@ protocol SkeletonTextNode { enum SkeletonTextNodeAssociatedKeys { - static var lastLineFillingPercent = "lastLineFillingPercent" - static var multilineCornerRadius = "multilineCornerRadius" - static var multilineSpacing = "multilineSpacing" - static var paddingInsets = "paddingInsets" - static var backupHeightConstraints = "backupHeightConstraints" - static var textLineHeight = "textLineHeight" - static var skeletonNumberOfLines = "skeletonNumberOfLines" - + static var lastLineFillingPercent: UInt8 = 0 + static var multilineCornerRadius: UInt8 = 0 + static var multilineSpacing: UInt8 = 0 + static var paddingInsets: UInt8 = 0 + static var backupHeightConstraints: UInt8 = 0 + static var textLineHeight: UInt8 = 0 + static var skeletonNumberOfLines: UInt8 = 0 + } extension UILabel: SkeletonTextNode { diff --git a/SkeletonViewCore/Sources/Internal/UIKitExtensions/UIView+AssociatedObjects.swift b/SkeletonViewCore/Sources/Internal/UIKitExtensions/UIView+AssociatedObjects.swift index 25dd87fb..d906ca88 100644 --- a/SkeletonViewCore/Sources/Internal/UIKitExtensions/UIView+AssociatedObjects.swift +++ b/SkeletonViewCore/Sources/Internal/UIKitExtensions/UIView+AssociatedObjects.swift @@ -16,22 +16,22 @@ import UIKit // codebeat:disable[TOO_MANY_IVARS] enum ViewAssociatedKeys { - static var skeletonable = "skeletonable" - static var hiddenWhenSkeletonIsActive = "hiddenWhenSkeletonIsActive" - static var status = "status" - static var skeletonLayer = "layer" - static var flowDelegate = "flowDelegate" - static var isSkeletonAnimated = "isSkeletonAnimated" - static var viewState = "viewState" - static var labelViewState = "labelViewState" - static var imageViewState = "imageViewState" - static var buttonViewState = "buttonViewState" - static var headerFooterViewState = "headerFooterViewState" - static var currentSkeletonConfig = "currentSkeletonConfig" - static var skeletonCornerRadius = "skeletonCornerRadius" - static var disabledWhenSkeletonIsActive = "disabledWhenSkeletonIsActive" - static var delayedShowSkeletonWorkItem = "delayedShowSkeletonWorkItem" - + static var skeletonable: UInt8 = 0 + static var hiddenWhenSkeletonIsActive: UInt8 = 0 + static var status: UInt8 = 0 + static var skeletonLayer: UInt8 = 0 + static var flowDelegate: UInt8 = 0 + static var isSkeletonAnimated: UInt8 = 0 + static var viewState: UInt8 = 0 + static var labelViewState: UInt8 = 0 + static var imageViewState: UInt8 = 0 + static var buttonViewState: UInt8 = 0 + static var headerFooterViewState: UInt8 = 0 + static var currentSkeletonConfig: UInt8 = 0 + static var skeletonCornerRadius: UInt8 = 0 + static var disabledWhenSkeletonIsActive: UInt8 = 0 + static var delayedShowSkeletonWorkItem: UInt8 = 0 + } // codebeat:enable[TOO_MANY_IVARS] From 48501480f2ac260d98b044332a24a25726fbce38 Mon Sep 17 00:00:00 2001 From: wenbingzuo Date: Tue, 5 Sep 2023 09:59:29 +0800 Subject: [PATCH 2/2] feat: use StaticString instead of UInt8 --- .../Collections/CollectionSkeleton.swift | 4 +-- .../SkeletonExtensions/SkeletonTextNode.swift | 16 +++++----- .../UIView+AssociatedObjects.swift | 32 +++++++++---------- 3 files changed, 26 insertions(+), 26 deletions(-) diff --git a/SkeletonViewCore/Sources/Internal/Collections/CollectionSkeleton.swift b/SkeletonViewCore/Sources/Internal/Collections/CollectionSkeleton.swift index 6456bf95..70c93611 100644 --- a/SkeletonViewCore/Sources/Internal/Collections/CollectionSkeleton.swift +++ b/SkeletonViewCore/Sources/Internal/Collections/CollectionSkeleton.swift @@ -9,8 +9,8 @@ import UIKit enum CollectionAssociatedKeys { - static var dummyDataSource: UInt8 = 0 - static var dummyDelegate: UInt8 = 0 + static var dummyDataSource: StaticString = "dummyDataSource" + static var dummyDelegate: StaticString = "dummyDelegate" } protocol CollectionSkeleton { diff --git a/SkeletonViewCore/Sources/Internal/SkeletonExtensions/SkeletonTextNode.swift b/SkeletonViewCore/Sources/Internal/SkeletonExtensions/SkeletonTextNode.swift index 8f2615d2..db74e3b8 100644 --- a/SkeletonViewCore/Sources/Internal/SkeletonExtensions/SkeletonTextNode.swift +++ b/SkeletonViewCore/Sources/Internal/SkeletonExtensions/SkeletonTextNode.swift @@ -29,14 +29,14 @@ protocol SkeletonTextNode { enum SkeletonTextNodeAssociatedKeys { - static var lastLineFillingPercent: UInt8 = 0 - static var multilineCornerRadius: UInt8 = 0 - static var multilineSpacing: UInt8 = 0 - static var paddingInsets: UInt8 = 0 - static var backupHeightConstraints: UInt8 = 0 - static var textLineHeight: UInt8 = 0 - static var skeletonNumberOfLines: UInt8 = 0 - + static var lastLineFillingPercent: StaticString = "lastLineFillingPercent" + static var multilineCornerRadius: StaticString = "multilineCornerRadius" + static var multilineSpacing: StaticString = "multilineSpacing" + static var paddingInsets: StaticString = "paddingInsets" + static var backupHeightConstraints: StaticString = "backupHeightConstraints" + static var textLineHeight: StaticString = "textLineHeight" + static var skeletonNumberOfLines: StaticString = "skeletonNumberOfLines" + } extension UILabel: SkeletonTextNode { diff --git a/SkeletonViewCore/Sources/Internal/UIKitExtensions/UIView+AssociatedObjects.swift b/SkeletonViewCore/Sources/Internal/UIKitExtensions/UIView+AssociatedObjects.swift index d906ca88..91e0308c 100644 --- a/SkeletonViewCore/Sources/Internal/UIKitExtensions/UIView+AssociatedObjects.swift +++ b/SkeletonViewCore/Sources/Internal/UIKitExtensions/UIView+AssociatedObjects.swift @@ -16,22 +16,22 @@ import UIKit // codebeat:disable[TOO_MANY_IVARS] enum ViewAssociatedKeys { - static var skeletonable: UInt8 = 0 - static var hiddenWhenSkeletonIsActive: UInt8 = 0 - static var status: UInt8 = 0 - static var skeletonLayer: UInt8 = 0 - static var flowDelegate: UInt8 = 0 - static var isSkeletonAnimated: UInt8 = 0 - static var viewState: UInt8 = 0 - static var labelViewState: UInt8 = 0 - static var imageViewState: UInt8 = 0 - static var buttonViewState: UInt8 = 0 - static var headerFooterViewState: UInt8 = 0 - static var currentSkeletonConfig: UInt8 = 0 - static var skeletonCornerRadius: UInt8 = 0 - static var disabledWhenSkeletonIsActive: UInt8 = 0 - static var delayedShowSkeletonWorkItem: UInt8 = 0 - + static var skeletonable: StaticString = "skeletonable" + static var hiddenWhenSkeletonIsActive: StaticString = "hiddenWhenSkeletonIsActive" + static var status: StaticString = "status" + static var skeletonLayer: StaticString = "layer" + static var flowDelegate: StaticString = "flowDelegate" + static var isSkeletonAnimated: StaticString = "isSkeletonAnimated" + static var viewState: StaticString = "viewState" + static var labelViewState: StaticString = "labelViewState" + static var imageViewState: StaticString = "imageViewState" + static var buttonViewState: StaticString = "buttonViewState" + static var headerFooterViewState: StaticString = "headerFooterViewState" + static var currentSkeletonConfig: StaticString = "currentSkeletonConfig" + static var skeletonCornerRadius: StaticString = "skeletonCornerRadius" + static var disabledWhenSkeletonIsActive: StaticString = "disabledWhenSkeletonIsActive" + static var delayedShowSkeletonWorkItem: StaticString = "delayedShowSkeletonWorkItem" + } // codebeat:enable[TOO_MANY_IVARS]