diff --git a/Examples/AppStoreCardExample.swift b/Examples/AppStoreCardExample.swift index f472b7ac..ae67d213 100644 --- a/Examples/AppStoreCardExample.swift +++ b/Examples/AppStoreCardExample.swift @@ -219,7 +219,12 @@ class AppStoreViewController2: ExampleBaseViewController { Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent neque est, hendrerit vitae nibh ultrices, accumsan elementum ante. Phasellus fringilla sapien non lorem consectetur, in ullamcorper tortor condimentum. Nulla tincidunt iaculis maximus. Sed ut urna urna. Nulla at sem vel neque scelerisque imperdiet. Donec ornare luctus dapibus. Donec aliquet ante augue, at pellentesque ipsum mollis eget. Cras vulputate mauris ac eleifend sollicitudin. Vivamus ut posuere odio. Suspendisse vulputate sem vel felis vehicula iaculis. Fusce sagittis, eros quis consequat tincidunt, arcu nunc ornare nulla, non egestas dolor ex at ipsum. Cras et massa sit amet quam imperdiet viverra. Mauris vitae finibus nibh, ac vulputate sapien. """ - contentCard.backgroundColor = .white + if #available(iOS 13.0, *) { + contentCard.backgroundColor = .systemBackground + } else { + contentCard.backgroundColor = .white + } + contentCard.clipsToBounds = true contentCard.addSubview(contentView) diff --git a/Examples/ExampleBaseViewController.swift b/Examples/ExampleBaseViewController.swift index dbe48732..35d7999b 100644 --- a/Examples/ExampleBaseViewController.swift +++ b/Examples/ExampleBaseViewController.swift @@ -14,7 +14,11 @@ class ExampleBaseViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() - view.backgroundColor = .white + if #available(iOS 13.0, *) { + view.backgroundColor = .systemBackground + } else { + view.backgroundColor = .white + } view.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(onTap))) dismissButton.setTitle("Back", for: .normal) diff --git a/Examples/MainViewController.swift b/Examples/MainViewController.swift index 043c61cf..f29efab6 100644 --- a/Examples/MainViewController.swift +++ b/Examples/MainViewController.swift @@ -9,7 +9,11 @@ class MainViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() - view.backgroundColor = .white + if #available(iOS 13.0, *) { + view.backgroundColor = UIColor.systemBackground + } else { + view.backgroundColor = .white + } view.addSubview(collectionView) @@ -27,6 +31,13 @@ class MainViewController: UIViewController { let viewSource = ClosureViewSource { (label: UILabel, data: SourceData, index) in label.text = "\(index + 1). \(data.1)" label.textAlignment = .center + if #available(iOS 13.0, *) { + label.textColor = .label + label.backgroundColor = .systemBackground + } else { + label.textColor = .darkText + label.backgroundColor = .white + } label.layer.borderColor = UIColor.gray.cgColor label.layer.borderWidth = 0.5 label.layer.cornerRadius = 8 @@ -51,22 +62,13 @@ class MainViewController: UIViewController { imageView.contentMode = .scaleAspectFit let imageProvider = SimpleViewProvider(views: [imageView], sizeStrategy: (.fill, .fit)) - - let legacyButton = UIButton(type: .system) - legacyButton.setTitle("Legacy Examples", for: .normal) - legacyButton.addTarget(self, action: #selector(showLegacy), for: .touchUpInside) - let legacyExamplesProvider = SimpleViewProvider(views: [legacyButton], sizeStrategy: (.fill, .fit)) - + collectionView.provider = ComposedProvider( layout: FlowLayout(lineSpacing: 10).inset(by: UIEdgeInsets(top: 20, left: 20, bottom: 20, right: 20)), - sections: [imageProvider, examplesProvider, legacyExamplesProvider] + sections: [imageProvider, examplesProvider] ) } - - @objc func showLegacy() { - hero.replaceViewController(with: viewController(forStoryboardName: "Main")) - } - + override func viewDidLayoutSubviews() { super.viewDidLayoutSubviews() collectionView.frame = view.bounds diff --git a/Examples/MatchExample.swift b/Examples/MatchExample.swift index 28aa0cb2..3c94b9c0 100644 --- a/Examples/MatchExample.swift +++ b/Examples/MatchExample.swift @@ -51,7 +51,7 @@ class MatchExampleViewController1: ExampleBaseViewController { class MatchExampleViewController2: ExampleBaseViewController { let redView = UIView() let blackView = UIView() - let whiteView = UIView() + let backgroundView = UIView() override func viewDidLoad() { super.viewDidLoad() @@ -65,12 +65,16 @@ class MatchExampleViewController2: ExampleBaseViewController { blackView.cornerRadius = 8 view.addSubview(blackView) - whiteView.backgroundColor = .white - whiteView.cornerRadius = 8 + if #available(iOS 13.0, *) { + backgroundView.backgroundColor = .systemBackground + } else { + backgroundView.backgroundColor = .white + } + backgroundView.cornerRadius = 8 // .useGlobalCoordinateSpace modifier is needed here otherwise it will be covered by redView during transition. // see http://lkzhao.com/2018/03/02/hero-useglobalcoordinatespace-explained.html for detail - whiteView.hero.modifiers = [.translate(y: 500), .useGlobalCoordinateSpace] - view.addSubview(whiteView) + backgroundView.hero.modifiers = [.translate(y: 500), .useGlobalCoordinateSpace] + view.addSubview(backgroundView) } override func viewDidLayoutSubviews() { @@ -78,6 +82,6 @@ class MatchExampleViewController2: ExampleBaseViewController { redView.frame = view.bounds blackView.frame.size = CGSize(width: 250, height: 60) blackView.center = CGPoint(x: view.bounds.midX, y: 130) - whiteView.frame = CGRect(x: (view.bounds.width - 250) / 2, y: 180, width: 250, height: view.bounds.height - 320) + backgroundView.frame = CGRect(x: (view.bounds.width - 250) / 2, y: 180, width: 250, height: view.bounds.height - 320) } } diff --git a/Examples/Resources/Assets.xcassets/AppIcon.appiconset/Contents.json b/Examples/Resources/Assets.xcassets/AppIcon.appiconset/Contents.json index fa3f1e5d..7021df30 100644 --- a/Examples/Resources/Assets.xcassets/AppIcon.appiconset/Contents.json +++ b/Examples/Resources/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -103,8 +103,9 @@ "scale" : "2x" }, { - "idiom" : "ios-marketing", "size" : "1024x1024", + "idiom" : "ios-marketing", + "filename" : "Icon-1024.png", "scale" : "1x" } ], diff --git a/Examples/Resources/Assets.xcassets/AppIcon.appiconset/Icon-1024.png b/Examples/Resources/Assets.xcassets/AppIcon.appiconset/Icon-1024.png new file mode 100644 index 00000000..890732b5 Binary files /dev/null and b/Examples/Resources/Assets.xcassets/AppIcon.appiconset/Icon-1024.png differ diff --git a/Examples/Resources/Assets.xcassets/LaunchImage.launchimage/Contents.json b/Examples/Resources/Assets.xcassets/LaunchImage.launchimage/Contents.json deleted file mode 100644 index d746a609..00000000 --- a/Examples/Resources/Assets.xcassets/LaunchImage.launchimage/Contents.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "images" : [ - { - "orientation" : "landscape", - "idiom" : "tv", - "extent" : "full-screen", - "minimum-system-version" : "11.0", - "scale" : "2x" - }, - { - "orientation" : "landscape", - "idiom" : "tv", - "extent" : "full-screen", - "minimum-system-version" : "9.0", - "scale" : "1x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/Examples/Resources/Base.lproj/LaunchScreen.storyboard b/Examples/Resources/Base.lproj/LaunchScreen.storyboard index fdf3f97d..7fd29bfa 100644 --- a/Examples/Resources/Base.lproj/LaunchScreen.storyboard +++ b/Examples/Resources/Base.lproj/LaunchScreen.storyboard @@ -1,7 +1,10 @@ - - + + + - + + + @@ -9,14 +12,11 @@ - - - - - + + diff --git a/Hero.xcodeproj/project.pbxproj b/Hero.xcodeproj/project.pbxproj index 1035d171..fbf1f4da 100644 --- a/Hero.xcodeproj/project.pbxproj +++ b/Hero.xcodeproj/project.pbxproj @@ -52,7 +52,6 @@ A32D2D131E501C4F008D35FF /* HeroModifier+HeroStringConvertible.swift in Sources */ = {isa = PBXBuildFile; fileRef = A32D2D121E501C4F008D35FF /* HeroModifier+HeroStringConvertible.swift */; }; A32D2D141E501C4F008D35FF /* HeroModifier+HeroStringConvertible.swift in Sources */ = {isa = PBXBuildFile; fileRef = A32D2D121E501C4F008D35FF /* HeroModifier+HeroStringConvertible.swift */; }; A33E60A51DE761C90065CBD8 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = A33E60A41DE761C90065CBD8 /* AppDelegate.swift */; }; - A33E60AA1DE761C90065CBD8 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A33E60A81DE761C90065CBD8 /* Main.storyboard */; }; A33E60AC1DE761C90065CBD8 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = A33E60AB1DE761C90065CBD8 /* Assets.xcassets */; }; A33E60AF1DE761C90065CBD8 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A33E60AD1DE761C90065CBD8 /* LaunchScreen.storyboard */; }; A33E60BD1DE7621C0065CBD8 /* UIKit+HeroExamples.swift in Sources */ = {isa = PBXBuildFile; fileRef = A33E60B61DE7621C0065CBD8 /* UIKit+HeroExamples.swift */; }; @@ -128,8 +127,13 @@ B1D816EC1EF5A720007B9776 /* HeroTransition+Animate.swift in Sources */ = {isa = PBXBuildFile; fileRef = B1D816EA1EF5A720007B9776 /* HeroTransition+Animate.swift */; }; B1D834041F02E7C0009E1E36 /* ConditionalPreprocessor.swift in Sources */ = {isa = PBXBuildFile; fileRef = B1D834031F02E7C0009E1E36 /* ConditionalPreprocessor.swift */; }; B1D834051F02E7C0009E1E36 /* ConditionalPreprocessor.swift in Sources */ = {isa = PBXBuildFile; fileRef = B1D834031F02E7C0009E1E36 /* ConditionalPreprocessor.swift */; }; + DBA05BB41A704A4A17967918 /* Pods_HeroTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 841FFA357ACB279D3F74CDEE /* Pods_HeroTests.framework */; }; F482F0BE235D7808002E97ED /* UIColor+HexString.swift in Sources */ = {isa = PBXBuildFile; fileRef = F482F0BD235D7808002E97ED /* UIColor+HexString.swift */; }; F482F0BF235D7808002E97ED /* UIColor+HexString.swift in Sources */ = {isa = PBXBuildFile; fileRef = F482F0BD235D7808002E97ED /* UIColor+HexString.swift */; }; + F482F0C0235D7A3A002E97ED /* ImageGalleryCollectionViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A3499D9E1DF2024E0049B541 /* ImageGalleryCollectionViewController.swift */; }; + F482F0C1235D7A51002E97ED /* ImageViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A304BF831DF2717900A03345 /* ImageViewController.swift */; }; + F482F0C2235D7A5B002E97ED /* ImageCells.swift in Sources */ = {isa = PBXBuildFile; fileRef = A304BF891DF647FC00A03345 /* ImageCells.swift */; }; + F482F0C3235D7A65002E97ED /* ImageLibrary.swift in Sources */ = {isa = PBXBuildFile; fileRef = A313499A1E1E2AED00EB5139 /* ImageLibrary.swift */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -181,6 +185,8 @@ 4D307DF320E3C6DC00DD9F65 /* HeroModifier+Advanced.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "HeroModifier+Advanced.swift"; sourceTree = ""; }; 5C69728F2002CDBD001A5051 /* HeroCompatible.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeroCompatible.swift; sourceTree = ""; }; 5CD4F09A588E81DA75C2BE38 /* Pods-HeroExamples.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-HeroExamples.debug.xcconfig"; path = "Pods/Target Support Files/Pods-HeroExamples/Pods-HeroExamples.debug.xcconfig"; sourceTree = ""; }; + 5CEC69C9A9A60129002FD931 /* Pods-HeroTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-HeroTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-HeroTests/Pods-HeroTests.release.xcconfig"; sourceTree = ""; }; + 841FFA357ACB279D3F74CDEE /* Pods_HeroTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_HeroTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 86C87C73D89E75C8443B5071 /* Pods-HeroTvOSExamples.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-HeroTvOSExamples.debug.xcconfig"; path = "Pods/Target Support Files/Pods-HeroTvOSExamples/Pods-HeroTvOSExamples.debug.xcconfig"; sourceTree = ""; }; A304BF831DF2717900A03345 /* ImageViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ImageViewController.swift; sourceTree = ""; }; A304BF891DF647FC00A03345 /* ImageCells.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ImageCells.swift; sourceTree = ""; }; @@ -278,8 +284,10 @@ B1D816EA1EF5A720007B9776 /* HeroTransition+Animate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "HeroTransition+Animate.swift"; sourceTree = ""; }; B1D834031F02E7C0009E1E36 /* ConditionalPreprocessor.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ConditionalPreprocessor.swift; sourceTree = ""; }; C377744CBFF1E24426E80F55 /* Pods-HeroExamples.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-HeroExamples.release.xcconfig"; path = "Pods/Target Support Files/Pods-HeroExamples/Pods-HeroExamples.release.xcconfig"; sourceTree = ""; }; + C51A6465EC2CB38D82F28B93 /* Pods-HeroTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-HeroTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-HeroTests/Pods-HeroTests.debug.xcconfig"; sourceTree = ""; }; EEE340F89FF0A49DD23A5A6E /* Pods_HeroExamples.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_HeroExamples.framework; sourceTree = BUILT_PRODUCTS_DIR; }; F482F0BD235D7808002E97ED /* UIColor+HexString.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIColor+HexString.swift"; sourceTree = ""; }; + F482F0C5235D7C4C002E97ED /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Main.strings; sourceTree = ""; }; FD2306FDA4E15ADA91EFED44 /* Pods_HeroTvOSExamples.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_HeroTvOSExamples.framework; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ @@ -320,6 +328,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + DBA05BB41A704A4A17967918 /* Pods_HeroTests.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -331,6 +340,7 @@ children = ( EEE340F89FF0A49DD23A5A6E /* Pods_HeroExamples.framework */, FD2306FDA4E15ADA91EFED44 /* Pods_HeroTvOSExamples.framework */, + 841FFA357ACB279D3F74CDEE /* Pods_HeroTests.framework */, ); name = Frameworks; sourceTree = ""; @@ -406,6 +416,8 @@ C377744CBFF1E24426E80F55 /* Pods-HeroExamples.release.xcconfig */, 86C87C73D89E75C8443B5071 /* Pods-HeroTvOSExamples.debug.xcconfig */, A41D45F75C2C4244CC105281 /* Pods-HeroTvOSExamples.release.xcconfig */, + C51A6465EC2CB38D82F28B93 /* Pods-HeroTests.debug.xcconfig */, + 5CEC69C9A9A60129002FD931 /* Pods-HeroTests.release.xcconfig */, ); name = Pods; sourceTree = ""; @@ -739,6 +751,7 @@ isa = PBXNativeTarget; buildConfigurationList = AF1E1B581E66822C00ECE039 /* Build configuration list for PBXNativeTarget "HeroTests" */; buildPhases = ( + 3673D17D1C42FCAD03311A99 /* [CP] Check Pods Manifest.lock */, AF1E1B4D1E66822C00ECE039 /* Sources */, AF1E1B4E1E66822C00ECE039 /* Frameworks */, AF1E1B4F1E66822C00ECE039 /* Resources */, @@ -850,7 +863,6 @@ files = ( A33E60AF1DE761C90065CBD8 /* LaunchScreen.storyboard in Resources */, A33E60AC1DE761C90065CBD8 /* Assets.xcassets in Resources */, - A33E60AA1DE761C90065CBD8 /* Main.storyboard in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -882,6 +894,28 @@ shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-HeroExamples/Pods-HeroExamples-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; + 3673D17D1C42FCAD03311A99 /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-HeroTests-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; 89DC76B30A0BF7FD724C24D3 /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -993,9 +1027,13 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + F482F0C0235D7A3A002E97ED /* ImageGalleryCollectionViewController.swift in Sources */, A32D2CFC1E4A80DC008D35FF /* UIKit+HeroExamples.swift in Sources */, 2D1F7FE71E49DD90004D944B /* TVImageGalleryViewController.swift in Sources */, F482F0BF235D7808002E97ED /* UIColor+HexString.swift in Sources */, + F482F0C1235D7A51002E97ED /* ImageViewController.swift in Sources */, + F482F0C3235D7A65002E97ED /* ImageLibrary.swift in Sources */, + F482F0C2235D7A5B002E97ED /* ImageCells.swift in Sources */, 2D1F7FE51E49DD90004D944B /* AppDelegate.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -1112,6 +1150,7 @@ isa = PBXVariantGroup; children = ( A33E60A91DE761C90065CBD8 /* Base */, + F482F0C5235D7C4C002E97ED /* en */, ); name = Main.storyboard; path = .; @@ -1419,6 +1458,7 @@ }; AF1E1B591E66822C00ECE039 /* Debug */ = { isa = XCBuildConfiguration; + baseConfigurationReference = C51A6465EC2CB38D82F28B93 /* Pods-HeroTests.debug.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; DEVELOPMENT_TEAM = 4VSEW78TKT; @@ -1434,6 +1474,7 @@ }; AF1E1B5A1E66822C00ECE039 /* Release */ = { isa = XCBuildConfiguration; + baseConfigurationReference = 5CEC69C9A9A60129002FD931 /* Pods-HeroTests.release.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; DEVELOPMENT_TEAM = 4VSEW78TKT; diff --git a/LegacyExamples/Base.lproj/Main.storyboard b/LegacyExamples/Base.lproj/Main.storyboard index aa1e8f19..031561f4 100644 --- a/LegacyExamples/Base.lproj/Main.storyboard +++ b/LegacyExamples/Base.lproj/Main.storyboard @@ -1,12 +1,9 @@ - - - - + + - - + @@ -15,7 +12,7 @@ - + diff --git a/LegacyExamples/en.lproj/Main.strings b/LegacyExamples/en.lproj/Main.strings new file mode 100644 index 00000000..4e36dfd6 --- /dev/null +++ b/LegacyExamples/en.lproj/Main.strings @@ -0,0 +1,12 @@ + +/* Class = "UILabel"; text = "Built-in"; ObjectID = "IIL-pF-BfF"; */ +"IIL-pF-BfF.text" = "Built-in"; + +/* Class = "UITabBarItem"; title = "Plugins"; ObjectID = "bDK-79-b3B"; */ +"bDK-79-b3B.title" = "Plugins"; + +/* Class = "UILabel"; text = "HeroDebugPlugin"; ObjectID = "fUh-RG-Pga"; */ +"fUh-RG-Pga.text" = "HeroDebugPlugin"; + +/* Class = "UIViewController"; title = "Plugins"; ObjectID = "uv4-Wk-GeR"; */ +"uv4-Wk-GeR.title" = "Plugins"; diff --git a/Podfile b/Podfile index d3380640..8182c4de 100644 --- a/Podfile +++ b/Podfile @@ -4,6 +4,10 @@ target 'HeroExamples' do platform :ios, '9.0' use_frameworks! pod 'CollectionKit' + + target 'HeroTests' do + inherit! :search_paths + end end target 'HeroTvOSExamples' do diff --git a/Podfile.lock b/Podfile.lock index b88eb6c6..cff3af08 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -13,6 +13,6 @@ SPEC REPOS: SPEC CHECKSUMS: CollectionKit: 5caa5341860d4c9b748ebfeaab97530b2d02c7c0 -PODFILE CHECKSUM: 293d0984c38aac42633afe89b7cc83f7d1b9b629 +PODFILE CHECKSUM: efc6b025c2cee81dcc6fa480009618ed1af56837 COCOAPODS: 1.8.4 diff --git a/Sources/Extensions/UIColor+HexString.swift b/Sources/Extensions/UIColor+HexString.swift index e3367536..2a6092c5 100644 --- a/Sources/Extensions/UIColor+HexString.swift +++ b/Sources/Extensions/UIColor+HexString.swift @@ -12,22 +12,22 @@ extension UIColor { convenience init?(hexString hex: String) { var cString: String = hex.trimmingCharacters(in: .whitespacesAndNewlines).uppercased() - if cString.hasPrefix("#") { - cString.remove(at: cString.startIndex) - } + if cString.hasPrefix("#") { + cString.remove(at: cString.startIndex) + } guard cString.count == 6 else { return nil } - var rgbValue: UInt64 = 0 - Scanner(string: cString).scanHexInt64(&rgbValue) + var rgbValue: UInt64 = 0 + Scanner(string: cString).scanHexInt64(&rgbValue) self.init( - red: CGFloat((rgbValue & 0xFF0000) >> 16) / 255.0, - green: CGFloat((rgbValue & 0x00FF00) >> 8) / 255.0, - blue: CGFloat(rgbValue & 0x0000FF) / 255.0, - alpha: CGFloat(1.0) - ) + red: CGFloat((rgbValue & 0xFF0000) >> 16) / 255.0, + green: CGFloat((rgbValue & 0x00FF00) >> 8) / 255.0, + blue: CGFloat(rgbValue & 0x0000FF) / 255.0, + alpha: CGFloat(1.0) + ) } }