diff --git a/.circleci/config.yml b/.circleci/config.yml index 486b8b05..b2393479 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,27 +1,29 @@ version: 2.1 +orbs: + macos: circleci/macos@2 executors: - simulator: + default: parameters: xcode: type: string - default: '11.3.1' + default: '15.1.0' os: type: string - default: '13.3' + default: '17.2' device: type: string - default: iPhone 11 Pro Max + default: iPhone 15 Pro Max macos: xcode: << parameters.xcode >> shell: /bin/bash --login -eo pipefail environment: SIMULATOR_OS: << parameters.os >> - DESTINATION: platform=iOS Simulator,OS=<< parameters.os >>,name=<< parameters.device >> + SIMULATOR_DEVICE: << parameters.device >> + DESTINATION: platform=iOS Simulator,name=<< parameters.device >>,OS=<< parameters.os >> SIMULATOR: << parameters.device >> (<< parameters.os >>) [ - - default: simulator + HOMEBREW_NO_AUTO_UPDATE: 1 commands: @@ -52,12 +54,18 @@ commands: # System steps - change-ruby: - description: Select the correct version of ruby + setup-homebrew: + description: Bundle homebrew packages steps: - run: - name: Set Ruby Version - command: echo 'chruby ruby-2.6' >> ~/.bash_profile + name: Run brew bundle + command: brew bundle + + switch-ruby: + description: Switch to ruby 3.1.4 + steps: + - macos/switch-ruby: + version: "3.1.4" update-bundler: description: Update bundler to newest version @@ -92,29 +100,20 @@ commands: paths: - vendor/bundle - install-simulator: - description: Install simulator runtime - steps: - - run: - name: List simulators - command: bundle exec xcversion simulators - - run: - name: Install simulator - command: bundle exec xcversion simulators --install="iOS $SIMULATOR_OS Simulator" --no-progress || true - - start-simulator: - description: Start simulator - steps: - - run: - name: Start simulator - command: xcrun instruments -w "$SIMULATOR" || true - - fetch-cocoapods-specs: - description: Fetch CocoaPods repository from S3 - steps: - - run: - name: Fetch CocoaPods Specs - command: curl https://cocoapods-specs.circleci.com/fetch-cocoapods-repo-from-s3.sh | bash -s cf + # install-simulator: + # description: Install simulator runtime + # steps: + # - run: + # name: Install simulator + # command: xcodes runtimes install "iOS $SIMULATOR_OS" + + # start-simulator: + # description: Start simulator + # steps: + # - macos/preboot-simulator: + # version: {{ $SIMULATOR_OS }} + # platform: "iOS" + # device: {{ $SIMULATOR_DEVICE }} restore-pods-cache: description: Restore pods directory from cache @@ -154,7 +153,7 @@ commands: setup-gems: description: Update bundler and install gems steps: - - change-ruby + - switch-ruby - update-bundler - restore-gem-cache - bundle-install @@ -163,15 +162,11 @@ commands: setup-cocoapods: description: Fetch specs and install cocoapods steps: - - fetch-cocoapods-specs - restore-pods-cache - install-cocoapods - save-pods-cache - -# Rake tasks - - run-tests: + run-tests-task: description: Run tests on sepcific device steps: - run-rake-task: @@ -184,19 +179,19 @@ commands: name: Update Codecov command: bash <(curl -s https://codecov.io/bash) - lint-podspec: + run-lint-podspec-task: description: Lint Podspec steps: - run-rake-task: task: lint_podspec - generate-documentation: + run-generate-documentation-task: description: Build Documentation steps: - run-rake-task: task: generate_documentation - generate-changelog: + run-generate-changelog-task: description: Generate Changelog steps: - run-rake-task: @@ -241,16 +236,13 @@ commands: - run-rake-task: task: close_github_milestone - push-podspec: + run-push-podspec-task: description: Push Podspec to trunk steps: - run-rake-task: task: push_podspec - -# Tests - - swiftlint: + run-swiftlint: description: Run Swiftlint steps: - run: @@ -292,63 +284,45 @@ aliases: jobs: - build-and-test-ios13-iphone11promax: + build-and-test-ios17-iphone15promax: executor: - name: simulator - xcode: '11.3.1' - os: '13.3' - device: iPhone 11 Pro Max + name: default + xcode: '15.1.0' + os: '17.2' + device: iPhone 15 Pro Max steps: - checkout + - setup-homebrew - setup-gems - - install-simulator - - start-simulator - setup-cocoapods - - run-tests - - store-test-reports - - build-and-test-ios12-iphonexsmax: - executor: - name: simulator - xcode: '10.3.0' - os: '12.4' - device: iPhone Xs Max - steps: - - checkout - - setup-gems - - install-simulator - - start-simulator - - setup-cocoapods - - run-tests + - run-tests-task - update-codecov - store-test-reports - build-and-test-ios11-iphonex: + build-and-test-ios16-iphone14: executor: - name: simulator - os: '11.4' - device: iPhone X + name: default + xcode: '14.3.1' + os: '16.4' + device: iPhone 14 steps: - checkout - setup-gems - - install-simulator - - start-simulator - setup-cocoapods - - run-tests + - run-tests-task - store-test-reports - build-and-test-ios10-iphone7: + build-and-test-ios15-iphonese: executor: - name: simulator - os: '10.3.1' - device: iPhone 7 + name: default + xcode: '14.3.1' + os: '15.5' + device: iPhone SE (3rd generation) steps: - checkout - setup-gems - - install-simulator - - start-simulator - setup-cocoapods - - run-tests + - run-tests-task - store-test-reports lint-podspec: @@ -356,7 +330,7 @@ jobs: steps: - checkout - setup-gems - - lint-podspec + - run-lint-podspec-task build-documentation: executor: default @@ -364,21 +338,21 @@ jobs: - checkout - setup-gems - setup-cocoapods - - generate-documentation + - run-generate-documentation-task generate-changelog: executor: default steps: - checkout - setup-gems - - generate-changelog + - run-generate-changelog-task swiftlint: docker: - image: dantoml/swiftlint:latest steps: - checkout - - swiftlint + - run-swiftlint - store-lint-reports create-major-release-pull-request: @@ -425,30 +399,27 @@ jobs: - checkout - setup-gems - setup-cocoapods - - push-podspec + - run-push-podspec-task workflows: - version: 2.1 run-tests: jobs: - lint-podspec - swiftlint - - build-and-test-ios13-iphone11promax - - build-and-test-ios12-iphonexsmax - - build-and-test-ios11-iphonex - - build-and-test-ios10-iphone7 + - build-and-test-ios17-iphone15promax + - build-and-test-ios16-iphone14 + - build-and-test-ios15-iphonese - build-documentation - generate-changelog - create-version-tag: requires: - lint-podspec - swiftlint - - build-and-test-ios13-iphone11promax - - build-and-test-ios12-iphonexsmax - - build-and-test-ios11-iphonex - - build-and-test-ios10-iphone7 + - build-and-test-ios17-iphone15promax + - build-and-test-ios16-iphone14 + - build-and-test-ios15-iphonese - build-documentation - generate-changelog filters: diff --git a/.gitignore b/.gitignore index 9bf7c71d..75fc7145 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,10 @@ # - AS PER https://guides.cocoapods.org/using/using-cocoapods.html NEVER IGONRE THE LOCK FILE Pods/ +### Homebrew ### +# Homebrew lock file +Brewfile.lock.json + ### fastlane ### # fastlane - A streamlined workflow tool for Cocoa deployment # diff --git a/.ruby-version b/.ruby-version index 7872401a..71e447d5 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -ruby-2.6 +ruby-3.1.4 diff --git a/.swiftformat b/.swiftformat index 5ca01066..5f5fed24 100644 --- a/.swiftformat +++ b/.swiftformat @@ -1,3 +1,9 @@ +# file options + +--exclude Example/Pods + +# format options + --allman false --binarygrouping none --closingparen balanced @@ -7,7 +13,6 @@ --disable redundantFileprivate, redundantObjc --elseposition same-line --empty void ---exclude Example/Pods, Package.swift --exponentcase lowercase --exponentgrouping disabled --fractiongrouping disabled @@ -27,7 +32,13 @@ --selfrequired --semicolons inline --stripunusedargs always ---swiftversion 4.2 +--swiftversion 5.0 --trimwhitespace always ---wraparguments after-first +--wraparguments preserve --wrapcollections preserve + + +# rules + +--enable isEmpty +--disable wrapMultilineStatementBraces diff --git a/Brewfile b/Brewfile new file mode 100644 index 00000000..d243fa9b --- /dev/null +++ b/Brewfile @@ -0,0 +1,3 @@ +brew 'xcodes' +brew 'xcbeautify' +brew 'aria2' diff --git a/Example/JJFloatingActionButton.xcodeproj/project.pbxproj b/Example/JJFloatingActionButton.xcodeproj/project.pbxproj index bc0a5f06..ee04c2e8 100644 --- a/Example/JJFloatingActionButton.xcodeproj/project.pbxproj +++ b/Example/JJFloatingActionButton.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 50; + objectVersion = 54; objects = { /* Begin PBXBuildFile section */ @@ -33,8 +33,8 @@ 19E247E61FD7E6F6009A7BA1 /* JJActionItem.xib in Resources */ = {isa = PBXBuildFile; fileRef = 19E247E41FD7E6B5009A7BA1 /* JJActionItem.xib */; }; 19E247E81FD83CA7009A7BA1 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 198B66091FBAE904009A17F2 /* Assets.xcassets */; }; 19EDBD4520285DF100559C37 /* AnimationConfigurationSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19EDBD4420285DF100559C37 /* AnimationConfigurationSpec.swift */; }; - 20F85416FAB357157F3C9007 /* Pods_JJFloatingActionButton_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 60D4A6C088C2B6AA8F5858B2 /* Pods_JJFloatingActionButton_Example.framework */; }; - 381AA4C7EC97032BAEF9B53D /* Pods_JJFloatingActionButton_Tests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5259A32C1433DBF1E449F0D3 /* Pods_JJFloatingActionButton_Tests.framework */; }; + 414BFF342FC79867E034C489 /* Pods_JJFloatingActionButton_Tests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DDB0E9E16AC26F917AE1DCD /* Pods_JJFloatingActionButton_Tests.framework */; }; + BFC79054429053A9396E0EF0 /* Pods_JJFloatingActionButton_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E90256DD6925123F31C4E249 /* Pods_JJFloatingActionButton_Example.framework */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -48,7 +48,6 @@ /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ - 01B5B59D506C691CE59F05AC /* Pods-JJFloatingActionButton_Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-JJFloatingActionButton_Tests.release.xcconfig"; path = "Pods/Target Support Files/Pods-JJFloatingActionButton_Tests/Pods-JJFloatingActionButton_Tests.release.xcconfig"; sourceTree = ""; }; 19037F0D1FC2ED7B00138594 /* CHANGELOG.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; name = CHANGELOG.md; path = ../../CHANGELOG.md; sourceTree = ""; }; 192D1B6D2003C7440093064F /* Helper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Helper.swift; sourceTree = ""; }; 192D1B6F2003CB8A0093064F /* ConfigurationExampleViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ConfigurationExampleViewController.swift; sourceTree = ""; }; @@ -93,11 +92,12 @@ 19E247E91FD854B1009A7BA1 /* .github_changelog_generator */ = {isa = PBXFileReference; lastKnownFileType = text; name = .github_changelog_generator; path = ../../.github_changelog_generator; sourceTree = ""; }; 19E247EA1FD93525009A7BA1 /* .swiftlint.yml */ = {isa = PBXFileReference; indentWidth = 2; lastKnownFileType = text; name = .swiftlint.yml; path = ../../.swiftlint.yml; sourceTree = ""; tabWidth = 2; }; 19EDBD4420285DF100559C37 /* AnimationConfigurationSpec.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AnimationConfigurationSpec.swift; sourceTree = ""; }; - 5259A32C1433DBF1E449F0D3 /* Pods_JJFloatingActionButton_Tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_JJFloatingActionButton_Tests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 60D4A6C088C2B6AA8F5858B2 /* Pods_JJFloatingActionButton_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_JJFloatingActionButton_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 6D57DA2CF0B15574F28706D7 /* Pods-JJFloatingActionButton_Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-JJFloatingActionButton_Tests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-JJFloatingActionButton_Tests/Pods-JJFloatingActionButton_Tests.debug.xcconfig"; sourceTree = ""; }; - 8001F0AA93A4593FD2F57455 /* Pods-JJFloatingActionButton_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-JJFloatingActionButton_Example.debug.xcconfig"; path = "Pods/Target Support Files/Pods-JJFloatingActionButton_Example/Pods-JJFloatingActionButton_Example.debug.xcconfig"; sourceTree = ""; }; - BF9AC4BE0370DA981835A9F3 /* Pods-JJFloatingActionButton_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-JJFloatingActionButton_Example.release.xcconfig"; path = "Pods/Target Support Files/Pods-JJFloatingActionButton_Example/Pods-JJFloatingActionButton_Example.release.xcconfig"; sourceTree = ""; }; + 3DDB0E9E16AC26F917AE1DCD /* Pods_JJFloatingActionButton_Tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_JJFloatingActionButton_Tests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 8881BFB48216391CD6BCA5F5 /* Pods-JJFloatingActionButton_Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-JJFloatingActionButton_Tests.debug.xcconfig"; path = "Target Support Files/Pods-JJFloatingActionButton_Tests/Pods-JJFloatingActionButton_Tests.debug.xcconfig"; sourceTree = ""; }; + B5E6B6079D7EEE0575CB5D9D /* Pods-JJFloatingActionButton_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-JJFloatingActionButton_Example.debug.xcconfig"; path = "Target Support Files/Pods-JJFloatingActionButton_Example/Pods-JJFloatingActionButton_Example.debug.xcconfig"; sourceTree = ""; }; + C50B8360897CBAEAFFC6AFFD /* Pods-JJFloatingActionButton_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-JJFloatingActionButton_Example.release.xcconfig"; path = "Target Support Files/Pods-JJFloatingActionButton_Example/Pods-JJFloatingActionButton_Example.release.xcconfig"; sourceTree = ""; }; + CF7D93952DD0BFD965266A88 /* Pods-JJFloatingActionButton_Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-JJFloatingActionButton_Tests.release.xcconfig"; path = "Target Support Files/Pods-JJFloatingActionButton_Tests/Pods-JJFloatingActionButton_Tests.release.xcconfig"; sourceTree = ""; }; + E90256DD6925123F31C4E249 /* Pods_JJFloatingActionButton_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_JJFloatingActionButton_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -105,7 +105,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 20F85416FAB357157F3C9007 /* Pods_JJFloatingActionButton_Example.framework in Frameworks */, + BFC79054429053A9396E0EF0 /* Pods_JJFloatingActionButton_Example.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -113,33 +113,13 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 381AA4C7EC97032BAEF9B53D /* Pods_JJFloatingActionButton_Tests.framework in Frameworks */, + 414BFF342FC79867E034C489 /* Pods_JJFloatingActionButton_Tests.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - 00BBC2C2E884D3E89E78D142 /* Frameworks */ = { - isa = PBXGroup; - children = ( - 60D4A6C088C2B6AA8F5858B2 /* Pods_JJFloatingActionButton_Example.framework */, - 5259A32C1433DBF1E449F0D3 /* Pods_JJFloatingActionButton_Tests.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; - 01854984A8BA953684480AB2 /* Pods */ = { - isa = PBXGroup; - children = ( - 8001F0AA93A4593FD2F57455 /* Pods-JJFloatingActionButton_Example.debug.xcconfig */, - BF9AC4BE0370DA981835A9F3 /* Pods-JJFloatingActionButton_Example.release.xcconfig */, - 6D57DA2CF0B15574F28706D7 /* Pods-JJFloatingActionButton_Tests.debug.xcconfig */, - 01B5B59D506C691CE59F05AC /* Pods-JJFloatingActionButton_Tests.release.xcconfig */, - ); - name = Pods; - sourceTree = ""; - }; 198B65F41FBAE904009A17F2 = { isa = PBXGroup; children = ( @@ -147,8 +127,8 @@ 198B65FF1FBAE904009A17F2 /* Example */, 198B66161FBAE904009A17F2 /* Tests */, 198B65FE1FBAE904009A17F2 /* Products */, - 01854984A8BA953684480AB2 /* Pods */, - 00BBC2C2E884D3E89E78D142 /* Frameworks */, + 2CACEC3A226CD01722DE184A /* Pods */, + EEDEB639B132FC44FCC1C226 /* Frameworks */, ); sourceTree = ""; }; @@ -242,6 +222,27 @@ path = Mocks; sourceTree = ""; }; + 2CACEC3A226CD01722DE184A /* Pods */ = { + isa = PBXGroup; + children = ( + B5E6B6079D7EEE0575CB5D9D /* Pods-JJFloatingActionButton_Example.debug.xcconfig */, + C50B8360897CBAEAFFC6AFFD /* Pods-JJFloatingActionButton_Example.release.xcconfig */, + 8881BFB48216391CD6BCA5F5 /* Pods-JJFloatingActionButton_Tests.debug.xcconfig */, + CF7D93952DD0BFD965266A88 /* Pods-JJFloatingActionButton_Tests.release.xcconfig */, + ); + name = Pods; + path = Pods; + sourceTree = ""; + }; + EEDEB639B132FC44FCC1C226 /* Frameworks */ = { + isa = PBXGroup; + children = ( + E90256DD6925123F31C4E249 /* Pods_JJFloatingActionButton_Example.framework */, + 3DDB0E9E16AC26F917AE1DCD /* Pods_JJFloatingActionButton_Tests.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -249,11 +250,11 @@ isa = PBXNativeTarget; buildConfigurationList = 198B661C1FBAE904009A17F2 /* Build configuration list for PBXNativeTarget "JJFloatingActionButton_Example" */; buildPhases = ( - 975193901E1B557F7618CED7 /* [CP] Check Pods Manifest.lock */, + AFF70CE1EA0B0829E5855E98 /* [CP] Check Pods Manifest.lock */, 198B65F91FBAE904009A17F2 /* Sources */, 198B65FA1FBAE904009A17F2 /* Frameworks */, 198B65FB1FBAE904009A17F2 /* Resources */, - 0AD2D7B2057F16455C73A904 /* [CP] Embed Pods Frameworks */, + 51D8929EFCDA11DF0DE6FE5D /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -268,11 +269,11 @@ isa = PBXNativeTarget; buildConfigurationList = 198B661F1FBAE904009A17F2 /* Build configuration list for PBXNativeTarget "JJFloatingActionButton_Tests" */; buildPhases = ( - 3914CEF0D1A991BDE4776522 /* [CP] Check Pods Manifest.lock */, + B0F3989A07C387CD1268807A /* [CP] Check Pods Manifest.lock */, 198B660F1FBAE904009A17F2 /* Sources */, 198B66101FBAE904009A17F2 /* Frameworks */, 198B66111FBAE904009A17F2 /* Resources */, - EA45183ABD080A9E905DCA86 /* [CP] Embed Pods Frameworks */, + C30036A8E5F5C7C2FFE873B6 /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -290,9 +291,10 @@ 198B65F51FBAE904009A17F2 /* Project object */ = { isa = PBXProject; attributes = { + BuildIndependentTargetsInParallel = YES; CLASSPREFIX = JJ; LastSwiftUpdateCheck = 0910; - LastUpgradeCheck = 0940; + LastUpgradeCheck = 1500; ORGANIZATIONNAME = "Jochen Pfeiffer"; TargetAttributes = { 198B65FC1FBAE904009A17F2 = { @@ -353,7 +355,7 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - 0AD2D7B2057F16455C73A904 /* [CP] Embed Pods Frameworks */ = { + 51D8929EFCDA11DF0DE6FE5D /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -370,43 +372,51 @@ shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-JJFloatingActionButton_Example/Pods-JJFloatingActionButton_Example-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; - 3914CEF0D1A991BDE4776522 /* [CP] Check Pods Manifest.lock */ = { + AFF70CE1EA0B0829E5855E98 /* [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-JJFloatingActionButton_Tests-checkManifestLockResult.txt", + "$(DERIVED_FILE_DIR)/Pods-JJFloatingActionButton_Example-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; }; - 975193901E1B557F7618CED7 /* [CP] Check Pods Manifest.lock */ = { + B0F3989A07C387CD1268807A /* [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-JJFloatingActionButton_Example-checkManifestLockResult.txt", + "$(DERIVED_FILE_DIR)/Pods-JJFloatingActionButton_Tests-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; }; - EA45183ABD080A9E905DCA86 /* [CP] Embed Pods Frameworks */ = { + C30036A8E5F5C7C2FFE873B6 /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -514,6 +524,7 @@ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; @@ -525,6 +536,7 @@ DEBUG_INFORMATION_FORMAT = dwarf; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; GCC_C_LANGUAGE_STANDARD = gnu11; GCC_DYNAMIC_NO_PIC = NO; GCC_NO_COMMON_BLOCKS = YES; @@ -539,7 +551,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.3; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; LD_RUNPATH_SEARCH_PATHS = "$(FRAMEWORK_SEARCH_PATHS)"; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; @@ -575,6 +587,7 @@ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; @@ -586,6 +599,7 @@ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; GCC_C_LANGUAGE_STANDARD = gnu11; GCC_NO_COMMON_BLOCKS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; @@ -594,7 +608,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.3; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; LD_RUNPATH_SEARCH_PATHS = "$(FRAMEWORK_SEARCH_PATHS)"; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; @@ -606,12 +620,13 @@ }; 198B661D1FBAE904009A17F2 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 8001F0AA93A4593FD2F57455 /* Pods-JJFloatingActionButton_Example.debug.xcconfig */; + baseConfigurationReference = B5E6B6079D7EEE0575CB5D9D /* Pods-JJFloatingActionButton_Example.debug.xcconfig */; buildSettings = { ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = "$(inherited)"; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_STYLE = Automatic; INFOPLIST_FILE = JJFloatingActionButton/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -625,12 +640,13 @@ }; 198B661E1FBAE904009A17F2 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = BF9AC4BE0370DA981835A9F3 /* Pods-JJFloatingActionButton_Example.release.xcconfig */; + baseConfigurationReference = C50B8360897CBAEAFFC6AFFD /* Pods-JJFloatingActionButton_Example.release.xcconfig */; buildSettings = { ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = "$(inherited)"; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_STYLE = Automatic; INFOPLIST_FILE = JJFloatingActionButton/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -644,12 +660,13 @@ }; 198B66201FBAE904009A17F2 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 6D57DA2CF0B15574F28706D7 /* Pods-JJFloatingActionButton_Tests.debug.xcconfig */; + baseConfigurationReference = 8881BFB48216391CD6BCA5F5 /* Pods-JJFloatingActionButton_Tests.debug.xcconfig */; buildSettings = { ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = "$(inherited)"; BUNDLE_LOADER = "$(TEST_HOST)"; CODE_SIGN_STYLE = Automatic; INFOPLIST_FILE = Tests/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -665,12 +682,13 @@ }; 198B66211FBAE904009A17F2 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 01B5B59D506C691CE59F05AC /* Pods-JJFloatingActionButton_Tests.release.xcconfig */; + baseConfigurationReference = CF7D93952DD0BFD965266A88 /* Pods-JJFloatingActionButton_Tests.release.xcconfig */; buildSettings = { ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = "$(inherited)"; BUNDLE_LOADER = "$(TEST_HOST)"; CODE_SIGN_STYLE = Automatic; INFOPLIST_FILE = Tests/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", diff --git a/Example/JJFloatingActionButton.xcodeproj/xcshareddata/xcschemes/JJFloatingActionButton_Example.xcscheme b/Example/JJFloatingActionButton.xcodeproj/xcshareddata/xcschemes/JJFloatingActionButton_Example.xcscheme index 57a6d400..cc1c54b8 100644 --- a/Example/JJFloatingActionButton.xcodeproj/xcshareddata/xcschemes/JJFloatingActionButton_Example.xcscheme +++ b/Example/JJFloatingActionButton.xcodeproj/xcshareddata/xcschemes/JJFloatingActionButton_Example.xcscheme @@ -1,6 +1,6 @@ @@ -58,16 +58,6 @@ ReferencedContainer = "container:JJFloatingActionButton.xcodeproj"> - - - - Bool { - window?.tintColor = UIColor(hue: 0.31, saturation: 0.37, brightness: 0.76, alpha: 1.00) - UINavigationBar.appearance().tintColor = UIColor.white + customizeAppearance() + return true } + + private + func customizeAppearance() { + let mainColor = UIColor(named: "Main") + let titleAttributes = [NSAttributedString.Key.foregroundColor: UIColor.white] + + window?.tintColor = mainColor + + UINavigationBar.appearance().isTranslucent = false + UINavigationBar.appearance().barTintColor = mainColor + UINavigationBar.appearance().tintColor = .white + + let navigationBarAppearance = UINavigationBarAppearance() + navigationBarAppearance.configureWithOpaqueBackground() + navigationBarAppearance.backgroundColor = mainColor + navigationBarAppearance.titleTextAttributes = titleAttributes + navigationBarAppearance.titleTextAttributes = titleAttributes + + UINavigationBar.appearance().standardAppearance = navigationBarAppearance + UINavigationBar.appearance().compactAppearance = navigationBarAppearance + UINavigationBar.appearance().scrollEdgeAppearance = navigationBarAppearance + if #available(iOS 15.0, *) { + UINavigationBar.appearance().compactScrollEdgeAppearance = navigationBarAppearance + } + } } diff --git a/Example/JJFloatingActionButton/Assets.xcassets/Baloon.imageset/Contents.json b/Example/JJFloatingActionButton/Assets.xcassets/Balloon.imageset/Contents.json similarity index 85% rename from Example/JJFloatingActionButton/Assets.xcassets/Baloon.imageset/Contents.json rename to Example/JJFloatingActionButton/Assets.xcassets/Balloon.imageset/Contents.json index 8b9615a6..0b734bea 100644 --- a/Example/JJFloatingActionButton/Assets.xcassets/Baloon.imageset/Contents.json +++ b/Example/JJFloatingActionButton/Assets.xcassets/Balloon.imageset/Contents.json @@ -2,7 +2,7 @@ "images" : [ { "idiom" : "universal", - "filename" : "baloon-glyph-24.pdf" + "filename" : "balloon-glyph-24.pdf" } ], "info" : { diff --git a/Example/JJFloatingActionButton/Assets.xcassets/Baloon.imageset/baloon-glyph-24.pdf b/Example/JJFloatingActionButton/Assets.xcassets/Balloon.imageset/balloon-glyph-24.pdf similarity index 100% rename from Example/JJFloatingActionButton/Assets.xcassets/Baloon.imageset/baloon-glyph-24.pdf rename to Example/JJFloatingActionButton/Assets.xcassets/Balloon.imageset/balloon-glyph-24.pdf diff --git a/Example/JJFloatingActionButton/Assets.xcassets/Contents.json b/Example/JJFloatingActionButton/Assets.xcassets/Contents.json index da4a164c..73c00596 100644 --- a/Example/JJFloatingActionButton/Assets.xcassets/Contents.json +++ b/Example/JJFloatingActionButton/Assets.xcassets/Contents.json @@ -1,6 +1,6 @@ { "info" : { - "version" : 1, - "author" : "xcode" + "author" : "xcode", + "version" : 1 } -} \ No newline at end of file +} diff --git a/Example/JJFloatingActionButton/Assets.xcassets/Favourite.imageset/Contents.json b/Example/JJFloatingActionButton/Assets.xcassets/Favorite.imageset/Contents.json similarity index 83% rename from Example/JJFloatingActionButton/Assets.xcassets/Favourite.imageset/Contents.json rename to Example/JJFloatingActionButton/Assets.xcassets/Favorite.imageset/Contents.json index dbf5514d..5ba597db 100644 --- a/Example/JJFloatingActionButton/Assets.xcassets/Favourite.imageset/Contents.json +++ b/Example/JJFloatingActionButton/Assets.xcassets/Favorite.imageset/Contents.json @@ -2,7 +2,7 @@ "images" : [ { "idiom" : "universal", - "filename" : "favourite-28-glyph-24.pdf" + "filename" : "favorite-28-glyph-24.pdf" } ], "info" : { diff --git a/Example/JJFloatingActionButton/Assets.xcassets/Favourite.imageset/favourite-28-glyph-24.pdf b/Example/JJFloatingActionButton/Assets.xcassets/Favorite.imageset/favorite-28-glyph-24.pdf similarity index 100% rename from Example/JJFloatingActionButton/Assets.xcassets/Favourite.imageset/favourite-28-glyph-24.pdf rename to Example/JJFloatingActionButton/Assets.xcassets/Favorite.imageset/favorite-28-glyph-24.pdf diff --git a/Example/JJFloatingActionButton/Assets.xcassets/Main.colorset/Contents.json b/Example/JJFloatingActionButton/Assets.xcassets/Main.colorset/Contents.json new file mode 100644 index 00000000..ac5e3de3 --- /dev/null +++ b/Example/JJFloatingActionButton/Assets.xcassets/Main.colorset/Contents.json @@ -0,0 +1,20 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0x7A", + "green" : "0xC1", + "red" : "0x86" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Example/JJFloatingActionButton/Base.lproj/LaunchScreen.storyboard b/Example/JJFloatingActionButton/Base.lproj/LaunchScreen.storyboard index d770267f..9ae7c6d1 100644 --- a/Example/JJFloatingActionButton/Base.lproj/LaunchScreen.storyboard +++ b/Example/JJFloatingActionButton/Base.lproj/LaunchScreen.storyboard @@ -1,10 +1,11 @@ - + - + + @@ -15,8 +16,8 @@ - + @@ -24,4 +25,9 @@ + + + + + diff --git a/Example/JJFloatingActionButton/Base.lproj/Main.storyboard b/Example/JJFloatingActionButton/Base.lproj/Main.storyboard index 89e43bc1..30bdb008 100644 --- a/Example/JJFloatingActionButton/Base.lproj/Main.storyboard +++ b/Example/JJFloatingActionButton/Base.lproj/Main.storyboard @@ -1,10 +1,11 @@ - + - + + @@ -28,7 +29,8 @@ - + + @@ -36,7 +38,6 @@ - @@ -52,7 +53,7 @@ - + + @@ -93,7 +95,6 @@ - @@ -115,14 +116,14 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + + @@ -362,7 +364,6 @@ - @@ -390,7 +391,8 @@ - + + @@ -398,7 +400,6 @@ - @@ -414,7 +415,7 @@ - + + @@ -434,7 +436,6 @@ - @@ -450,7 +451,7 @@ - + + @@ -470,7 +472,6 @@ - @@ -486,5 +487,22 @@ - + + + + + + + + + + + + + + + + + + diff --git a/Example/JJFloatingActionButton/BasicsExampleViewController.swift b/Example/JJFloatingActionButton/BasicsExampleViewController.swift index e5b73119..bd0cfcbc 100644 --- a/Example/JJFloatingActionButton/BasicsExampleViewController.swift +++ b/Example/JJFloatingActionButton/BasicsExampleViewController.swift @@ -25,22 +25,22 @@ import JJFloatingActionButton import UIKit -internal class BasicsExampleViewController: UIViewController { +class BasicsExampleViewController: UIViewController { fileprivate let actionButton = JJFloatingActionButton() override func viewDidLoad() { super.viewDidLoad() - actionButton.addItem(title: "Heart", image: #imageLiteral(resourceName: "Favourite")) { item in - Helper.showAlert(for: item) + actionButton.addItem(title: "Heart", image: #imageLiteral(resourceName: "Favorite")) { item in + self.showAlert(for: item) } actionButton.addItem(title: "Like", image: #imageLiteral(resourceName: "Like")) { item in - Helper.showAlert(for: item) + self.showAlert(for: item) } - actionButton.addItem(title: "Balloon", image: #imageLiteral(resourceName: "Baloon")) { item in - Helper.showAlert(for: item) + actionButton.addItem(title: "Balloon", image: #imageLiteral(resourceName: "Balloon")) { item in + self.showAlert(for: item) } actionButton.display(inViewController: self) diff --git a/Example/JJFloatingActionButton/CircularExampleViewController.swift b/Example/JJFloatingActionButton/CircularExampleViewController.swift index 080112c5..18722172 100644 --- a/Example/JJFloatingActionButton/CircularExampleViewController.swift +++ b/Example/JJFloatingActionButton/CircularExampleViewController.swift @@ -25,7 +25,7 @@ import JJFloatingActionButton import UIKit -internal class CircularExampleViewController: UIViewController { +class CircularExampleViewController: UIViewController { fileprivate let actionButton = JJFloatingActionButton() override func viewDidLoad() { @@ -36,20 +36,20 @@ internal class CircularExampleViewController: UIViewController { actionButton.buttonAnimationConfiguration.opening.duration = 0.8 actionButton.buttonAnimationConfiguration.closing.duration = 0.6 - actionButton.addItem(image: #imageLiteral(resourceName: "Baloon")) { item in - Helper.showAlert(for: item) + actionButton.addItem(image: #imageLiteral(resourceName: "Balloon")) { item in + self.showAlert(for: item) } actionButton.addItem(image: #imageLiteral(resourceName: "Like")) { item in - Helper.showAlert(for: item) + self.showAlert(for: item) } actionButton.addItem(image: #imageLiteral(resourceName: "Owl")) { item in - Helper.showAlert(for: item) + self.showAlert(for: item) } - actionButton.addItem(image: #imageLiteral(resourceName: "Favourite")) { item in - Helper.showAlert(for: item) + actionButton.addItem(image: #imageLiteral(resourceName: "Favorite")) { item in + self.showAlert(for: item) } actionButton.display(inViewController: self) diff --git a/Example/JJFloatingActionButton/ConfigurationExampleViewController.swift b/Example/JJFloatingActionButton/ConfigurationExampleViewController.swift index 461a095a..7346f3cc 100644 --- a/Example/JJFloatingActionButton/ConfigurationExampleViewController.swift +++ b/Example/JJFloatingActionButton/ConfigurationExampleViewController.swift @@ -25,7 +25,7 @@ import JJFloatingActionButton import UIKit -internal class ConfigurationExampleViewController: UIViewController { +class ConfigurationExampleViewController: UIViewController { fileprivate let actionButton = JJFloatingActionButton() override func viewDidLoad() { @@ -36,13 +36,14 @@ internal class ConfigurationExampleViewController: UIViewController { view.addSubview(actionButton) actionButton.translatesAutoresizingMaskIntoConstraints = false - if #available(iOS 11.0, *) { - actionButton.leadingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.leadingAnchor, constant: 16).isActive = true - actionButton.bottomAnchor.constraint(equalTo: view.safeAreaLayoutGuide.bottomAnchor, constant: -16).isActive = true - } else { - actionButton.leadingAnchor.constraint(equalTo: view.leadingAnchor, constant: 16).isActive = true - actionButton.bottomAnchor.constraint(equalTo: bottomLayoutGuide.topAnchor, constant: -16).isActive = true - } + actionButton.leadingAnchor.constraint( + equalTo: view.safeAreaLayoutGuide.leadingAnchor, + constant: 16 + ).isActive = true + actionButton.bottomAnchor.constraint( + equalTo: view.safeAreaLayoutGuide.bottomAnchor, + constant: -16 + ).isActive = true } fileprivate func configureActionButton() { @@ -82,12 +83,12 @@ internal class ConfigurationExampleViewController: UIViewController { } fileprivate func addItems() { - actionButton.addItem(title: "Balloon", image: #imageLiteral(resourceName: "Baloon")) { item in - Helper.showAlert(for: item) + actionButton.addItem(title: "Balloon", image: #imageLiteral(resourceName: "Balloon")) { item in + self.showAlert(for: item) } actionButton.addItem(title: "Like", image: #imageLiteral(resourceName: "Like")) { item in - Helper.showAlert(for: item) + self.showAlert(for: item) } let owlItem = actionButton.addItem() @@ -96,17 +97,17 @@ internal class ConfigurationExampleViewController: UIViewController { owlItem.buttonColor = .black owlItem.buttonImageColor = .white owlItem.action = { item in - Helper.showAlert(for: item) + self.showAlert(for: item) } let heartItem = actionButton.addItem() heartItem.titleLabel.text = "Heart" - heartItem.imageView.image = #imageLiteral(resourceName: "Favourite") + heartItem.imageView.image = #imageLiteral(resourceName: "Favorite") heartItem.buttonColor = .clear heartItem.buttonImageColor = .red heartItem.imageSize = CGSize(width: 30, height: 30) heartItem.action = { item in - Helper.showAlert(for: item) + self.showAlert(for: item) } } } diff --git a/Example/JJFloatingActionButton/DownwardsExampleViewController.swift b/Example/JJFloatingActionButton/DownwardsExampleViewController.swift index a0ec9aab..74e5ab22 100644 --- a/Example/JJFloatingActionButton/DownwardsExampleViewController.swift +++ b/Example/JJFloatingActionButton/DownwardsExampleViewController.swift @@ -25,7 +25,7 @@ import JJFloatingActionButton import UIKit -internal class DownwardsExampleViewController: UIViewController { +class DownwardsExampleViewController: UIViewController { fileprivate let actionButton = JJFloatingActionButton() override func viewDidLoad() { @@ -43,27 +43,23 @@ internal class DownwardsExampleViewController: UIViewController { } actionButton.itemAnimationConfiguration = configuration - actionButton.addItem(title: "Heart", image: #imageLiteral(resourceName: "Favourite")) { item in - Helper.showAlert(for: item) + actionButton.addItem(title: "Heart", image: #imageLiteral(resourceName: "Favorite")) { item in + self.showAlert(for: item) } actionButton.addItem(title: "Like", image: #imageLiteral(resourceName: "Like")) { item in - Helper.showAlert(for: item) + self.showAlert(for: item) } - actionButton.addItem(title: "Balloon", image: #imageLiteral(resourceName: "Baloon")) { item in - Helper.showAlert(for: item) + actionButton.addItem(title: "Balloon", image: #imageLiteral(resourceName: "Balloon")) { item in + self.showAlert(for: item) } view.addSubview(actionButton) actionButton.translatesAutoresizingMaskIntoConstraints = false - if #available(iOS 11.0, *) { - actionButton.trailingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.trailingAnchor, constant: -16).isActive = true - actionButton.topAnchor.constraint(equalTo: view.safeAreaLayoutGuide.topAnchor, constant: 16).isActive = true - } else { - actionButton.trailingAnchor.constraint(equalTo: view.trailingAnchor, constant: -16).isActive = true - actionButton.topAnchor.constraint(equalTo: topLayoutGuide.bottomAnchor, constant: 16).isActive = true - } + + actionButton.trailingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.trailingAnchor, constant: -16).isActive = true + actionButton.topAnchor.constraint(equalTo: view.safeAreaLayoutGuide.topAnchor, constant: 16).isActive = true } } diff --git a/Example/JJFloatingActionButton/Helper.swift b/Example/JJFloatingActionButton/Helper.swift index c5714363..759cea2d 100644 --- a/Example/JJFloatingActionButton/Helper.swift +++ b/Example/JJFloatingActionButton/Helper.swift @@ -25,18 +25,14 @@ import JJFloatingActionButton import UIKit -internal struct Helper { - static func showAlert(for item: JJActionItem) { +extension UIViewController { + func showAlert(for item: JJActionItem) { showAlert(title: item.titleLabel.text, message: "Item tapped!") } - static func showAlert(title: String?, message: String?) { + func showAlert(title: String?, message: String?) { let alertController = UIAlertController(title: title, message: message, preferredStyle: .alert) alertController.addAction(UIAlertAction(title: "OK", style: .default, handler: nil)) - rootViewController?.present(alertController, animated: true, completion: nil) - } - - static var rootViewController: UIViewController? { - return UIApplication.shared.keyWindow?.rootViewController + present(alertController, animated: true, completion: nil) } } diff --git a/Example/JJFloatingActionButton/Info.plist b/Example/JJFloatingActionButton/Info.plist index 4365ea7b..bcffc675 100644 --- a/Example/JJFloatingActionButton/Info.plist +++ b/Example/JJFloatingActionButton/Info.plist @@ -32,6 +32,8 @@ UIStatusBarStyle UIStatusBarStyleLightContent + UIViewControllerBasedStatusBarAppearance + UIStatusBarTintParameters UINavigationBar diff --git a/Example/JJFloatingActionButton/InterfaceBuilderExampleViewController.swift b/Example/JJFloatingActionButton/InterfaceBuilderExampleViewController.swift index 52a2aedb..1392c311 100644 --- a/Example/JJFloatingActionButton/InterfaceBuilderExampleViewController.swift +++ b/Example/JJFloatingActionButton/InterfaceBuilderExampleViewController.swift @@ -31,16 +31,16 @@ class InterfaceBuilderExampleViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() - actionButton.addItem(title: "Heart", image: #imageLiteral(resourceName: "Favourite")) { item in - Helper.showAlert(for: item) + actionButton.addItem(title: "Heart", image: #imageLiteral(resourceName: "Favorite")) { item in + self.showAlert(for: item) } actionButton.addItem(title: "Owl", image: #imageLiteral(resourceName: "Owl")) { item in - Helper.showAlert(for: item) + self.showAlert(for: item) } - actionButton.addItem(title: "Balloon", image: #imageLiteral(resourceName: "Baloon")) { item in - Helper.showAlert(for: item) + actionButton.addItem(title: "Balloon", image: #imageLiteral(resourceName: "Balloon")) { item in + self.showAlert(for: item) } } } diff --git a/Example/JJFloatingActionButton/SingleItemExampleViewController.swift b/Example/JJFloatingActionButton/SingleItemExampleViewController.swift index 90bdd9c5..c1471303 100644 --- a/Example/JJFloatingActionButton/SingleItemExampleViewController.swift +++ b/Example/JJFloatingActionButton/SingleItemExampleViewController.swift @@ -25,7 +25,7 @@ import JJFloatingActionButton import UIKit -internal class SingleItemExampleViewController: UIViewController { +class SingleItemExampleViewController: UIViewController { fileprivate let actionButton = JJFloatingActionButton() override func viewDidLoad() { @@ -33,8 +33,8 @@ internal class SingleItemExampleViewController: UIViewController { actionButton.buttonColor = .red - actionButton.addItem(title: "Heart", image: #imageLiteral(resourceName: "Favourite")) { item in - Helper.showAlert(for: item) + actionButton.addItem(title: "Heart", image: #imageLiteral(resourceName: "Favorite")) { item in + self.showAlert(for: item) } actionButton.display(inViewController: self) diff --git a/Example/Podfile b/Example/Podfile index 007ebd08..3dad02ad 100644 --- a/Example/Podfile +++ b/Example/Podfile @@ -1,5 +1,8 @@ +source 'https://cdn.cocoapods.org/' project 'JJFloatingActionButton.xcodeproj' -platform :ios, '9.3' + +deployment_target = '13.0' +platform :ios, deployment_target target 'JJFloatingActionButton_Example' do use_frameworks! @@ -17,3 +20,12 @@ target 'JJFloatingActionButton_Example' do end end + + +post_install do |installer| + installer.pods_project.targets.each do |target| + target.build_configurations.each do |config| + config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = deployment_target + end + end +end diff --git a/Example/Podfile.lock b/Example/Podfile.lock index c7ca0d09..03599537 100644 --- a/Example/Podfile.lock +++ b/Example/Podfile.lock @@ -1,17 +1,17 @@ PODS: - - iOSSnapshotTestCase (5.0.2): - - iOSSnapshotTestCase/SwiftSupport (= 5.0.2) - - iOSSnapshotTestCase/Core (5.0.2) - - iOSSnapshotTestCase/SwiftSupport (5.0.2): + - iOSSnapshotTestCase (8.0.0): + - iOSSnapshotTestCase/SwiftSupport (= 8.0.0) + - iOSSnapshotTestCase/Core (8.0.0) + - iOSSnapshotTestCase/SwiftSupport (8.0.0): - iOSSnapshotTestCase/Core - JJFloatingActionButton (2.5.0) - - Nimble (7.3.4) - - Nimble-Snapshots (6.9.1): - - Nimble-Snapshots/Core (= 6.9.1) - - Nimble-Snapshots/Core (6.9.1): - - iOSSnapshotTestCase (~> 5.0) - - Nimble (~> 7.0) - - Quick (2.2.0) + - Nimble (12.3.0) + - Nimble-Snapshots (9.6.1): + - Nimble-Snapshots/Core (= 9.6.1) + - Nimble-Snapshots/Core (9.6.1): + - iOSSnapshotTestCase (~> 8.0) + - Nimble (~> 12.0) + - Quick (7.3.0) DEPENDENCIES: - JJFloatingActionButton (from `../`) @@ -31,12 +31,12 @@ EXTERNAL SOURCES: :path: "../" SPEC CHECKSUMS: - iOSSnapshotTestCase: 2d51aa06775e95cecb0a1fb9c5c159ccd1dd4596 - JJFloatingActionButton: fdc3aefb0f28f04d0f988fa25d5fac97028a9ea7 - Nimble: 051e3d8912d40138fa5591c78594f95fb172af37 - Nimble-Snapshots: bbd1ab264bacc24a9ce24a8363bc05aac783aeb0 - Quick: 7fb19e13be07b5dfb3b90d4f9824c855a11af40e + iOSSnapshotTestCase: a670511f9ee3829c2b9c23e6e68f315fd7b6790f + JJFloatingActionButton: c65b1208dee78ae5a2eac788e7fed813b8c20899 + Nimble: f8a8219d16f176429b951e8f7e72df5c23ceddc0 + Nimble-Snapshots: 4988d1cf2fe062f13bd2eb87c4279770785e682b + Quick: d32871931c05547cb4e0bc9009d66a18b50d8558 -PODFILE CHECKSUM: 8c19971bc03b1102942bae8dc764247c0986032d +PODFILE CHECKSUM: 5d5324029f5754abc86b08c38bafd3135e1b98f9 -COCOAPODS: 1.9.1 +COCOAPODS: 1.14.3 diff --git a/Example/Tests/AnimationConfigurationSpec.swift b/Example/Tests/AnimationConfigurationSpec.swift index bdff3347..7b7ef2b9 100644 --- a/Example/Tests/AnimationConfigurationSpec.swift +++ b/Example/Tests/AnimationConfigurationSpec.swift @@ -26,17 +26,17 @@ import Nimble import Nimble_Snapshots import Quick +import XCTest class AnimationConfigurationSpec: QuickSpec { - override func spec() { + let pixelTolerance = 0.5 + override class func spec() { describe("JJFloatingActionButton") { var actionButton: JJFloatingActionButton! var superview: UIView! beforeEach { - assert(UIApplication.shared.keyWindow != nil) - let windowWidth = UIApplication.shared.keyWindow!.bounds.size.width - + let windowWidth = UIWindow.key?.bounds.size.width ?? 0 var superviewFrame = CGRect(origin: .zero, size: CGSize(width: 200, height: 300)) superviewFrame.origin.x = windowWidth - superviewFrame.size.width let actionButtonFrame = CGRect(origin: CGPoint(x: 130, y: 230), size: CGSize(width: 56, height: 56)) @@ -48,7 +48,7 @@ class AnimationConfigurationSpec: QuickSpec { superview.addSubview(actionButton) actionButton.addItem(image: #imageLiteral(resourceName: "Like")) - actionButton.addItem(image: #imageLiteral(resourceName: "Baloon")) + actionButton.addItem(image: #imageLiteral(resourceName: "Balloon")) actionButton.addItem(image: #imageLiteral(resourceName: "Owl")) setNimbleTolerance(0.003) @@ -71,7 +71,7 @@ class AnimationConfigurationSpec: QuickSpec { it("it looks correct") { actionButton.open(animated: false) - expect(superview) == snapshot() + expect(superview).to(haveValidSnapshot(pixelTolerance: 0.01)) } } @@ -84,7 +84,7 @@ class AnimationConfigurationSpec: QuickSpec { it("it looks correct") { actionButton.open(animated: false) - expect(superview) == snapshot() + expect(superview).to(haveValidSnapshot(pixelTolerance: 0.01)) } } @@ -96,7 +96,7 @@ class AnimationConfigurationSpec: QuickSpec { it("it looks correct") { actionButton.open(animated: false) - expect(superview) == snapshot() + expect(superview).to(haveValidSnapshot(pixelTolerance: 0.01)) } } @@ -109,21 +109,21 @@ class AnimationConfigurationSpec: QuickSpec { it("it looks correct with 3 items") { actionButton.addItem(image: #imageLiteral(resourceName: "Like")) - actionButton.addItem(image: #imageLiteral(resourceName: "Baloon")) + actionButton.addItem(image: #imageLiteral(resourceName: "Balloon")) actionButton.addItem(image: #imageLiteral(resourceName: "Owl")) actionButton.open(animated: false) - expect(superview) == snapshot() + expect(superview).to(haveValidSnapshot(pixelTolerance: 0.01)) } it("it looks correct with 2 items") { actionButton.addItem(image: #imageLiteral(resourceName: "Like")) - actionButton.addItem(image: #imageLiteral(resourceName: "Baloon")) + actionButton.addItem(image: #imageLiteral(resourceName: "Balloon")) actionButton.open(animated: false) - expect(superview) == snapshot() + expect(superview).to(haveValidSnapshot(pixelTolerance: 0.01)) } it("it looks correct with 1 item") { @@ -132,7 +132,7 @@ class AnimationConfigurationSpec: QuickSpec { actionButton.open(animated: false) - expect(superview) == snapshot() + expect(superview).to(haveValidSnapshot(pixelTolerance: 0.01)) } it("looks correct when item have background color") { @@ -141,23 +141,23 @@ class AnimationConfigurationSpec: QuickSpec { } actionButton.addItem(image: #imageLiteral(resourceName: "Like")) - actionButton.addItem(image: #imageLiteral(resourceName: "Baloon")) + actionButton.addItem(image: #imageLiteral(resourceName: "Balloon")) actionButton.addItem(title: "title", image: #imageLiteral(resourceName: "Owl")) actionButton.open(animated: false) - expect(superview) == snapshot() + expect(superview).to(haveValidSnapshot(pixelTolerance: 0.01)) } it("it looks correct when opened and closed") { actionButton.addItem(image: #imageLiteral(resourceName: "Like")) - actionButton.addItem(image: #imageLiteral(resourceName: "Baloon")) + actionButton.addItem(image: #imageLiteral(resourceName: "Balloon")) actionButton.addItem(image: #imageLiteral(resourceName: "Owl")) actionButton.open(animated: false) actionButton.close(animated: false) - expect(superview) == snapshot() + expect(superview).to(haveValidSnapshot(pixelTolerance: 0.01)) } } @@ -170,7 +170,7 @@ class AnimationConfigurationSpec: QuickSpec { it("it looks correct") { actionButton.open(animated: false) - expect(superview) == snapshot() + expect(superview).to(haveValidSnapshot(pixelTolerance: 0.01)) } } @@ -190,7 +190,7 @@ class AnimationConfigurationSpec: QuickSpec { actionButton.open(animated: false) - expect(superview) == snapshot() + expect(superview).to(haveValidSnapshot(pixelTolerance: 0.01)) } it("it looks correct with horizontal offset") { @@ -199,7 +199,7 @@ class AnimationConfigurationSpec: QuickSpec { actionButton.open(animated: false) - expect(superview) == snapshot() + expect(superview).to(haveValidSnapshot(pixelTolerance: 0.01)) } it("it looks correct with items offsetted") { @@ -208,7 +208,7 @@ class AnimationConfigurationSpec: QuickSpec { actionButton.open(animated: false) - expect(superview) == snapshot() + expect(superview).to(haveValidSnapshot(pixelTolerance: 0.01)) } it("it looks correct with circular offset items") { @@ -217,7 +217,7 @@ class AnimationConfigurationSpec: QuickSpec { actionButton.open(animated: false) - expect(superview) == snapshot() + expect(superview).to(haveValidSnapshot(pixelTolerance: 0.01)) } } } @@ -237,7 +237,7 @@ class AnimationConfigurationSpec: QuickSpec { superview.addSubview(actionButton) actionButton.addItem(image: #imageLiteral(resourceName: "Like")) - actionButton.addItem(image: #imageLiteral(resourceName: "Baloon")) + actionButton.addItem(image: #imageLiteral(resourceName: "Balloon")) actionButton.addItem(image: #imageLiteral(resourceName: "Owl")) setNimbleTolerance(0.002) @@ -256,21 +256,21 @@ class AnimationConfigurationSpec: QuickSpec { it("it looks correct with 3 items") { actionButton.addItem(image: #imageLiteral(resourceName: "Like")) - actionButton.addItem(image: #imageLiteral(resourceName: "Baloon")) + actionButton.addItem(image: #imageLiteral(resourceName: "Balloon")) actionButton.addItem(image: #imageLiteral(resourceName: "Owl")) actionButton.open(animated: false) - expect(superview) == snapshot() + expect(superview).to(haveValidSnapshot(pixelTolerance: 0.01)) } it("it looks correct with 2 items") { actionButton.addItem(image: #imageLiteral(resourceName: "Like")) - actionButton.addItem(image: #imageLiteral(resourceName: "Baloon")) + actionButton.addItem(image: #imageLiteral(resourceName: "Balloon")) actionButton.open(animated: false) - expect(superview) == snapshot() + expect(superview).to(haveValidSnapshot(pixelTolerance: 0.01)) } it("it looks correct with 1 item") { @@ -279,7 +279,7 @@ class AnimationConfigurationSpec: QuickSpec { actionButton.open(animated: false) - expect(superview) == snapshot() + expect(superview).to(haveValidSnapshot(pixelTolerance: 0.01)) } } @@ -299,7 +299,7 @@ class AnimationConfigurationSpec: QuickSpec { actionButton.open(animated: false) - expect(superview) == snapshot() + expect(superview).to(haveValidSnapshot(pixelTolerance: 0.01)) } it("it looks correct with items offsetted") { @@ -308,7 +308,7 @@ class AnimationConfigurationSpec: QuickSpec { actionButton.open(animated: false) - expect(superview) == snapshot() + expect(superview).to(haveValidSnapshot(pixelTolerance: 0.01)) } it("it looks correct with circular offset items") { @@ -317,7 +317,7 @@ class AnimationConfigurationSpec: QuickSpec { actionButton.open(animated: false) - expect(superview) == snapshot() + expect(superview).to(haveValidSnapshot(pixelTolerance: 0.01)) } } @@ -335,20 +335,20 @@ class AnimationConfigurationSpec: QuickSpec { let item1 = actionButton.addItem(title: "leading", image: #imageLiteral(resourceName: "Like")) item1.titlePosition = .leading - let item2 = actionButton.addItem(title: "trailing", image: #imageLiteral(resourceName: "Baloon")) + let item2 = actionButton.addItem(title: "trailing", image: #imageLiteral(resourceName: "Balloon")) item2.titlePosition = .trailing let item3 = actionButton.addItem(title: "right", image: #imageLiteral(resourceName: "Like")) item3.titlePosition = .right - let item4 = actionButton.addItem(title: "left", image: #imageLiteral(resourceName: "Baloon")) + let item4 = actionButton.addItem(title: "left", image: #imageLiteral(resourceName: "Balloon")) item4.titlePosition = .left - let item5 = actionButton.addItem(title: "hidden", image: #imageLiteral(resourceName: "Baloon")) + let item5 = actionButton.addItem(title: "hidden", image: #imageLiteral(resourceName: "Balloon")) item5.titlePosition = .hidden } it("looks correct") { actionButton.open(animated: false) - expect(superview) == snapshot() + expect(superview).to(haveValidSnapshot(pixelTolerance: 0.01)) } // disabled for now. Fails on older operating systems. ToDo! @@ -362,7 +362,7 @@ class AnimationConfigurationSpec: QuickSpec { actionButton.open(animated: false) - expect(superview) == snapshot() + expect(superview).to(haveValidSnapshot()) } } } diff --git a/Example/Tests/JJActionItemAppearanceSpec.swift b/Example/Tests/JJActionItemAppearanceSpec.swift index 79d18a9e..dcda71d7 100644 --- a/Example/Tests/JJActionItemAppearanceSpec.swift +++ b/Example/Tests/JJActionItemAppearanceSpec.swift @@ -27,9 +27,10 @@ import Foundation import Nimble import Nimble_Snapshots import Quick +import XCTest class JJActionItemAppearanceSpec: QuickSpec { - override func spec() { + override class func spec() { describe("JJActionItem") { var item: JJActionItem! diff --git a/Example/Tests/JJActionItemSpec.swift b/Example/Tests/JJActionItemSpec.swift index 0cef78f9..6b9d5c44 100644 --- a/Example/Tests/JJActionItemSpec.swift +++ b/Example/Tests/JJActionItemSpec.swift @@ -26,9 +26,10 @@ import Nimble import Nimble_Snapshots import Quick +import XCTest class JJActionItemSpec: QuickSpec { - override func spec() { + override class func spec() { describe("JJActionItem") { var actionItem: JJActionItem! @@ -47,71 +48,71 @@ class JJActionItemSpec: QuickSpec { } it("looks correct") { - expect(actionItem) == snapshot() + expect(actionItem).to(haveValidSnapshot()) } it("looks correct with title position leading") { actionItem.titlePosition = .leading - expect(actionItem) == snapshot() + expect(actionItem).to(haveValidSnapshot()) } it("looks correct with title position trailing") { actionItem.titlePosition = .trailing - expect(actionItem) == snapshot() + expect(actionItem).to(haveValidSnapshot()) } it("looks correct with title position left") { actionItem.titlePosition = .left - expect(actionItem) == snapshot() + expect(actionItem).to(haveValidSnapshot()) } it("looks correct with title position right") { actionItem.titlePosition = .right - expect(actionItem) == snapshot() + expect(actionItem).to(haveValidSnapshot()) } it("looks correct with title position top") { actionItem.titlePosition = .top - expect(actionItem) == snapshot() + expect(actionItem).to(haveValidSnapshot()) } it("looks correct with title position bottom") { actionItem.titlePosition = .bottom - expect(actionItem) == snapshot() + expect(actionItem).to(haveValidSnapshot()) } it("looks correct with title position hidden") { actionItem.titlePosition = .hidden - expect(actionItem) == snapshot() + expect(actionItem).to(haveValidSnapshot()) } it("looks correct with horizontal title spacing configured") { actionItem.titlePosition = .leading actionItem.titleSpacing = 42 - expect(actionItem) == snapshot() + expect(actionItem).to(haveValidSnapshot()) } it("looks correct with vertical title spacing configured") { actionItem.titlePosition = .bottom actionItem.titleSpacing = 42 - expect(actionItem) == snapshot() + expect(actionItem).to(haveValidSnapshot()) } it("looks correct with empty title") { actionItem.titleLabel.text = "" - expect(actionItem) == snapshot() + expect(actionItem).to(haveValidSnapshot()) } it("looks correct with smaller image size") { setNimbleTolerance(0.005) actionItem.imageSize = CGSize(width: 10, height: 10) - expect(actionItem) == snapshot() + expect(actionItem).to(haveValidSnapshot()) } it("looks correct with bigger image size") { setNimbleTolerance(0.025) actionItem.imageSize = CGSize(width: 30, height: 30) - expect(actionItem) == snapshot() + expect(actionItem).to(haveValidSnapshot()) } } @@ -119,7 +120,7 @@ class JJActionItemSpec: QuickSpec { var actionItem: JJActionItem? beforeEach { - let bundle = Bundle(for: type(of: self)) + let bundle = Bundle(for: Self.self) actionItem = bundle.loadNibNamed("JJActionItem", owner: nil)?.first as? JJActionItem actionItem?.titleLabel.font = UIFont(name: "Courier", size: 12) @@ -135,7 +136,7 @@ class JJActionItemSpec: QuickSpec { } it("looks correct") { - expect(actionItem) == snapshot() + expect(actionItem).to(haveValidSnapshot()) } } } diff --git a/Example/Tests/JJCircleViewSpec.swift b/Example/Tests/JJCircleViewSpec.swift index 5b7eda62..1b571d23 100644 --- a/Example/Tests/JJCircleViewSpec.swift +++ b/Example/Tests/JJCircleViewSpec.swift @@ -26,15 +26,16 @@ import Nimble import Nimble_Snapshots import Quick +import XCTest class JJCircleViewSpec: QuickSpec { - override func spec() { + override class func spec() { describe("JJCircleView") { var circleView: JJCircleView? context("loaded from xib") { beforeEach { - let bundle = Bundle(for: type(of: self)) + let bundle = Bundle(for: Self.self) circleView = bundle.loadNibNamed("JJCircleView", owner: nil, options: nil)?.first as? JJCircleView } @@ -43,7 +44,7 @@ class JJCircleViewSpec: QuickSpec { } it("looks correct") { - expect(circleView) == snapshot() + expect(circleView).to(haveValidSnapshot()) } } @@ -57,7 +58,7 @@ class JJCircleViewSpec: QuickSpec { } it("looks correct") { - expect(circleView) == snapshot() + expect(circleView).to(haveValidSnapshot()) } } } diff --git a/Example/Tests/JJFloatingActionButtonAppearanceSpec.swift b/Example/Tests/JJFloatingActionButtonAppearanceSpec.swift index 787f998f..61f0494d 100644 --- a/Example/Tests/JJFloatingActionButtonAppearanceSpec.swift +++ b/Example/Tests/JJFloatingActionButtonAppearanceSpec.swift @@ -27,9 +27,10 @@ import Foundation import Nimble import Nimble_Snapshots import Quick +import XCTest class JJFloatingActionButtonAppearanceSpec: QuickSpec { - override func spec() { + override class func spec() { describe("JJFloatingActionButton") { var actionButton: JJFloatingActionButton! diff --git a/Example/Tests/JJFloatingActionButtonDelegateSpec.swift b/Example/Tests/JJFloatingActionButtonDelegateSpec.swift index 8e90b526..bcb03532 100644 --- a/Example/Tests/JJFloatingActionButtonDelegateSpec.swift +++ b/Example/Tests/JJFloatingActionButtonDelegateSpec.swift @@ -26,9 +26,10 @@ import Nimble import Nimble_Snapshots import Quick +import XCTest class JJFloatingActionButtonDelegateSpec: QuickSpec { - override func spec() { + override class func spec() { describe("JJFloatingActionButton") { var superview: UIView! var actionButton: JJFloatingActionButton! diff --git a/Example/Tests/JJFloatingActionButtonPlacementSpec.swift b/Example/Tests/JJFloatingActionButtonPlacementSpec.swift index aeb6ee5a..d48822b8 100644 --- a/Example/Tests/JJFloatingActionButtonPlacementSpec.swift +++ b/Example/Tests/JJFloatingActionButtonPlacementSpec.swift @@ -1,5 +1,5 @@ // -// JJFloatingActionButtonPlacementSpecs.swift +// JJFloatingActionButtonPlacementSpec.swift // // Copyright (c) 2017-Present Jochen Pfeiffer // @@ -27,9 +27,10 @@ import Foundation import Nimble import Nimble_Snapshots import Quick +import XCTest class JJFloatingActionButtonPlacementSpec: QuickSpec { - override func spec() { + override class func spec() { describe("JJFloatingActionButton") { var actionButton: JJFloatingActionButton! var viewController: UIViewController! diff --git a/Example/Tests/JJFloatingActionButtonSpec.swift b/Example/Tests/JJFloatingActionButtonSpec.swift index 9e50cfdb..3df5ffd8 100644 --- a/Example/Tests/JJFloatingActionButtonSpec.swift +++ b/Example/Tests/JJFloatingActionButtonSpec.swift @@ -26,9 +26,10 @@ import Nimble import Nimble_Snapshots import Quick +import XCTest class JJFloatingActionButtonSpec: QuickSpec { - override func spec() { + override class func spec() { describe("JJFloatingActionButton") { let superviewFrame = CGRect(origin: .zero, size: CGSize(width: 200, height: 300)) let actionButtonFrame = CGRect(origin: CGPoint(x: 130, y: 230), size: CGSize(width: 56, height: 56)) @@ -57,13 +58,13 @@ class JJFloatingActionButtonSpec: QuickSpec { } it("looks correct by default") { - expect(superview) == snapshot() + expect(superview).to(haveValidSnapshot(pixelTolerance: 0.01)) } it("looks correct highlighted") { actionButton.isHighlighted = true expect(actionButton.isHighlighted).to(beTrue()) - expect(superview) == snapshot() + expect(superview).to(haveValidSnapshot(pixelTolerance: 0.01)) } it("looks correct highlighted with dark color") { @@ -71,7 +72,7 @@ class JJFloatingActionButtonSpec: QuickSpec { actionButton.highlightedButtonColor = nil actionButton.isHighlighted = true expect(actionButton.isHighlighted).to(beTrue()) - expect(superview) == snapshot() + expect(superview).to(haveValidSnapshot(pixelTolerance: 0.01)) } it("looks correct highlighted with light color") { @@ -79,21 +80,21 @@ class JJFloatingActionButtonSpec: QuickSpec { actionButton.highlightedButtonColor = nil actionButton.isHighlighted = true expect(actionButton.isHighlighted).to(beTrue()) - expect(superview) == snapshot() + expect(superview).to(haveValidSnapshot(pixelTolerance: 0.01)) } it("looks correct highlighted with custom color") { actionButton.highlightedButtonColor = .orange actionButton.isHighlighted = true expect(actionButton.isHighlighted).to(beTrue()) - expect(superview) == snapshot() + expect(superview).to(haveValidSnapshot(pixelTolerance: 0.01)) } it("looks correct configured") { actionButton.buttonColor = .blue actionButton.highlightedButtonColor = .orange actionButton.buttonImage = #imageLiteral(resourceName: "Like").withRenderingMode(.alwaysTemplate) - actionButton.buttonAnimationConfiguration = .transition(toImage: #imageLiteral(resourceName: "Baloon")) + actionButton.buttonAnimationConfiguration = .transition(toImage: #imageLiteral(resourceName: "Balloon")) actionButton.buttonImageColor = .red actionButton.shadowColor = .orange actionButton.shadowOffset = CGSize(width: -5, height: -5) @@ -115,19 +116,19 @@ class JJFloatingActionButtonSpec: QuickSpec { actionButton.itemAnimationConfiguration = .popUp(withInterItemSpacing: 7) actionButton.addItem(title: "item 1", image: #imageLiteral(resourceName: "Like").withRenderingMode(.alwaysTemplate)) - actionButton.addItem(title: "item 2", image: #imageLiteral(resourceName: "Baloon").withRenderingMode(.alwaysTemplate)) + actionButton.addItem(title: "item 2", image: #imageLiteral(resourceName: "Balloon").withRenderingMode(.alwaysTemplate)) actionButton.open(animated: false) - expect(superview) == snapshot() + expect(superview).to(haveValidSnapshot(pixelTolerance: 0.01)) } it("looks correct configured after adding the items") { actionButton.addItem(title: "item 1", image: #imageLiteral(resourceName: "Like").withRenderingMode(.alwaysTemplate)) - actionButton.addItem(title: "item 2", image: #imageLiteral(resourceName: "Baloon").withRenderingMode(.alwaysTemplate)) + actionButton.addItem(title: "item 2", image: #imageLiteral(resourceName: "Balloon").withRenderingMode(.alwaysTemplate)) actionButton.buttonColor = .blue - actionButton.buttonImage = #imageLiteral(resourceName: "Baloon").withRenderingMode(.alwaysTemplate) + actionButton.buttonImage = #imageLiteral(resourceName: "Balloon").withRenderingMode(.alwaysTemplate) actionButton.buttonAnimationConfiguration = .rotation(toAngle: -CGFloat.pi / 5) actionButton.buttonImageColor = .red actionButton.shadowColor = .orange @@ -151,7 +152,7 @@ class JJFloatingActionButtonSpec: QuickSpec { actionButton.open(animated: false) - expect(superview) == snapshot() + expect(superview).to(haveValidSnapshot(pixelTolerance: 0.01)) } it("looks correct with items configured with closure") { @@ -170,29 +171,29 @@ class JJFloatingActionButtonSpec: QuickSpec { item.layer.shadowRadius = 0 } - actionButton.addItem(title: "456", image: #imageLiteral(resourceName: "Baloon")) + actionButton.addItem(title: "456", image: #imageLiteral(resourceName: "Balloon")) actionButton.open(animated: false) - expect(superview) == snapshot() + expect(superview).to(haveValidSnapshot()) } it("looks correct when only image color is changed") { actionButton.buttonImageColor = .red actionButton.addItem(title: "123", image: #imageLiteral(resourceName: "Like")) - actionButton.addItem(title: "456", image: #imageLiteral(resourceName: "Baloon")) + actionButton.addItem(title: "456", image: #imageLiteral(resourceName: "Balloon")) actionButton.open(animated: false) - expect(superview) == snapshot() + expect(superview).to(haveValidSnapshot(pixelTolerance: 0.01)) } it("looks correct with smaller image size") { actionButton.buttonImageSize = CGSize(width: 10, height: 10) - expect(superview) == snapshot() + expect(superview).to(haveValidSnapshot(pixelTolerance: 0.01)) } it("looks correct with bigger image size") { actionButton.buttonImageSize = CGSize(width: 40, height: 40) - expect(superview) == snapshot() + expect(superview).to(haveValidSnapshot(pixelTolerance: 0.01)) } context("when multiple items are added") { @@ -203,7 +204,7 @@ class JJFloatingActionButtonSpec: QuickSpec { actionButton.addItem(title: "item 1", image: #imageLiteral(resourceName: "Like").withRenderingMode(.alwaysTemplate)) { _ in actionCount += 1 } - actionButton.addItem(title: "item 2", image: #imageLiteral(resourceName: "Baloon").withRenderingMode(.alwaysTemplate)) + actionButton.addItem(title: "item 2", image: #imageLiteral(resourceName: "Balloon").withRenderingMode(.alwaysTemplate)) } it("opens when tapped") { @@ -237,14 +238,14 @@ class JJFloatingActionButtonSpec: QuickSpec { } it("items look correct") { - expect(superview) == snapshot() + expect(superview).to(haveValidSnapshot(pixelTolerance: 0.01)) } it("items look correct highlighted") { let item = actionButton.items[0] item.isHighlighted = true expect(item.isHighlighted).to(beTrue()) - expect(superview) == snapshot() + expect(superview).to(haveValidSnapshot(pixelTolerance: 0.01)) } it("items look correct highlighted with custom highlighted color") { @@ -252,7 +253,7 @@ class JJFloatingActionButtonSpec: QuickSpec { item.circleView.highlightedColor = .purple item.isHighlighted = true expect(item.isHighlighted).to(beTrue()) - expect(superview) == snapshot() + expect(superview).to(haveValidSnapshot(pixelTolerance: 0.01)) } it("can't be opened again") { @@ -282,7 +283,7 @@ class JJFloatingActionButtonSpec: QuickSpec { } it("does not perform action") { - waitUntil(timeout: 1.5) +// waitUntil(timeout: 1.5) expect(actionCount) == 0 } } @@ -369,7 +370,7 @@ class JJFloatingActionButtonSpec: QuickSpec { } it("looks correct") { - expect(superview) == snapshot() + expect(superview).to(haveValidSnapshot(pixelTolerance: 0.01)) } it("can't be closed again") { @@ -528,7 +529,7 @@ class JJFloatingActionButtonSpec: QuickSpec { it("looks correct when opened") { actionButton.open(animated: false) - expect(superview) == snapshot() + expect(superview).to(haveValidSnapshot(pixelTolerance: 0.01)) } } @@ -546,12 +547,12 @@ class JJFloatingActionButtonSpec: QuickSpec { } it("looks correct") { - expect(superview) == snapshot() + expect(superview).to(haveValidSnapshot(pixelTolerance: 0.01)) } it("looks correct when opened") { actionButton.open(animated: false) - expect(superview) == snapshot() + expect(superview).to(haveValidSnapshot(pixelTolerance: 0.01)) } } @@ -591,13 +592,13 @@ class JJFloatingActionButtonSpec: QuickSpec { beforeEach { actionCount = 0 - actionButton.addItem(title: "item", image: #imageLiteral(resourceName: "Baloon").withRenderingMode(.alwaysTemplate)) { _ in + actionButton.addItem(title: "item", image: #imageLiteral(resourceName: "Balloon").withRenderingMode(.alwaysTemplate)) { _ in actionCount += 1 } } it("looks correct") { - expect(superview) == snapshot() + expect(superview).to(haveValidSnapshot(pixelTolerance: 0.01)) } context("and button is tapped") { @@ -624,7 +625,7 @@ class JJFloatingActionButtonSpec: QuickSpec { } it("looks correct") { - expect(superview) == snapshot() + expect(superview).to(haveValidSnapshot(pixelTolerance: 0.01)) } } @@ -639,7 +640,7 @@ class JJFloatingActionButtonSpec: QuickSpec { } it("looks correct") { - expect(superview) == snapshot() + expect(superview).to(haveValidSnapshot(pixelTolerance: 0.01)) } } } @@ -656,7 +657,7 @@ class JJFloatingActionButtonSpec: QuickSpec { context("when multiple items are added") { beforeEach { actionButton.addItem(title: "item 1", image: #imageLiteral(resourceName: "Like").withRenderingMode(.alwaysTemplate)) - actionButton.addItem(title: "item 2", image: #imageLiteral(resourceName: "Baloon").withRenderingMode(.alwaysTemplate)) + actionButton.addItem(title: "item 2", image: #imageLiteral(resourceName: "Balloon").withRenderingMode(.alwaysTemplate)) } it("stays closed") { @@ -670,12 +671,12 @@ class JJFloatingActionButtonSpec: QuickSpec { var actionButton: JJFloatingActionButton? beforeEach { - let bundle = Bundle(for: type(of: self)) + let bundle = Bundle(for: Self.self) actionButton = bundle.loadNibNamed("JJFloatingActionButton", owner: nil)?.first as? JJFloatingActionButton } it("looks correct") { - expect(actionButton) == snapshot() + expect(actionButton).to(haveValidSnapshot(pixelTolerance: 0.01)) } } @@ -685,7 +686,7 @@ class JJFloatingActionButtonSpec: QuickSpec { beforeEach { actionCount = 0 - actionButton = JJFloatingActionButton(image: #imageLiteral(resourceName: "Favourite"), action: { _ in + actionButton = JJFloatingActionButton(image: #imageLiteral(resourceName: "Favorite"), action: { _ in actionCount += 1 }) } @@ -695,7 +696,7 @@ class JJFloatingActionButtonSpec: QuickSpec { } it("has the correct icon") { - expect(actionButton.items.first?.buttonImage) == #imageLiteral(resourceName: "Favourite") + expect(actionButton.items.first?.buttonImage) == #imageLiteral(resourceName: "Favorite") } it("performs action when tapped") { @@ -723,22 +724,13 @@ class JJFloatingActionButtonSpec: QuickSpec { } it("looks correct") { - expect(superview) == snapshot() + expect(superview).to(haveValidSnapshot(pixelTolerance: 0.01)) } it("looks correct when diameter is set") { actionButton.buttonDiameter = 100 - expect(superview) == snapshot() + expect(superview).to(haveValidSnapshot(pixelTolerance: 0.01)) } } } } - -func waitUntil(timeout: TimeInterval = AsyncDefaults.Timeout) { - waitUntil(timeout: timeout + 1, action: { done in - DispatchQueue.global().async { - Thread.sleep(forTimeInterval: timeout) - done() - } - }) -} diff --git a/Example/Tests/ReferenceImages/AnimationConfigurationSpec/JJFloatingActionButton__when_using_circular_pop_up_style__it_looks_correct_when_opened_and_closed@3x.png b/Example/Tests/ReferenceImages/AnimationConfigurationSpec/JJFloatingActionButton__when_using_circular_pop_up_style__it_looks_correct_when_opened_and_closed@3x.png index f00582c8..ad49942b 100644 Binary files a/Example/Tests/ReferenceImages/AnimationConfigurationSpec/JJFloatingActionButton__when_using_circular_pop_up_style__it_looks_correct_when_opened_and_closed@3x.png and b/Example/Tests/ReferenceImages/AnimationConfigurationSpec/JJFloatingActionButton__when_using_circular_pop_up_style__it_looks_correct_when_opened_and_closed@3x.png differ diff --git a/Example/Tests/ReferenceImages/AnimationConfigurationSpec/JJFloatingActionButton__when_using_circular_pop_up_style__it_looks_correct_with_1_item@3x.png b/Example/Tests/ReferenceImages/AnimationConfigurationSpec/JJFloatingActionButton__when_using_circular_pop_up_style__it_looks_correct_with_1_item@3x.png index d484ee79..304fd898 100644 Binary files a/Example/Tests/ReferenceImages/AnimationConfigurationSpec/JJFloatingActionButton__when_using_circular_pop_up_style__it_looks_correct_with_1_item@3x.png and b/Example/Tests/ReferenceImages/AnimationConfigurationSpec/JJFloatingActionButton__when_using_circular_pop_up_style__it_looks_correct_with_1_item@3x.png differ diff --git a/Example/Tests/ReferenceImages/AnimationConfigurationSpec/JJFloatingActionButton__when_using_circular_pop_up_style__it_looks_correct_with_2_items@3x.png b/Example/Tests/ReferenceImages/AnimationConfigurationSpec/JJFloatingActionButton__when_using_circular_pop_up_style__it_looks_correct_with_2_items@3x.png index 9a310708..a1f9bdb2 100644 Binary files a/Example/Tests/ReferenceImages/AnimationConfigurationSpec/JJFloatingActionButton__when_using_circular_pop_up_style__it_looks_correct_with_2_items@3x.png and b/Example/Tests/ReferenceImages/AnimationConfigurationSpec/JJFloatingActionButton__when_using_circular_pop_up_style__it_looks_correct_with_2_items@3x.png differ diff --git a/Example/Tests/ReferenceImages/AnimationConfigurationSpec/JJFloatingActionButton__when_using_circular_pop_up_style__it_looks_correct_with_3_items@3x.png b/Example/Tests/ReferenceImages/AnimationConfigurationSpec/JJFloatingActionButton__when_using_circular_pop_up_style__it_looks_correct_with_3_items@3x.png index 312d9140..f07edcb3 100644 Binary files a/Example/Tests/ReferenceImages/AnimationConfigurationSpec/JJFloatingActionButton__when_using_circular_pop_up_style__it_looks_correct_with_3_items@3x.png and b/Example/Tests/ReferenceImages/AnimationConfigurationSpec/JJFloatingActionButton__when_using_circular_pop_up_style__it_looks_correct_with_3_items@3x.png differ diff --git a/Example/Tests/ReferenceImages/AnimationConfigurationSpec/JJFloatingActionButton__when_using_circular_pop_up_style__looks_correct_when_item_have_background_color@3x.png b/Example/Tests/ReferenceImages/AnimationConfigurationSpec/JJFloatingActionButton__when_using_circular_pop_up_style__looks_correct_when_item_have_background_color@3x.png index 09367a2d..097993de 100644 Binary files a/Example/Tests/ReferenceImages/AnimationConfigurationSpec/JJFloatingActionButton__when_using_circular_pop_up_style__looks_correct_when_item_have_background_color@3x.png and b/Example/Tests/ReferenceImages/AnimationConfigurationSpec/JJFloatingActionButton__when_using_circular_pop_up_style__looks_correct_when_item_have_background_color@3x.png differ diff --git a/Example/Tests/ReferenceImages/AnimationConfigurationSpec/JJFloatingActionButton__when_using_circular_slide_in_style__it_looks_correct@3x.png b/Example/Tests/ReferenceImages/AnimationConfigurationSpec/JJFloatingActionButton__when_using_circular_slide_in_style__it_looks_correct@3x.png index d7e44d08..0195ed9d 100644 Binary files a/Example/Tests/ReferenceImages/AnimationConfigurationSpec/JJFloatingActionButton__when_using_circular_slide_in_style__it_looks_correct@3x.png and b/Example/Tests/ReferenceImages/AnimationConfigurationSpec/JJFloatingActionButton__when_using_circular_slide_in_style__it_looks_correct@3x.png differ diff --git a/Example/Tests/ReferenceImages/AnimationConfigurationSpec/JJFloatingActionButton__when_using_custom_item_animation_configuration__it_looks_correct_with_circular_offset_items@3x.png b/Example/Tests/ReferenceImages/AnimationConfigurationSpec/JJFloatingActionButton__when_using_custom_item_animation_configuration__it_looks_correct_with_circular_offset_items@3x.png index d3d908cd..0c85e6a6 100644 Binary files a/Example/Tests/ReferenceImages/AnimationConfigurationSpec/JJFloatingActionButton__when_using_custom_item_animation_configuration__it_looks_correct_with_circular_offset_items@3x.png and b/Example/Tests/ReferenceImages/AnimationConfigurationSpec/JJFloatingActionButton__when_using_custom_item_animation_configuration__it_looks_correct_with_circular_offset_items@3x.png differ diff --git a/Example/Tests/ReferenceImages/AnimationConfigurationSpec/JJFloatingActionButton__when_using_custom_item_animation_configuration__it_looks_correct_with_horizontal_offset@3x.png b/Example/Tests/ReferenceImages/AnimationConfigurationSpec/JJFloatingActionButton__when_using_custom_item_animation_configuration__it_looks_correct_with_horizontal_offset@3x.png index 87f50453..104259ea 100644 Binary files a/Example/Tests/ReferenceImages/AnimationConfigurationSpec/JJFloatingActionButton__when_using_custom_item_animation_configuration__it_looks_correct_with_horizontal_offset@3x.png and b/Example/Tests/ReferenceImages/AnimationConfigurationSpec/JJFloatingActionButton__when_using_custom_item_animation_configuration__it_looks_correct_with_horizontal_offset@3x.png differ diff --git a/Example/Tests/ReferenceImages/AnimationConfigurationSpec/JJFloatingActionButton__when_using_custom_item_animation_configuration__it_looks_correct_with_items_offsetted@3x.png b/Example/Tests/ReferenceImages/AnimationConfigurationSpec/JJFloatingActionButton__when_using_custom_item_animation_configuration__it_looks_correct_with_items_offsetted@3x.png index cf1535f2..058c6aa5 100644 Binary files a/Example/Tests/ReferenceImages/AnimationConfigurationSpec/JJFloatingActionButton__when_using_custom_item_animation_configuration__it_looks_correct_with_items_offsetted@3x.png and b/Example/Tests/ReferenceImages/AnimationConfigurationSpec/JJFloatingActionButton__when_using_custom_item_animation_configuration__it_looks_correct_with_items_offsetted@3x.png differ diff --git a/Example/Tests/ReferenceImages/AnimationConfigurationSpec/JJFloatingActionButton__when_using_custom_item_animation_configuration__it_looks_correct_with_items_scaled@3x.png b/Example/Tests/ReferenceImages/AnimationConfigurationSpec/JJFloatingActionButton__when_using_custom_item_animation_configuration__it_looks_correct_with_items_scaled@3x.png index b4f47df2..34755dfd 100644 Binary files a/Example/Tests/ReferenceImages/AnimationConfigurationSpec/JJFloatingActionButton__when_using_custom_item_animation_configuration__it_looks_correct_with_items_scaled@3x.png and b/Example/Tests/ReferenceImages/AnimationConfigurationSpec/JJFloatingActionButton__when_using_custom_item_animation_configuration__it_looks_correct_with_items_scaled@3x.png differ diff --git a/Example/Tests/ReferenceImages/AnimationConfigurationSpec/JJFloatingActionButton__when_using_pop_up_style__it_looks_correct@3x.png b/Example/Tests/ReferenceImages/AnimationConfigurationSpec/JJFloatingActionButton__when_using_pop_up_style__it_looks_correct@3x.png index 2165cd0e..69c499a6 100644 Binary files a/Example/Tests/ReferenceImages/AnimationConfigurationSpec/JJFloatingActionButton__when_using_pop_up_style__it_looks_correct@3x.png and b/Example/Tests/ReferenceImages/AnimationConfigurationSpec/JJFloatingActionButton__when_using_pop_up_style__it_looks_correct@3x.png differ diff --git a/Example/Tests/ReferenceImages/AnimationConfigurationSpec/JJFloatingActionButton__when_using_pop_up_style_with_separate_first_item_spacing__it_looks_correct@3x.png b/Example/Tests/ReferenceImages/AnimationConfigurationSpec/JJFloatingActionButton__when_using_pop_up_style_with_separate_first_item_spacing__it_looks_correct@3x.png index 8c119c15..4366b1bc 100644 Binary files a/Example/Tests/ReferenceImages/AnimationConfigurationSpec/JJFloatingActionButton__when_using_pop_up_style_with_separate_first_item_spacing__it_looks_correct@3x.png and b/Example/Tests/ReferenceImages/AnimationConfigurationSpec/JJFloatingActionButton__when_using_pop_up_style_with_separate_first_item_spacing__it_looks_correct@3x.png differ diff --git a/Example/Tests/ReferenceImages/AnimationConfigurationSpec/JJFloatingActionButton__when_using_slide_in_style__it_looks_correct@3x.png b/Example/Tests/ReferenceImages/AnimationConfigurationSpec/JJFloatingActionButton__when_using_slide_in_style__it_looks_correct@3x.png index 2165cd0e..69c499a6 100644 Binary files a/Example/Tests/ReferenceImages/AnimationConfigurationSpec/JJFloatingActionButton__when_using_slide_in_style__it_looks_correct@3x.png and b/Example/Tests/ReferenceImages/AnimationConfigurationSpec/JJFloatingActionButton__when_using_slide_in_style__it_looks_correct@3x.png differ diff --git a/Example/Tests/ReferenceImages/AnimationConfigurationSpec/JJFloatingActionButton_on_the_left__when_using_circular_pop_up_style__it_looks_correct_with_1_item@3x.png b/Example/Tests/ReferenceImages/AnimationConfigurationSpec/JJFloatingActionButton_on_the_left__when_using_circular_pop_up_style__it_looks_correct_with_1_item@3x.png index 2a2cf0bd..4b3a2c90 100644 Binary files a/Example/Tests/ReferenceImages/AnimationConfigurationSpec/JJFloatingActionButton_on_the_left__when_using_circular_pop_up_style__it_looks_correct_with_1_item@3x.png and b/Example/Tests/ReferenceImages/AnimationConfigurationSpec/JJFloatingActionButton_on_the_left__when_using_circular_pop_up_style__it_looks_correct_with_1_item@3x.png differ diff --git a/Example/Tests/ReferenceImages/AnimationConfigurationSpec/JJFloatingActionButton_on_the_left__when_using_circular_pop_up_style__it_looks_correct_with_2_items@3x.png b/Example/Tests/ReferenceImages/AnimationConfigurationSpec/JJFloatingActionButton_on_the_left__when_using_circular_pop_up_style__it_looks_correct_with_2_items@3x.png index a9197f9d..5532295c 100644 Binary files a/Example/Tests/ReferenceImages/AnimationConfigurationSpec/JJFloatingActionButton_on_the_left__when_using_circular_pop_up_style__it_looks_correct_with_2_items@3x.png and b/Example/Tests/ReferenceImages/AnimationConfigurationSpec/JJFloatingActionButton_on_the_left__when_using_circular_pop_up_style__it_looks_correct_with_2_items@3x.png differ diff --git a/Example/Tests/ReferenceImages/AnimationConfigurationSpec/JJFloatingActionButton_on_the_left__when_using_circular_pop_up_style__it_looks_correct_with_3_items@3x.png b/Example/Tests/ReferenceImages/AnimationConfigurationSpec/JJFloatingActionButton_on_the_left__when_using_circular_pop_up_style__it_looks_correct_with_3_items@3x.png index c6de1536..61304cf1 100644 Binary files a/Example/Tests/ReferenceImages/AnimationConfigurationSpec/JJFloatingActionButton_on_the_left__when_using_circular_pop_up_style__it_looks_correct_with_3_items@3x.png and b/Example/Tests/ReferenceImages/AnimationConfigurationSpec/JJFloatingActionButton_on_the_left__when_using_circular_pop_up_style__it_looks_correct_with_3_items@3x.png differ diff --git a/Example/Tests/ReferenceImages/AnimationConfigurationSpec/JJFloatingActionButton_on_the_left__when_using_custom_item_animation_configuration__it_looks_correct_with_circular_offset_items@3x.png b/Example/Tests/ReferenceImages/AnimationConfigurationSpec/JJFloatingActionButton_on_the_left__when_using_custom_item_animation_configuration__it_looks_correct_with_circular_offset_items@3x.png index f29881d2..e121a9e2 100644 Binary files a/Example/Tests/ReferenceImages/AnimationConfigurationSpec/JJFloatingActionButton_on_the_left__when_using_custom_item_animation_configuration__it_looks_correct_with_circular_offset_items@3x.png and b/Example/Tests/ReferenceImages/AnimationConfigurationSpec/JJFloatingActionButton_on_the_left__when_using_custom_item_animation_configuration__it_looks_correct_with_circular_offset_items@3x.png differ diff --git a/Example/Tests/ReferenceImages/AnimationConfigurationSpec/JJFloatingActionButton_on_the_left__when_using_custom_item_animation_configuration__it_looks_correct_with_horizontal_offset@3x.png b/Example/Tests/ReferenceImages/AnimationConfigurationSpec/JJFloatingActionButton_on_the_left__when_using_custom_item_animation_configuration__it_looks_correct_with_horizontal_offset@3x.png index 21d87f13..9a0513b7 100644 Binary files a/Example/Tests/ReferenceImages/AnimationConfigurationSpec/JJFloatingActionButton_on_the_left__when_using_custom_item_animation_configuration__it_looks_correct_with_horizontal_offset@3x.png and b/Example/Tests/ReferenceImages/AnimationConfigurationSpec/JJFloatingActionButton_on_the_left__when_using_custom_item_animation_configuration__it_looks_correct_with_horizontal_offset@3x.png differ diff --git a/Example/Tests/ReferenceImages/AnimationConfigurationSpec/JJFloatingActionButton_on_the_left__when_using_custom_item_animation_configuration__it_looks_correct_with_items_offsetted@3x.png b/Example/Tests/ReferenceImages/AnimationConfigurationSpec/JJFloatingActionButton_on_the_left__when_using_custom_item_animation_configuration__it_looks_correct_with_items_offsetted@3x.png index 7094805f..f8d13fa3 100644 Binary files a/Example/Tests/ReferenceImages/AnimationConfigurationSpec/JJFloatingActionButton_on_the_left__when_using_custom_item_animation_configuration__it_looks_correct_with_items_offsetted@3x.png and b/Example/Tests/ReferenceImages/AnimationConfigurationSpec/JJFloatingActionButton_on_the_left__when_using_custom_item_animation_configuration__it_looks_correct_with_items_offsetted@3x.png differ diff --git a/Example/Tests/ReferenceImages/AnimationConfigurationSpec/JJFloatingActionButton_on_the_left__with_rtl_language__looks_correct@3x.png b/Example/Tests/ReferenceImages/AnimationConfigurationSpec/JJFloatingActionButton_on_the_left__with_rtl_language__looks_correct@3x.png index 0d8e00ac..5d428ee7 100644 Binary files a/Example/Tests/ReferenceImages/AnimationConfigurationSpec/JJFloatingActionButton_on_the_left__with_rtl_language__looks_correct@3x.png and b/Example/Tests/ReferenceImages/AnimationConfigurationSpec/JJFloatingActionButton_on_the_left__with_rtl_language__looks_correct@3x.png differ diff --git a/Example/Tests/ReferenceImages/JJActionItemSpec/JJActionItem__looks_correct@3x.png b/Example/Tests/ReferenceImages/JJActionItemSpec/JJActionItem__looks_correct@3x.png index 4689b573..cba06a6d 100644 Binary files a/Example/Tests/ReferenceImages/JJActionItemSpec/JJActionItem__looks_correct@3x.png and b/Example/Tests/ReferenceImages/JJActionItemSpec/JJActionItem__looks_correct@3x.png differ diff --git a/Example/Tests/ReferenceImages/JJActionItemSpec/JJActionItem__looks_correct_with_bigger_image_size@3x.png b/Example/Tests/ReferenceImages/JJActionItemSpec/JJActionItem__looks_correct_with_bigger_image_size@3x.png index c635657c..281dc575 100644 Binary files a/Example/Tests/ReferenceImages/JJActionItemSpec/JJActionItem__looks_correct_with_bigger_image_size@3x.png and b/Example/Tests/ReferenceImages/JJActionItemSpec/JJActionItem__looks_correct_with_bigger_image_size@3x.png differ diff --git a/Example/Tests/ReferenceImages/JJActionItemSpec/JJActionItem__looks_correct_with_empty_title@3x.png b/Example/Tests/ReferenceImages/JJActionItemSpec/JJActionItem__looks_correct_with_empty_title@3x.png index 77b25799..ed46ec13 100644 Binary files a/Example/Tests/ReferenceImages/JJActionItemSpec/JJActionItem__looks_correct_with_empty_title@3x.png and b/Example/Tests/ReferenceImages/JJActionItemSpec/JJActionItem__looks_correct_with_empty_title@3x.png differ diff --git a/Example/Tests/ReferenceImages/JJActionItemSpec/JJActionItem__looks_correct_with_horizontal_title_spacing_configured@3x.png b/Example/Tests/ReferenceImages/JJActionItemSpec/JJActionItem__looks_correct_with_horizontal_title_spacing_configured@3x.png index 80f3c287..54c64510 100644 Binary files a/Example/Tests/ReferenceImages/JJActionItemSpec/JJActionItem__looks_correct_with_horizontal_title_spacing_configured@3x.png and b/Example/Tests/ReferenceImages/JJActionItemSpec/JJActionItem__looks_correct_with_horizontal_title_spacing_configured@3x.png differ diff --git a/Example/Tests/ReferenceImages/JJActionItemSpec/JJActionItem__looks_correct_with_smaller_image_size@3x.png b/Example/Tests/ReferenceImages/JJActionItemSpec/JJActionItem__looks_correct_with_smaller_image_size@3x.png index f69950ca..fbe1e305 100644 Binary files a/Example/Tests/ReferenceImages/JJActionItemSpec/JJActionItem__looks_correct_with_smaller_image_size@3x.png and b/Example/Tests/ReferenceImages/JJActionItemSpec/JJActionItem__looks_correct_with_smaller_image_size@3x.png differ diff --git a/Example/Tests/ReferenceImages/JJActionItemSpec/JJActionItem__looks_correct_with_title_position_bottom@3x.png b/Example/Tests/ReferenceImages/JJActionItemSpec/JJActionItem__looks_correct_with_title_position_bottom@3x.png index e1e1f44b..6c3cd121 100644 Binary files a/Example/Tests/ReferenceImages/JJActionItemSpec/JJActionItem__looks_correct_with_title_position_bottom@3x.png and b/Example/Tests/ReferenceImages/JJActionItemSpec/JJActionItem__looks_correct_with_title_position_bottom@3x.png differ diff --git a/Example/Tests/ReferenceImages/JJActionItemSpec/JJActionItem__looks_correct_with_title_position_hidden@3x.png b/Example/Tests/ReferenceImages/JJActionItemSpec/JJActionItem__looks_correct_with_title_position_hidden@3x.png index 04fa8d70..d79e685a 100644 Binary files a/Example/Tests/ReferenceImages/JJActionItemSpec/JJActionItem__looks_correct_with_title_position_hidden@3x.png and b/Example/Tests/ReferenceImages/JJActionItemSpec/JJActionItem__looks_correct_with_title_position_hidden@3x.png differ diff --git a/Example/Tests/ReferenceImages/JJActionItemSpec/JJActionItem__looks_correct_with_title_position_leading@3x.png b/Example/Tests/ReferenceImages/JJActionItemSpec/JJActionItem__looks_correct_with_title_position_leading@3x.png index 4689b573..cba06a6d 100644 Binary files a/Example/Tests/ReferenceImages/JJActionItemSpec/JJActionItem__looks_correct_with_title_position_leading@3x.png and b/Example/Tests/ReferenceImages/JJActionItemSpec/JJActionItem__looks_correct_with_title_position_leading@3x.png differ diff --git a/Example/Tests/ReferenceImages/JJActionItemSpec/JJActionItem__looks_correct_with_title_position_left@3x.png b/Example/Tests/ReferenceImages/JJActionItemSpec/JJActionItem__looks_correct_with_title_position_left@3x.png index 4689b573..cba06a6d 100644 Binary files a/Example/Tests/ReferenceImages/JJActionItemSpec/JJActionItem__looks_correct_with_title_position_left@3x.png and b/Example/Tests/ReferenceImages/JJActionItemSpec/JJActionItem__looks_correct_with_title_position_left@3x.png differ diff --git a/Example/Tests/ReferenceImages/JJActionItemSpec/JJActionItem__looks_correct_with_title_position_right@3x.png b/Example/Tests/ReferenceImages/JJActionItemSpec/JJActionItem__looks_correct_with_title_position_right@3x.png index d66ba93e..9920499c 100644 Binary files a/Example/Tests/ReferenceImages/JJActionItemSpec/JJActionItem__looks_correct_with_title_position_right@3x.png and b/Example/Tests/ReferenceImages/JJActionItemSpec/JJActionItem__looks_correct_with_title_position_right@3x.png differ diff --git a/Example/Tests/ReferenceImages/JJActionItemSpec/JJActionItem__looks_correct_with_title_position_top@3x.png b/Example/Tests/ReferenceImages/JJActionItemSpec/JJActionItem__looks_correct_with_title_position_top@3x.png index 120020a7..68ee7f58 100644 Binary files a/Example/Tests/ReferenceImages/JJActionItemSpec/JJActionItem__looks_correct_with_title_position_top@3x.png and b/Example/Tests/ReferenceImages/JJActionItemSpec/JJActionItem__looks_correct_with_title_position_top@3x.png differ diff --git a/Example/Tests/ReferenceImages/JJActionItemSpec/JJActionItem__looks_correct_with_title_position_trailing@3x.png b/Example/Tests/ReferenceImages/JJActionItemSpec/JJActionItem__looks_correct_with_title_position_trailing@3x.png index d66ba93e..9920499c 100644 Binary files a/Example/Tests/ReferenceImages/JJActionItemSpec/JJActionItem__looks_correct_with_title_position_trailing@3x.png and b/Example/Tests/ReferenceImages/JJActionItemSpec/JJActionItem__looks_correct_with_title_position_trailing@3x.png differ diff --git a/Example/Tests/ReferenceImages/JJActionItemSpec/JJActionItem__looks_correct_with_vertical_title_spacing_configured@3x.png b/Example/Tests/ReferenceImages/JJActionItemSpec/JJActionItem__looks_correct_with_vertical_title_spacing_configured@3x.png index 4fb10efd..b700b5e0 100644 Binary files a/Example/Tests/ReferenceImages/JJActionItemSpec/JJActionItem__looks_correct_with_vertical_title_spacing_configured@3x.png and b/Example/Tests/ReferenceImages/JJActionItemSpec/JJActionItem__looks_correct_with_vertical_title_spacing_configured@3x.png differ diff --git a/Example/Tests/ReferenceImages/JJActionItemSpec/JJActionItem_loaded_from_xib__looks_correct@3x.png b/Example/Tests/ReferenceImages/JJActionItemSpec/JJActionItem_loaded_from_xib__looks_correct@3x.png index 0a3aa18d..ea5d3b3b 100644 Binary files a/Example/Tests/ReferenceImages/JJActionItemSpec/JJActionItem_loaded_from_xib__looks_correct@3x.png and b/Example/Tests/ReferenceImages/JJActionItemSpec/JJActionItem_loaded_from_xib__looks_correct@3x.png differ diff --git a/Example/Tests/ReferenceImages/JJCircleViewSpec/JJCircleView__created_programatically__looks_correct@3x.png b/Example/Tests/ReferenceImages/JJCircleViewSpec/JJCircleView__created_programatically__looks_correct@3x.png index 8d185636..90324b53 100644 Binary files a/Example/Tests/ReferenceImages/JJCircleViewSpec/JJCircleView__created_programatically__looks_correct@3x.png and b/Example/Tests/ReferenceImages/JJCircleViewSpec/JJCircleView__created_programatically__looks_correct@3x.png differ diff --git a/Example/Tests/ReferenceImages/JJCircleViewSpec/JJCircleView__loaded_from_xib__looks_correct@3x.png b/Example/Tests/ReferenceImages/JJCircleViewSpec/JJCircleView__loaded_from_xib__looks_correct@3x.png index 072a5132..23a026d1 100644 Binary files a/Example/Tests/ReferenceImages/JJCircleViewSpec/JJCircleView__loaded_from_xib__looks_correct@3x.png and b/Example/Tests/ReferenceImages/JJCircleViewSpec/JJCircleView__loaded_from_xib__looks_correct@3x.png differ diff --git a/Example/Tests/ReferenceImages/JJFloatingActionButtonPlacementSpec/JJFloatingActionButton__looks_correct_when_placed_in_view_controller_iPhone_15_5_375x667@2x.png b/Example/Tests/ReferenceImages/JJFloatingActionButtonPlacementSpec/JJFloatingActionButton__looks_correct_when_placed_in_view_controller_iPhone_15_5_375x667@2x.png new file mode 100644 index 00000000..37711b6e Binary files /dev/null and b/Example/Tests/ReferenceImages/JJFloatingActionButtonPlacementSpec/JJFloatingActionButton__looks_correct_when_placed_in_view_controller_iPhone_15_5_375x667@2x.png differ diff --git a/Example/Tests/ReferenceImages/JJFloatingActionButtonPlacementSpec/JJFloatingActionButton__looks_correct_when_placed_in_view_controller_iPhone_16_4_390x844@3x.png b/Example/Tests/ReferenceImages/JJFloatingActionButtonPlacementSpec/JJFloatingActionButton__looks_correct_when_placed_in_view_controller_iPhone_16_4_390x844@3x.png new file mode 100644 index 00000000..bebdbcd8 Binary files /dev/null and b/Example/Tests/ReferenceImages/JJFloatingActionButtonPlacementSpec/JJFloatingActionButton__looks_correct_when_placed_in_view_controller_iPhone_16_4_390x844@3x.png differ diff --git a/Example/Tests/ReferenceImages/JJFloatingActionButtonPlacementSpec/JJFloatingActionButton__looks_correct_when_placed_in_view_controller_iPhone_17_2_375x667@2x.png b/Example/Tests/ReferenceImages/JJFloatingActionButtonPlacementSpec/JJFloatingActionButton__looks_correct_when_placed_in_view_controller_iPhone_17_2_375x667@2x.png new file mode 100644 index 00000000..37711b6e Binary files /dev/null and b/Example/Tests/ReferenceImages/JJFloatingActionButtonPlacementSpec/JJFloatingActionButton__looks_correct_when_placed_in_view_controller_iPhone_17_2_375x667@2x.png differ diff --git a/Example/Tests/ReferenceImages/JJFloatingActionButtonPlacementSpec/JJFloatingActionButton__looks_correct_when_placed_in_view_controller_iPhone_17_2_390x844@3x.png b/Example/Tests/ReferenceImages/JJFloatingActionButtonPlacementSpec/JJFloatingActionButton__looks_correct_when_placed_in_view_controller_iPhone_17_2_390x844@3x.png new file mode 100644 index 00000000..bebdbcd8 Binary files /dev/null and b/Example/Tests/ReferenceImages/JJFloatingActionButtonPlacementSpec/JJFloatingActionButton__looks_correct_when_placed_in_view_controller_iPhone_17_2_390x844@3x.png differ diff --git a/Example/Tests/ReferenceImages/JJFloatingActionButtonPlacementSpec/JJFloatingActionButton__looks_correct_when_placed_in_view_controller_iPhone_17_2_393x852@3x.png b/Example/Tests/ReferenceImages/JJFloatingActionButtonPlacementSpec/JJFloatingActionButton__looks_correct_when_placed_in_view_controller_iPhone_17_2_393x852@3x.png new file mode 100644 index 00000000..3ca6c3f6 Binary files /dev/null and b/Example/Tests/ReferenceImages/JJFloatingActionButtonPlacementSpec/JJFloatingActionButton__looks_correct_when_placed_in_view_controller_iPhone_17_2_393x852@3x.png differ diff --git a/Example/Tests/ReferenceImages/JJFloatingActionButtonPlacementSpec/JJFloatingActionButton__looks_correct_when_placed_in_view_controller_iPhone_17_2_430x932@3x.png b/Example/Tests/ReferenceImages/JJFloatingActionButtonPlacementSpec/JJFloatingActionButton__looks_correct_when_placed_in_view_controller_iPhone_17_2_430x932@3x.png new file mode 100644 index 00000000..8ba3f557 Binary files /dev/null and b/Example/Tests/ReferenceImages/JJFloatingActionButtonPlacementSpec/JJFloatingActionButton__looks_correct_when_placed_in_view_controller_iPhone_17_2_430x932@3x.png differ diff --git a/Example/Tests/ReferenceImages/JJFloatingActionButtonSpec/JJFloatingActionButton__looks_correct_by_default@3x.png b/Example/Tests/ReferenceImages/JJFloatingActionButtonSpec/JJFloatingActionButton__looks_correct_by_default@3x.png index 4243ee1d..ad49942b 100644 Binary files a/Example/Tests/ReferenceImages/JJFloatingActionButtonSpec/JJFloatingActionButton__looks_correct_by_default@3x.png and b/Example/Tests/ReferenceImages/JJFloatingActionButtonSpec/JJFloatingActionButton__looks_correct_by_default@3x.png differ diff --git a/Example/Tests/ReferenceImages/JJFloatingActionButtonSpec/JJFloatingActionButton__looks_correct_configured@3x.png b/Example/Tests/ReferenceImages/JJFloatingActionButtonSpec/JJFloatingActionButton__looks_correct_configured@3x.png index ed5b6cc5..84e1cfe0 100644 Binary files a/Example/Tests/ReferenceImages/JJFloatingActionButtonSpec/JJFloatingActionButton__looks_correct_configured@3x.png and b/Example/Tests/ReferenceImages/JJFloatingActionButtonSpec/JJFloatingActionButton__looks_correct_configured@3x.png differ diff --git a/Example/Tests/ReferenceImages/JJFloatingActionButtonSpec/JJFloatingActionButton__looks_correct_configured_after_adding_the_items@3x.png b/Example/Tests/ReferenceImages/JJFloatingActionButtonSpec/JJFloatingActionButton__looks_correct_configured_after_adding_the_items@3x.png index 3e160747..72067904 100644 Binary files a/Example/Tests/ReferenceImages/JJFloatingActionButtonSpec/JJFloatingActionButton__looks_correct_configured_after_adding_the_items@3x.png and b/Example/Tests/ReferenceImages/JJFloatingActionButtonSpec/JJFloatingActionButton__looks_correct_configured_after_adding_the_items@3x.png differ diff --git a/Example/Tests/ReferenceImages/JJFloatingActionButtonSpec/JJFloatingActionButton__looks_correct_highlighted@3x.png b/Example/Tests/ReferenceImages/JJFloatingActionButtonSpec/JJFloatingActionButton__looks_correct_highlighted@3x.png index d4494be5..2432ae6c 100644 Binary files a/Example/Tests/ReferenceImages/JJFloatingActionButtonSpec/JJFloatingActionButton__looks_correct_highlighted@3x.png and b/Example/Tests/ReferenceImages/JJFloatingActionButtonSpec/JJFloatingActionButton__looks_correct_highlighted@3x.png differ diff --git a/Example/Tests/ReferenceImages/JJFloatingActionButtonSpec/JJFloatingActionButton__looks_correct_highlighted_with_custom_color@3x.png b/Example/Tests/ReferenceImages/JJFloatingActionButtonSpec/JJFloatingActionButton__looks_correct_highlighted_with_custom_color@3x.png index 8ef684a9..c473394a 100644 Binary files a/Example/Tests/ReferenceImages/JJFloatingActionButtonSpec/JJFloatingActionButton__looks_correct_highlighted_with_custom_color@3x.png and b/Example/Tests/ReferenceImages/JJFloatingActionButtonSpec/JJFloatingActionButton__looks_correct_highlighted_with_custom_color@3x.png differ diff --git a/Example/Tests/ReferenceImages/JJFloatingActionButtonSpec/JJFloatingActionButton__looks_correct_highlighted_with_dark_color@3x.png b/Example/Tests/ReferenceImages/JJFloatingActionButtonSpec/JJFloatingActionButton__looks_correct_highlighted_with_dark_color@3x.png index e935abf7..d1768f49 100644 Binary files a/Example/Tests/ReferenceImages/JJFloatingActionButtonSpec/JJFloatingActionButton__looks_correct_highlighted_with_dark_color@3x.png and b/Example/Tests/ReferenceImages/JJFloatingActionButtonSpec/JJFloatingActionButton__looks_correct_highlighted_with_dark_color@3x.png differ diff --git a/Example/Tests/ReferenceImages/JJFloatingActionButtonSpec/JJFloatingActionButton__looks_correct_highlighted_with_light_color@3x.png b/Example/Tests/ReferenceImages/JJFloatingActionButtonSpec/JJFloatingActionButton__looks_correct_highlighted_with_light_color@3x.png index 7ea33e91..8e975986 100644 Binary files a/Example/Tests/ReferenceImages/JJFloatingActionButtonSpec/JJFloatingActionButton__looks_correct_highlighted_with_light_color@3x.png and b/Example/Tests/ReferenceImages/JJFloatingActionButtonSpec/JJFloatingActionButton__looks_correct_highlighted_with_light_color@3x.png differ diff --git a/Example/Tests/ReferenceImages/JJFloatingActionButtonSpec/JJFloatingActionButton__looks_correct_when_only_image_color_is_changed@3x.png b/Example/Tests/ReferenceImages/JJFloatingActionButtonSpec/JJFloatingActionButton__looks_correct_when_only_image_color_is_changed@3x.png index 59375dfc..e8c724af 100644 Binary files a/Example/Tests/ReferenceImages/JJFloatingActionButtonSpec/JJFloatingActionButton__looks_correct_when_only_image_color_is_changed@3x.png and b/Example/Tests/ReferenceImages/JJFloatingActionButtonSpec/JJFloatingActionButton__looks_correct_when_only_image_color_is_changed@3x.png differ diff --git a/Example/Tests/ReferenceImages/JJFloatingActionButtonSpec/JJFloatingActionButton__looks_correct_with_bigger_image_size@3x.png b/Example/Tests/ReferenceImages/JJFloatingActionButtonSpec/JJFloatingActionButton__looks_correct_with_bigger_image_size@3x.png index b356a36b..acf1a6f7 100644 Binary files a/Example/Tests/ReferenceImages/JJFloatingActionButtonSpec/JJFloatingActionButton__looks_correct_with_bigger_image_size@3x.png and b/Example/Tests/ReferenceImages/JJFloatingActionButtonSpec/JJFloatingActionButton__looks_correct_with_bigger_image_size@3x.png differ diff --git a/Example/Tests/ReferenceImages/JJFloatingActionButtonSpec/JJFloatingActionButton__looks_correct_with_items_configured_with_closure@3x.png b/Example/Tests/ReferenceImages/JJFloatingActionButtonSpec/JJFloatingActionButton__looks_correct_with_items_configured_with_closure@3x.png index 7865413f..13beffc3 100644 Binary files a/Example/Tests/ReferenceImages/JJFloatingActionButtonSpec/JJFloatingActionButton__looks_correct_with_items_configured_with_closure@3x.png and b/Example/Tests/ReferenceImages/JJFloatingActionButtonSpec/JJFloatingActionButton__looks_correct_with_items_configured_with_closure@3x.png differ diff --git a/Example/Tests/ReferenceImages/JJFloatingActionButtonSpec/JJFloatingActionButton__looks_correct_with_smaller_image_size@3x.png b/Example/Tests/ReferenceImages/JJFloatingActionButtonSpec/JJFloatingActionButton__looks_correct_with_smaller_image_size@3x.png index 9de0ff0a..d234b902 100644 Binary files a/Example/Tests/ReferenceImages/JJFloatingActionButtonSpec/JJFloatingActionButton__looks_correct_with_smaller_image_size@3x.png and b/Example/Tests/ReferenceImages/JJFloatingActionButtonSpec/JJFloatingActionButton__looks_correct_with_smaller_image_size@3x.png differ diff --git a/Example/Tests/ReferenceImages/JJFloatingActionButtonSpec/JJFloatingActionButton__when_1_item_is_added__and_is_opened__looks_correct@3x.png b/Example/Tests/ReferenceImages/JJFloatingActionButtonSpec/JJFloatingActionButton__when_1_item_is_added__and_is_opened__looks_correct@3x.png index 6842d2eb..9cbf67e7 100644 Binary files a/Example/Tests/ReferenceImages/JJFloatingActionButtonSpec/JJFloatingActionButton__when_1_item_is_added__and_is_opened__looks_correct@3x.png and b/Example/Tests/ReferenceImages/JJFloatingActionButtonSpec/JJFloatingActionButton__when_1_item_is_added__and_is_opened__looks_correct@3x.png differ diff --git a/Example/Tests/ReferenceImages/JJFloatingActionButtonSpec/JJFloatingActionButton__when_1_item_is_added__and_is_opened_with_handle_single_action_directly_disabled__looks_correct@3x.png b/Example/Tests/ReferenceImages/JJFloatingActionButtonSpec/JJFloatingActionButton__when_1_item_is_added__and_is_opened_with_handle_single_action_directly_disabled__looks_correct@3x.png index af6f8f83..62602eec 100644 Binary files a/Example/Tests/ReferenceImages/JJFloatingActionButtonSpec/JJFloatingActionButton__when_1_item_is_added__and_is_opened_with_handle_single_action_directly_disabled__looks_correct@3x.png and b/Example/Tests/ReferenceImages/JJFloatingActionButtonSpec/JJFloatingActionButton__when_1_item_is_added__and_is_opened_with_handle_single_action_directly_disabled__looks_correct@3x.png differ diff --git a/Example/Tests/ReferenceImages/JJFloatingActionButtonSpec/JJFloatingActionButton__when_1_item_is_added__looks_correct@3x.png b/Example/Tests/ReferenceImages/JJFloatingActionButtonSpec/JJFloatingActionButton__when_1_item_is_added__looks_correct@3x.png index 6842d2eb..9cbf67e7 100644 Binary files a/Example/Tests/ReferenceImages/JJFloatingActionButtonSpec/JJFloatingActionButton__when_1_item_is_added__looks_correct@3x.png and b/Example/Tests/ReferenceImages/JJFloatingActionButtonSpec/JJFloatingActionButton__when_1_item_is_added__looks_correct@3x.png differ diff --git a/Example/Tests/ReferenceImages/JJFloatingActionButtonSpec/JJFloatingActionButton__when_multiple_items_are_added__and_all_but_one_item_are_removed__looks_correct@3x.png b/Example/Tests/ReferenceImages/JJFloatingActionButtonSpec/JJFloatingActionButton__when_multiple_items_are_added__and_all_but_one_item_are_removed__looks_correct@3x.png index 8bddcff2..53fd3bca 100644 Binary files a/Example/Tests/ReferenceImages/JJFloatingActionButtonSpec/JJFloatingActionButton__when_multiple_items_are_added__and_all_but_one_item_are_removed__looks_correct@3x.png and b/Example/Tests/ReferenceImages/JJFloatingActionButtonSpec/JJFloatingActionButton__when_multiple_items_are_added__and_all_but_one_item_are_removed__looks_correct@3x.png differ diff --git a/Example/Tests/ReferenceImages/JJFloatingActionButtonSpec/JJFloatingActionButton__when_multiple_items_are_added__and_all_but_one_item_are_removed__looks_correct_when_opened@3x.png b/Example/Tests/ReferenceImages/JJFloatingActionButtonSpec/JJFloatingActionButton__when_multiple_items_are_added__and_all_but_one_item_are_removed__looks_correct_when_opened@3x.png index 8bddcff2..53fd3bca 100644 Binary files a/Example/Tests/ReferenceImages/JJFloatingActionButtonSpec/JJFloatingActionButton__when_multiple_items_are_added__and_all_but_one_item_are_removed__looks_correct_when_opened@3x.png and b/Example/Tests/ReferenceImages/JJFloatingActionButtonSpec/JJFloatingActionButton__when_multiple_items_are_added__and_all_but_one_item_are_removed__looks_correct_when_opened@3x.png differ diff --git a/Example/Tests/ReferenceImages/JJFloatingActionButtonSpec/JJFloatingActionButton__when_multiple_items_are_added__and_is_opened__items_look_correct@3x.png b/Example/Tests/ReferenceImages/JJFloatingActionButtonSpec/JJFloatingActionButton__when_multiple_items_are_added__and_is_opened__items_look_correct@3x.png index eff78c90..e3c0deec 100644 Binary files a/Example/Tests/ReferenceImages/JJFloatingActionButtonSpec/JJFloatingActionButton__when_multiple_items_are_added__and_is_opened__items_look_correct@3x.png and b/Example/Tests/ReferenceImages/JJFloatingActionButtonSpec/JJFloatingActionButton__when_multiple_items_are_added__and_is_opened__items_look_correct@3x.png differ diff --git a/Example/Tests/ReferenceImages/JJFloatingActionButtonSpec/JJFloatingActionButton__when_multiple_items_are_added__and_is_opened__items_look_correct_highlighted@3x.png b/Example/Tests/ReferenceImages/JJFloatingActionButtonSpec/JJFloatingActionButton__when_multiple_items_are_added__and_is_opened__items_look_correct_highlighted@3x.png index ec781b5b..650df0f4 100644 Binary files a/Example/Tests/ReferenceImages/JJFloatingActionButtonSpec/JJFloatingActionButton__when_multiple_items_are_added__and_is_opened__items_look_correct_highlighted@3x.png and b/Example/Tests/ReferenceImages/JJFloatingActionButtonSpec/JJFloatingActionButton__when_multiple_items_are_added__and_is_opened__items_look_correct_highlighted@3x.png differ diff --git a/Example/Tests/ReferenceImages/JJFloatingActionButtonSpec/JJFloatingActionButton__when_multiple_items_are_added__and_is_opened__items_look_correct_highlighted_with_custom_highlighted_color@3x.png b/Example/Tests/ReferenceImages/JJFloatingActionButtonSpec/JJFloatingActionButton__when_multiple_items_are_added__and_is_opened__items_look_correct_highlighted_with_custom_highlighted_color@3x.png index 4fc033b2..345d5f95 100644 Binary files a/Example/Tests/ReferenceImages/JJFloatingActionButtonSpec/JJFloatingActionButton__when_multiple_items_are_added__and_is_opened__items_look_correct_highlighted_with_custom_highlighted_color@3x.png and b/Example/Tests/ReferenceImages/JJFloatingActionButtonSpec/JJFloatingActionButton__when_multiple_items_are_added__and_is_opened__items_look_correct_highlighted_with_custom_highlighted_color@3x.png differ diff --git a/Example/Tests/ReferenceImages/JJFloatingActionButtonSpec/JJFloatingActionButton__when_multiple_items_are_added__and_is_opened_and_closed__looks_correct@3x.png b/Example/Tests/ReferenceImages/JJFloatingActionButtonSpec/JJFloatingActionButton__when_multiple_items_are_added__and_is_opened_and_closed__looks_correct@3x.png index 4243ee1d..ad49942b 100644 Binary files a/Example/Tests/ReferenceImages/JJFloatingActionButtonSpec/JJFloatingActionButton__when_multiple_items_are_added__and_is_opened_and_closed__looks_correct@3x.png and b/Example/Tests/ReferenceImages/JJFloatingActionButtonSpec/JJFloatingActionButton__when_multiple_items_are_added__and_is_opened_and_closed__looks_correct@3x.png differ diff --git a/Example/Tests/ReferenceImages/JJFloatingActionButtonSpec/JJFloatingActionButton__when_multiple_items_are_added__plus_one_hidden_item__looks_correct_when_opened@3x.png b/Example/Tests/ReferenceImages/JJFloatingActionButtonSpec/JJFloatingActionButton__when_multiple_items_are_added__plus_one_hidden_item__looks_correct_when_opened@3x.png index eff78c90..e3c0deec 100644 Binary files a/Example/Tests/ReferenceImages/JJFloatingActionButtonSpec/JJFloatingActionButton__when_multiple_items_are_added__plus_one_hidden_item__looks_correct_when_opened@3x.png and b/Example/Tests/ReferenceImages/JJFloatingActionButtonSpec/JJFloatingActionButton__when_multiple_items_are_added__plus_one_hidden_item__looks_correct_when_opened@3x.png differ diff --git a/Example/Tests/ReferenceImages/JJFloatingActionButtonSpec/JJFloatingActionButton_loaded_from_xib__looks_correct@3x.png b/Example/Tests/ReferenceImages/JJFloatingActionButtonSpec/JJFloatingActionButton_loaded_from_xib__looks_correct@3x.png index 81d714ed..bc18b9d7 100644 Binary files a/Example/Tests/ReferenceImages/JJFloatingActionButtonSpec/JJFloatingActionButton_loaded_from_xib__looks_correct@3x.png and b/Example/Tests/ReferenceImages/JJFloatingActionButtonSpec/JJFloatingActionButton_loaded_from_xib__looks_correct@3x.png differ diff --git a/Example/Tests/ReferenceImages/JJFloatingActionButtonSpec/JJFloatingActionButton_using_layout_constraints__looks_correct@3x.png b/Example/Tests/ReferenceImages/JJFloatingActionButtonSpec/JJFloatingActionButton_using_layout_constraints__looks_correct@3x.png index a5032bd1..36700314 100644 Binary files a/Example/Tests/ReferenceImages/JJFloatingActionButtonSpec/JJFloatingActionButton_using_layout_constraints__looks_correct@3x.png and b/Example/Tests/ReferenceImages/JJFloatingActionButtonSpec/JJFloatingActionButton_using_layout_constraints__looks_correct@3x.png differ diff --git a/Example/Tests/ReferenceImages/JJFloatingActionButtonSpec/JJFloatingActionButton_using_layout_constraints__looks_correct_when_diameter_is_set@3x.png b/Example/Tests/ReferenceImages/JJFloatingActionButtonSpec/JJFloatingActionButton_using_layout_constraints__looks_correct_when_diameter_is_set@3x.png index 59740e1c..2853b55d 100644 Binary files a/Example/Tests/ReferenceImages/JJFloatingActionButtonSpec/JJFloatingActionButton_using_layout_constraints__looks_correct_when_diameter_is_set@3x.png and b/Example/Tests/ReferenceImages/JJFloatingActionButtonSpec/JJFloatingActionButton_using_layout_constraints__looks_correct_when_diameter_is_set@3x.png differ diff --git a/Example/Tests/UIColorExtensionsSpec.swift b/Example/Tests/UIColorExtensionsSpec.swift index 72c07c10..636551c4 100644 --- a/Example/Tests/UIColorExtensionsSpec.swift +++ b/Example/Tests/UIColorExtensionsSpec.swift @@ -25,9 +25,10 @@ @testable import JJFloatingActionButton import Nimble import Quick +import XCTest class UIColorExtensionsSpec: QuickSpec { - override func spec() { + override class func spec() { describe("UIColor") { context("when light") { var originalColor: UIColor! diff --git a/Gemfile b/Gemfile index 9db03fe8..7970879a 100644 --- a/Gemfile +++ b/Gemfile @@ -1,14 +1,10 @@ -source 'https://rubygems.org' do - gem 'cocoapods' - gem 'cocoapods-deintegrate' - gem 'cocoapods-clean' - gem 'xcpretty' - gem 'synx' - gem 'github_changelog_generator', '~> 1.14.0' - gem 'jazzy' - gem 'rake' - gem 'fileutils' - gem 'octokit' - gem 'xcode-install' -end +source 'https://rubygems.org' +gem 'cocoapods' +gem 'xcode-install' +gem 'synx' +gem 'github_changelog_generator' +gem 'jazzy' +gem 'rake' +gem 'fileutils' +gem 'octokit' \ No newline at end of file diff --git a/Gemfile.lock b/Gemfile.lock index 2d3ac21f..bffe897f 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,300 +1,353 @@ GEM remote: https://rubygems.org/ specs: - CFPropertyList (3.0.2) - activesupport (4.2.11.1) - i18n (~> 0.7) - minitest (~> 5.1) - thread_safe (~> 0.3, >= 0.3.4) - tzinfo (~> 1.1) - addressable (2.7.0) - public_suffix (>= 2.0.2, < 5.0) - algoliasearch (1.27.1) + CFPropertyList (3.0.6) + rexml + activesupport (7.1.2) + base64 + bigdecimal + concurrent-ruby (~> 1.0, >= 1.0.2) + connection_pool (>= 2.2.5) + drb + i18n (>= 1.6, < 2) + minitest (>= 5.1) + mutex_m + tzinfo (~> 2.0) + addressable (2.8.6) + public_suffix (>= 2.0.2, < 6.0) + algoliasearch (1.27.5) httpclient (~> 2.8, >= 2.8.3) json (>= 1.5.1) + artifactory (3.0.15) atomos (0.1.3) - aws-eventstream (1.1.0) - aws-partitions (1.297.0) - aws-sdk-core (3.94.0) - aws-eventstream (~> 1, >= 1.0.2) - aws-partitions (~> 1, >= 1.239.0) - aws-sigv4 (~> 1.1) - jmespath (~> 1.0) - aws-sdk-kms (1.30.0) - aws-sdk-core (~> 3, >= 3.71.0) + aws-eventstream (1.3.0) + aws-partitions (1.877.0) + aws-sdk-core (3.190.1) + aws-eventstream (~> 1, >= 1.3.0) + aws-partitions (~> 1, >= 1.651.0) + aws-sigv4 (~> 1.8) + jmespath (~> 1, >= 1.6.1) + aws-sdk-kms (1.75.0) + aws-sdk-core (~> 3, >= 3.188.0) aws-sigv4 (~> 1.1) - aws-sdk-s3 (1.61.2) - aws-sdk-core (~> 3, >= 3.83.0) + aws-sdk-s3 (1.142.0) + aws-sdk-core (~> 3, >= 3.189.0) aws-sdk-kms (~> 1) - aws-sigv4 (~> 1.1) - aws-sigv4 (1.1.1) - aws-eventstream (~> 1.0, >= 1.0.2) - babosa (1.0.3) - claide (1.0.3) + aws-sigv4 (~> 1.8) + aws-sigv4 (1.8.0) + aws-eventstream (~> 1, >= 1.0.2) + babosa (1.0.4) + base64 (0.2.0) + bigdecimal (3.1.5) + claide (1.1.0) clamp (0.6.5) - cocoapods (1.9.1) - activesupport (>= 4.0.2, < 5) + cocoapods (1.14.3) + addressable (~> 2.8) claide (>= 1.0.2, < 2.0) - cocoapods-core (= 1.9.1) + cocoapods-core (= 1.14.3) cocoapods-deintegrate (>= 1.0.3, < 2.0) - cocoapods-downloader (>= 1.2.2, < 2.0) + cocoapods-downloader (>= 2.1, < 3.0) cocoapods-plugins (>= 1.0.0, < 2.0) cocoapods-search (>= 1.0.0, < 2.0) - cocoapods-stats (>= 1.0.0, < 2.0) - cocoapods-trunk (>= 1.4.0, < 2.0) + cocoapods-trunk (>= 1.6.0, < 2.0) cocoapods-try (>= 1.1.0, < 2.0) colored2 (~> 3.1) escape (~> 0.0.4) fourflusher (>= 2.3.0, < 3.0) gh_inspector (~> 1.0) - molinillo (~> 0.6.6) + molinillo (~> 0.8.0) nap (~> 1.0) - ruby-macho (~> 1.4) - xcodeproj (>= 1.14.0, < 2.0) - cocoapods-clean (0.0.1) - cocoapods-core (1.9.1) - activesupport (>= 4.0.2, < 6) + ruby-macho (>= 2.3.0, < 3.0) + xcodeproj (>= 1.23.0, < 2.0) + cocoapods-core (1.14.3) + activesupport (>= 5.0, < 8) + addressable (~> 2.8) algoliasearch (~> 1.0) concurrent-ruby (~> 1.1) fuzzy_match (~> 2.0.4) nap (~> 1.0) netrc (~> 0.11) + public_suffix (~> 4.0) typhoeus (~> 1.0) - cocoapods-deintegrate (1.0.4) - cocoapods-downloader (1.3.0) + cocoapods-deintegrate (1.0.5) + cocoapods-downloader (2.1) cocoapods-plugins (1.0.0) nap - cocoapods-search (1.0.0) - cocoapods-stats (1.1.0) - cocoapods-trunk (1.4.1) + cocoapods-search (1.0.1) + cocoapods-trunk (1.6.0) nap (>= 0.8, < 2.0) netrc (~> 0.11) - cocoapods-try (1.1.0) + cocoapods-try (1.2.0) colored (1.2) colored2 (3.1.2) colorize (0.8.1) - commander-fastlane (4.4.6) - highline (~> 1.7.2) - concurrent-ruby (1.1.6) - declarative (0.0.10) - declarative-option (0.1.0) - digest-crc (0.5.1) - domain_name (0.5.20190701) - unf (>= 0.0.5, < 1.0.0) - dotenv (2.7.5) - emoji_regex (1.0.1) + commander (4.6.0) + highline (~> 2.0.0) + concurrent-ruby (1.2.2) + connection_pool (2.4.1) + declarative (0.0.20) + descendants_tracker (0.0.4) + thread_safe (~> 0.3, >= 0.3.1) + digest-crc (0.6.5) + rake (>= 12.0.0, < 14.0.0) + domain_name (0.6.20231109) + dotenv (2.8.1) + drb (2.2.0) + ruby2_keywords + emoji_regex (3.2.3) escape (0.0.4) - ethon (0.12.0) - ffi (>= 1.3.0) - excon (0.73.0) - faraday (0.17.3) - multipart-post (>= 1.2, < 3) - faraday-cookie_jar (0.0.6) - faraday (>= 0.7.4) + ethon (0.16.0) + ffi (>= 1.15.0) + excon (0.109.0) + faraday (1.10.3) + faraday-em_http (~> 1.0) + faraday-em_synchrony (~> 1.0) + faraday-excon (~> 1.1) + faraday-httpclient (~> 1.0) + faraday-multipart (~> 1.0) + faraday-net_http (~> 1.0) + faraday-net_http_persistent (~> 1.0) + faraday-patron (~> 1.0) + faraday-rack (~> 1.0) + faraday-retry (~> 1.0) + ruby2_keywords (>= 0.0.4) + faraday-cookie_jar (0.0.7) + faraday (>= 0.8.0) http-cookie (~> 1.0.0) - faraday-http-cache (2.2.0) - faraday (>= 0.8) - faraday_middleware (0.13.1) - faraday (>= 0.7.4, < 1.0) - fastimage (2.1.7) - fastlane (2.145.0) + faraday-em_http (1.0.0) + faraday-em_synchrony (1.0.0) + faraday-excon (1.1.0) + faraday-httpclient (1.0.1) + faraday-multipart (1.0.4) + multipart-post (~> 2) + faraday-net_http (1.0.1) + faraday-net_http_persistent (1.2.0) + faraday-patron (1.0.0) + faraday-rack (1.0.0) + faraday-retry (1.0.3) + faraday_middleware (1.2.0) + faraday (~> 1.0) + fastimage (2.3.0) + fastlane (2.218.0) CFPropertyList (>= 2.3, < 4.0.0) - addressable (>= 2.3, < 3.0.0) + addressable (>= 2.8, < 3.0.0) + artifactory (~> 3.0) aws-sdk-s3 (~> 1.0) - babosa (>= 1.0.2, < 2.0.0) + babosa (>= 1.0.3, < 2.0.0) bundler (>= 1.12.0, < 3.0.0) colored - commander-fastlane (>= 4.4.6, < 5.0.0) + commander (~> 4.6) dotenv (>= 2.1.1, < 3.0.0) - emoji_regex (>= 0.1, < 2.0) + emoji_regex (>= 0.1, < 4.0) excon (>= 0.71.0, < 1.0.0) - faraday (~> 0.17) + faraday (~> 1.0) faraday-cookie_jar (~> 0.0.6) - faraday_middleware (~> 0.13.1) + faraday_middleware (~> 1.0) fastimage (>= 2.1.0, < 3.0.0) gh_inspector (>= 1.1.2, < 2.0.0) - google-api-client (>= 0.29.2, < 0.37.0) - google-cloud-storage (>= 1.15.0, < 2.0.0) - highline (>= 1.7.2, < 2.0.0) + google-apis-androidpublisher_v3 (~> 0.3) + google-apis-playcustomapp_v1 (~> 0.1) + google-cloud-storage (~> 1.31) + highline (~> 2.0) + http-cookie (~> 1.0.5) json (< 3.0.0) - jwt (~> 2.1.0) + jwt (>= 2.1.0, < 3) mini_magick (>= 4.9.4, < 5.0.0) - multi_xml (~> 0.5) - multipart-post (~> 2.0.0) + multipart-post (>= 2.0.0, < 3.0.0) + naturally (~> 2.2) + optparse (>= 0.1.1) plist (>= 3.1.0, < 4.0.0) - public_suffix (~> 2.0.0) - rubyzip (>= 1.3.0, < 2.0.0) + rubyzip (>= 2.0.0, < 3.0.0) security (= 0.1.3) simctl (~> 1.6.3) - slack-notifier (>= 2.0.0, < 3.0.0) terminal-notifier (>= 2.0.0, < 3.0.0) - terminal-table (>= 1.4.5, < 2.0.0) + terminal-table (~> 3) tty-screen (>= 0.6.3, < 1.0.0) tty-spinner (>= 0.8.0, < 1.0.0) word_wrap (~> 1.0.0) xcodeproj (>= 1.13.0, < 2.0.0) xcpretty (~> 0.3.0) xcpretty-travis-formatter (>= 0.0.3) - ffi (1.12.2) - fileutils (1.4.1) + ffi (1.16.3) + fileutils (1.7.2) fourflusher (2.3.1) fuzzy_match (2.0.4) gh_inspector (1.1.3) - github_changelog_generator (1.14.3) - activesupport - faraday-http-cache - multi_json - octokit (~> 4.6) + github_api (0.19.0) + addressable (~> 2.4) + descendants_tracker (~> 0.0.4) + faraday (>= 0.8, < 2) + hashie (~> 3.5, >= 3.5.2) + oauth2 (~> 1.0) + github_changelog_generator (1.13.2) + github_api (>= 0.14) rainbow (>= 2.1) rake (>= 10.0) - retriable (~> 2.1) - google-api-client (0.36.4) + google-apis-androidpublisher_v3 (0.54.0) + google-apis-core (>= 0.11.0, < 2.a) + google-apis-core (0.11.2) addressable (~> 2.5, >= 2.5.1) - googleauth (~> 0.9) - httpclient (>= 2.8.1, < 3.0) + googleauth (>= 0.16.2, < 2.a) + httpclient (>= 2.8.1, < 3.a) mini_mime (~> 1.0) representable (~> 3.0) - retriable (>= 2.0, < 4.0) - signet (~> 0.12) - google-cloud-core (1.5.0) - google-cloud-env (~> 1.0) + retriable (>= 2.0, < 4.a) + rexml + webrick + google-apis-iamcredentials_v1 (0.17.0) + google-apis-core (>= 0.11.0, < 2.a) + google-apis-playcustomapp_v1 (0.13.0) + google-apis-core (>= 0.11.0, < 2.a) + google-apis-storage_v1 (0.29.0) + google-apis-core (>= 0.11.0, < 2.a) + google-cloud-core (1.6.1) + google-cloud-env (>= 1.0, < 3.a) google-cloud-errors (~> 1.0) - google-cloud-env (1.3.1) - faraday (>= 0.17.3, < 2.0) - google-cloud-errors (1.0.0) - google-cloud-storage (1.26.0) - addressable (~> 2.5) + google-cloud-env (2.1.0) + faraday (>= 1.0, < 3.a) + google-cloud-errors (1.3.1) + google-cloud-storage (1.45.0) + addressable (~> 2.8) digest-crc (~> 0.4) - google-api-client (~> 0.33) - google-cloud-core (~> 1.2) - googleauth (~> 0.9) + google-apis-iamcredentials_v1 (~> 0.1) + google-apis-storage_v1 (~> 0.29.0) + google-cloud-core (~> 1.6) + googleauth (>= 0.16.2, < 2.a) mini_mime (~> 1.0) - googleauth (0.12.0) - faraday (>= 0.17.3, < 2.0) + googleauth (1.9.1) + faraday (>= 1.0, < 3.a) + google-cloud-env (~> 2.1) jwt (>= 1.4, < 3.0) - memoist (~> 0.16) multi_json (~> 1.11) os (>= 0.9, < 2.0) - signet (~> 0.14) - highline (1.7.10) - http-cookie (1.0.3) + signet (>= 0.16, < 2.a) + hashie (3.6.0) + highline (2.0.3) + http-cookie (1.0.5) domain_name (~> 0.5) httpclient (2.8.3) - i18n (0.9.5) + i18n (1.14.1) concurrent-ruby (~> 1.0) - jazzy (0.13.2) + jazzy (0.14.4) cocoapods (~> 1.5) mustache (~> 1.1) - open4 + open4 (~> 1.3) redcarpet (~> 3.4) - rouge (>= 2.0.6, < 4.0) + rexml (~> 3.2) + rouge (>= 2.0.6, < 5.0) sassc (~> 2.1) sqlite3 (~> 1.3) xcinvoke (~> 0.3.0) - jmespath (1.4.0) - json (2.3.0) - jwt (2.1.0) + jmespath (1.6.2) + json (2.7.1) + jwt (2.7.1) liferaft (0.0.6) - memoist (0.16.2) - mini_magick (4.10.1) - mini_mime (1.0.2) - minitest (5.14.0) - molinillo (0.6.6) - multi_json (1.14.1) + mini_magick (4.12.0) + mini_mime (1.1.5) + minitest (5.20.0) + molinillo (0.8.0) + multi_json (1.15.0) multi_xml (0.6.0) - multipart-post (2.0.0) + multipart-post (2.3.0) mustache (1.1.1) - nanaimo (0.2.6) + mutex_m (0.2.0) + nanaimo (0.3.0) nap (1.1.0) - naturally (2.2.0) + naturally (2.2.1) netrc (0.11.0) - octokit (4.18.0) - faraday (>= 0.9) - sawyer (~> 0.8.0, >= 0.5.3) + oauth2 (1.4.11) + faraday (>= 0.17.3, < 3.0) + jwt (>= 1.0, < 3.0) + multi_json (~> 1.3) + multi_xml (~> 0.5) + rack (>= 1.2, < 4) + octokit (8.0.0) + faraday (>= 1, < 3) + sawyer (~> 0.9) open4 (1.3.4) - os (1.1.0) - plist (3.5.0) - public_suffix (2.0.5) - rainbow (3.0.0) - rake (13.0.1) - redcarpet (3.5.0) - representable (3.0.4) + optparse (0.4.0) + os (1.1.4) + plist (3.7.1) + public_suffix (4.0.7) + rack (3.0.8) + rainbow (3.1.1) + rake (13.1.0) + redcarpet (3.6.0) + representable (3.2.0) declarative (< 0.1.0) - declarative-option (< 0.2.0) + trailblazer-option (>= 0.1.1, < 0.2.0) uber (< 0.2.0) - retriable (2.1.0) + retriable (3.1.2) + rexml (3.2.6) rouge (2.0.7) - ruby-macho (1.4.0) - rubyzip (1.3.0) - sassc (2.3.0) + ruby-macho (2.5.1) + ruby2_keywords (0.0.5) + rubyzip (2.3.2) + sassc (2.4.0) ffi (~> 1.9) - sawyer (0.8.2) + sawyer (0.9.2) addressable (>= 2.3.5) - faraday (> 0.8, < 2.0) + faraday (>= 0.17.3, < 3) security (0.1.3) - signet (0.14.0) - addressable (~> 2.3) - faraday (>= 0.17.3, < 2.0) + signet (0.18.0) + addressable (~> 2.8) + faraday (>= 0.17.5, < 3.a) jwt (>= 1.5, < 3.0) multi_json (~> 1.10) - simctl (1.6.8) + simctl (1.6.10) CFPropertyList naturally - slack-notifier (2.3.2) - sqlite3 (1.4.2) + sqlite3 (1.7.0-arm64-darwin) synx (0.2.1) clamp (~> 0.6) colorize (~> 0.7) xcodeproj (~> 1.0) terminal-notifier (2.0.0) - terminal-table (1.8.0) - unicode-display_width (~> 1.1, >= 1.1.1) + terminal-table (3.0.2) + unicode-display_width (>= 1.1.1, < 3) thread_safe (0.3.6) + trailblazer-option (0.1.2) tty-cursor (0.7.1) - tty-screen (0.7.1) + tty-screen (0.8.2) tty-spinner (0.9.3) tty-cursor (~> 0.7) - typhoeus (1.3.1) + typhoeus (1.4.1) ethon (>= 0.9.0) - tzinfo (1.2.7) - thread_safe (~> 0.1) + tzinfo (2.0.6) + concurrent-ruby (~> 1.0) uber (0.1.0) - unf (0.1.4) - unf_ext - unf_ext (0.0.7.7) - unicode-display_width (1.7.0) + unicode-display_width (2.5.0) + webrick (1.8.1) word_wrap (1.0.0) xcinvoke (0.3.0) liferaft (~> 0.0.6) - xcode-install (2.6.4) - claide (>= 0.9.1, < 1.1.0) + xcode-install (2.8.1) + claide (>= 0.9.1) fastlane (>= 2.1.0, < 3.0.0) - xcodeproj (1.16.0) + xcodeproj (1.23.0) CFPropertyList (>= 2.3.3, < 4.0) atomos (~> 0.1.3) claide (>= 1.0.2, < 2.0) colored2 (~> 3.1) - nanaimo (~> 0.2.6) + nanaimo (~> 0.3.0) + rexml (~> 3.2.4) xcpretty (0.3.0) rouge (~> 2.0.7) - xcpretty-travis-formatter (1.0.0) + xcpretty-travis-formatter (1.0.1) xcpretty (~> 0.2, >= 0.0.7) PLATFORMS - ruby + arm64-darwin-23 DEPENDENCIES - cocoapods! - cocoapods-clean! - cocoapods-deintegrate! - fileutils! - github_changelog_generator (~> 1.14.0)! - jazzy! - octokit! - rake! - synx! - xcode-install! - xcpretty! + cocoapods + fileutils + github_changelog_generator + jazzy + octokit + rake + synx + xcode-install BUNDLED WITH - 2.1.4 + 2.4.22 diff --git a/JJFloatingActionButton.podspec b/JJFloatingActionButton.podspec index 7dcdeaec..bb4f9afa 100644 --- a/JJFloatingActionButton.podspec +++ b/JJFloatingActionButton.podspec @@ -12,7 +12,7 @@ Pod::Spec.new do |spec| spec.documentation_url = 'https://jjochen.github.io/JJFloatingActionButton' spec.platform = :ios - spec.ios.deployment_target = '9.0' + spec.ios.deployment_target = '13.0' spec.requires_arc = true spec.frameworks = 'UIKit' diff --git a/Package.swift b/Package.swift index 115690a5..1aa05a66 100644 --- a/Package.swift +++ b/Package.swift @@ -5,18 +5,20 @@ import PackageDescription let package = Package( name: "JJFloatingActionButton", platforms: [ - .iOS(.v9) + .iOS(.v9), ], products: [ .library( name: "JJFloatingActionButton", - targets: ["JJFloatingActionButton"]), + targets: ["JJFloatingActionButton"] + ), ], dependencies: [ ], targets: [ .target( name: "JJFloatingActionButton", - path: "Sources") + path: "Sources" + ), ] ) diff --git a/README.md b/README.md index 34bb579b..43aeef21 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,20 @@ + + # JJFloatingActionButton + Floating Action Button for iOS ----

- Swift 5.0 - Version - License - Platform - Build Status - codecov - Code Climate - Documentation + Swift 5.0 + Version + License + Platform + Build Status + codecov + Code Climate + Documentation Contributions Welcome

@@ -31,26 +34,23 @@ Floating Action Button for iOS - Comprehensive Test Coverage ✓ - [Complete Documentation](https://jjochen.github.io/JJFloatingActionButton) ✓ - ## Preview

- Preview Basics - Preview Configuration + Preview Basics + Preview Configuration

- Preview Circular + Preview Circular Preview Single Item

- ## Requirements -- iOS 9.0+ -- Xcode 10.2+ +- iOS 13.0+ +- Xcode 14+ - Swift 5.0 - ## Installation ### CocoaPods @@ -58,14 +58,14 @@ Floating Action Button for iOS [CocoaPods](http://cocoapods.org) is a dependency manager for Cocoa projects. You can install it with the following command: ```bash -$ gem install cocoapods +gem install cocoapods ``` To integrate JJFloatingActionButton into your Xcode project using CocoaPods, specify it in your `Podfile`: ```ruby -source 'https://github.com/CocoaPods/Specs.git' -platform :ios, '9.0' +source 'https://cdn.cocoapods.org/' +platform :ios, '13.0' use_frameworks! target '' do @@ -76,14 +76,13 @@ end Then, run the following command: ```bash -$ pod install +pod install ``` ### Manually If you prefer not to use a dependency manager, you can integrate JJFloatingActionButton into your project manually. - ## Usage ### Quick Start @@ -148,7 +147,7 @@ actionButton.configureDefaultItem { item in item.layer.shadowRadius = CGFloat(2) } -actionButton.addItem(title: "Balloon", image: UIImage(named: "Baloon")) { item in +actionButton.addItem(title: "Balloon", image: UIImage(named: "Balloon")) { item in // Do something } @@ -177,19 +176,17 @@ optional func floatingActionButtonDidClose(_ button: JJFloatingActionButton) To run the example project, just run the following command: ```bash -$ pod try JJFloatingActionButton +pod try JJFloatingActionButton ``` ### Resources - [Documentation](https://jjochen.github.io/JJFloatingActionButton/) - ## Author Jochen Pfeiffer [https://github.com/jjochen](https://github.com/jjochen) - ## License JJFloatingActionButton is available under the MIT license. See the LICENSE file for more info. diff --git a/Rakefile b/Rakefile index 59df7c8b..eff13ff7 100644 --- a/Rakefile +++ b/Rakefile @@ -42,7 +42,7 @@ begin desc 'Run tests' task :test do - xcodebuild_test "platform=iOS Simulator,name=iPhone X" + xcodebuild_test "platform=iOS Simulator,name=iPhone 15 Pro Max,OS=17.2" end desc 'Run tests for DESTINATION env' @@ -51,12 +51,24 @@ begin xcodebuild_test ENV['DESTINATION'] end + desc 'Copy snapshot artifacts' + task :copy_snapshots do + sh 'rm -rf /tmp/snapshots' + simulator_directory = `xcrun simctl get_app_container booted org.cocoapods.demo.JJFloatingActionButton-Example data`.strip + unless simulator_directory.empty? + puts "Copying snapshots from #{simulator_directory}" + sh "cp -R #{simulator_directory}/tmp /tmp/snapshots" + else + puts "No simulator directory found" + end + end + desc 'Print debug info' task :print_debug_info do title 'Debug info' sh 'xcodebuild -version' sh 'xcodebuild -showsdks' - sh 'instruments -s devices' + sh 'xcrun xctrace list devices' end desc 'Lint swift' @@ -170,12 +182,12 @@ begin task :release_next_version, :type do |task, args| release_next_version args.type end - + desc 'Release version' task :release_version, :version do |task, args| release_version args.version end - + desc 'Delete GitHub release tag of type' task :delete_github_release_trigger_tag, :type do |task, args| delete_github_release_trigger_tag args.type @@ -190,12 +202,12 @@ begin desc 'Create release on github' task :create_github_release do version = version_from_podspec - + unless is_release_commit_for_version version puts "Not a release commit." next end - + title "Creating release on github" repo = "jjochen/JJFloatingActionButton" body = changelog_for_version version @@ -208,7 +220,7 @@ begin puts "repo: #{repo}" puts "version: #{version}" - puts "body: \n#{body}" + puts "body: \n#{body}" client = Octokit::Client.new :access_token => ENV['JJ_GITHUB_TOKEN'] release = client.create_release repo, version, options @@ -525,7 +537,7 @@ def open_pull_request(version) puts "repo: #{repo}" puts "base: #{base}" - puts "head: #{release_branch}" + puts "head: #{release_branch}" client = Octokit::Client.new :access_token => ENV['JJ_GITHUB_TOKEN'] diff --git a/Sources/AnimationConfiguration.swift b/Sources/AnimationConfiguration.swift index 1cfff835..a1764a76 100644 --- a/Sources/AnimationConfiguration.swift +++ b/Sources/AnimationConfiguration.swift @@ -146,7 +146,7 @@ import UIKit /// /// - Returns: A button animation configuration object. /// - @objc static func rotation(toAngle angle: CGFloat = -.pi / 4) -> JJButtonAnimationConfiguration { + static func rotation(toAngle angle: CGFloat = -.pi / 4) -> JJButtonAnimationConfiguration { let configuration = JJButtonAnimationConfiguration(withStyle: .rotation) configuration.angle = angle return configuration @@ -158,7 +158,7 @@ import UIKit /// /// - Returns: A button animation configuration object. /// - @objc static func transition(toImage image: UIImage) -> JJButtonAnimationConfiguration { + static func transition(toImage image: UIImage) -> JJButtonAnimationConfiguration { let configuration = JJButtonAnimationConfiguration(withStyle: .transition) configuration.image = image return configuration @@ -216,8 +216,8 @@ import UIKit /// /// - Returns: An item animation configuration object. /// - @objc static func popUp(withInterItemSpacing interItemSpacing: CGFloat = 12, - firstItemSpacing: CGFloat = 0) -> JJItemAnimationConfiguration { + static func popUp(withInterItemSpacing interItemSpacing: CGFloat = 12, + firstItemSpacing: CGFloat = 0) -> JJItemAnimationConfiguration { let configuration = JJItemAnimationConfiguration() configuration.itemLayout = .verticalLine(withInterItemSpacing: interItemSpacing, firstItemSpacing: firstItemSpacing) configuration.closedState = .scale() @@ -235,8 +235,8 @@ import UIKit /// /// - Returns: An item animation configuration object. /// - @objc static func slideIn(withInterItemSpacing interItemSpacing: CGFloat = 12, - firstItemSpacing: CGFloat = 0) -> JJItemAnimationConfiguration { + static func slideIn(withInterItemSpacing interItemSpacing: CGFloat = 12, + firstItemSpacing: CGFloat = 0) -> JJItemAnimationConfiguration { let configuration = JJItemAnimationConfiguration() configuration.itemLayout = .verticalLine(withInterItemSpacing: interItemSpacing, firstItemSpacing: firstItemSpacing) configuration.closedState = .horizontalOffset() @@ -251,7 +251,7 @@ import UIKit /// /// - Returns: An item animation configuration object. /// - @objc static func circularPopUp(withRadius radius: CGFloat = 100) -> JJItemAnimationConfiguration { + static func circularPopUp(withRadius radius: CGFloat = 100) -> JJItemAnimationConfiguration { let configuration = JJItemAnimationConfiguration() configuration.itemLayout = .circular(withRadius: radius) configuration.closedState = .scale() @@ -268,7 +268,7 @@ import UIKit /// /// - Returns: An item animation configuration object. /// - @objc static func circularSlideIn(withRadius radius: CGFloat = 100) -> JJItemAnimationConfiguration { + static func circularSlideIn(withRadius radius: CGFloat = 100) -> JJItemAnimationConfiguration { let configuration = JJItemAnimationConfiguration() configuration.itemLayout = .circular(withRadius: radius) configuration.closedState = .circularOffset(distance: radius * 0.75) @@ -459,7 +459,7 @@ import UIKit // MARK: - Helper -internal extension JJItemAnimationConfiguration { +extension JJItemAnimationConfiguration { static func angleForItem(at index: Int, numberOfItems: Int, actionButton: JJFloatingActionButton) -> CGFloat { precondition(numberOfItems > 0) precondition(index >= 0) @@ -481,7 +481,7 @@ internal extension JJItemAnimationConfiguration { } } -fileprivate extension JJItemLayout { +private extension JJItemLayout { static func selectSpacing(forFirstItem isFirstItem: Bool, defaultSpacing: CGFloat, firstItemSpacing: CGFloat) -> CGFloat { if isFirstItem && firstItemSpacing > 0 { return firstItemSpacing @@ -490,7 +490,7 @@ fileprivate extension JJItemLayout { } } -fileprivate extension JJActionItem { +private extension JJActionItem { func scale(by factor: CGFloat, translationX: CGFloat = 0, translationY: CGFloat = 0) { let scale = scaleTransformation(factor: factor) let translation = CGAffineTransform(translationX: translationX, y: translationY) @@ -498,7 +498,7 @@ fileprivate extension JJActionItem { } } -fileprivate extension JJActionItem { +private extension JJActionItem { func scaleTransformation(factor: CGFloat) -> CGAffineTransform { let scale = CGAffineTransform(scaleX: factor, y: factor) @@ -519,9 +519,9 @@ fileprivate extension JJActionItem { } } -internal extension UIView { +extension UIView { var isOnLeftSideOfScreen: Bool { - return isOnLeftSide(ofView: UIApplication.shared.keyWindow) + return isOnLeftSide(ofView: UIWindow.key) } func isOnLeftSide(ofView superview: UIView?) -> Bool { diff --git a/Sources/JJActionItem.swift b/Sources/JJActionItem.swift index 60cf01fc..4f529f97 100644 --- a/Sources/JJActionItem.swift +++ b/Sources/JJActionItem.swift @@ -45,7 +45,7 @@ import UIKit /// /// - SeeAlso: `circleView` /// - @objc @IBInspectable public dynamic var buttonColor: UIColor { + @IBInspectable public dynamic var buttonColor: UIColor { get { return circleView.color } @@ -59,7 +59,7 @@ import UIKit /// /// - SeeAlso: `circleView` /// - @objc @IBInspectable public dynamic var highlightedButtonColor: UIColor? { + @IBInspectable public dynamic var highlightedButtonColor: UIColor? { get { return circleView.highlightedColor } @@ -73,7 +73,7 @@ import UIKit /// /// - SeeAlso: `imageView` /// - @objc @IBInspectable public dynamic var buttonImage: UIImage? { + @IBInspectable public dynamic var buttonImage: UIImage? { get { return imageView.image } @@ -89,7 +89,7 @@ import UIKit /// /// - SeeAlso: `imageView` /// - @objc @IBInspectable public dynamic var buttonImageColor: UIColor { + @IBInspectable public dynamic var buttonImageColor: UIColor { get { return imageView.tintColor } @@ -167,7 +167,7 @@ import UIKit } } - internal override init(frame: CGRect) { + override init(frame: CGRect) { super.init(frame: frame) setup() } @@ -191,14 +191,14 @@ import UIKit extension JJActionItem { /// Tells the view that its superview changed. /// - open override func didMoveToSuperview() { + override open func didMoveToSuperview() { // reset tintAdjustmentMode imageView.tintColorDidChange() } /// Updates constraints for the view. /// - open override func updateConstraints() { + override open func updateConstraints() { updateDynamicConstraints() super.updateConstraints() } @@ -209,20 +209,20 @@ extension JJActionItem { extension JJActionItem { /// A Boolean value indicating whether the action item draws a highlight. /// - open override var isHighlighted: Bool { + override open var isHighlighted: Bool { + get { + return super.isHighlighted + } set { super.isHighlighted = newValue circleView.isHighlighted = newValue } - get { - return super.isHighlighted - } } } // MARK: - Private Methods -fileprivate extension JJActionItem { +private extension JJActionItem { func setup() { backgroundColor = .clear isUserInteractionEnabled = true diff --git a/Sources/JJCircleView.swift b/Sources/JJCircleView.swift index 9de1c66e..6cec8b15 100644 --- a/Sources/JJCircleView.swift +++ b/Sources/JJCircleView.swift @@ -29,7 +29,7 @@ import UIKit @objc @IBDesignable public class JJCircleView: UIView { /// The color of the circle. /// - @objc @IBInspectable public dynamic var color: UIColor = Styles.defaultButtonColor { + @IBInspectable public dynamic var color: UIColor = Styles.defaultButtonColor { didSet { updateHighlightedColorFallback() setNeedsDisplay() @@ -38,7 +38,7 @@ import UIKit /// The color of the circle when highlighted. Default is `nil`. /// - @objc @IBInspectable public dynamic var highlightedColor: UIColor? { + @IBInspectable public dynamic var highlightedColor: UIColor? { didSet { setNeedsDisplay() } @@ -53,7 +53,7 @@ import UIKit } } - internal override init(frame: CGRect) { + override init(frame: CGRect) { super.init(frame: frame) setup() } @@ -72,7 +72,7 @@ import UIKit /// Draws the receiver’s image within the passed-in rectangle /// Overrides `draw(rect: CGRect)` from `UIView`. /// - public override func draw(_: CGRect) { + override public func draw(_: CGRect) { drawCircle(inRect: bounds) } @@ -81,7 +81,7 @@ import UIKit // MARK: - Private Methods -fileprivate extension JJCircleView { +private extension JJCircleView { func setup() { backgroundColor = .clear } diff --git a/Sources/JJFloatingActionButton+Animation.swift b/Sources/JJFloatingActionButton+Animation.swift index 9b29a730..b5842d70 100644 --- a/Sources/JJFloatingActionButton+Animation.swift +++ b/Sources/JJFloatingActionButton+Animation.swift @@ -116,7 +116,7 @@ import UIKit } } -internal extension JJFloatingActionButton { +extension JJFloatingActionButton { func removeRelatedViewsFromSuperview() { if overlayView.superview != nil { overlayView.removeFromSuperview() @@ -130,7 +130,7 @@ internal extension JJFloatingActionButton { // MARK: - Animation State -fileprivate extension JJFloatingActionButton { +private extension JJFloatingActionButton { func storeAnimationState() { openItems = enabledItems currentItemAnimationConfiguration = itemAnimationConfiguration @@ -146,7 +146,7 @@ fileprivate extension JJFloatingActionButton { // MARK: - Overlay Animation -fileprivate extension JJFloatingActionButton { +private extension JJFloatingActionButton { func addOverlayView(to superview: UIView) { overlayView.isEnabled = true superview.insertSubview(overlayView, belowSubview: self) @@ -188,7 +188,7 @@ fileprivate extension JJFloatingActionButton { // MARK: - Button Animation -fileprivate extension JJFloatingActionButton { +private extension JJFloatingActionButton { func openButton(withConfiguration configuration: JJButtonAnimationConfiguration, animated: Bool, group: DispatchGroup) { @@ -256,7 +256,7 @@ fileprivate extension JJFloatingActionButton { // MARK: - Items Animation -fileprivate extension JJFloatingActionButton { +private extension JJFloatingActionButton { func addItems(to superview: UIView) { precondition(currentItemAnimationConfiguration != nil) let configuration = currentItemAnimationConfiguration! diff --git a/Sources/JJFloatingActionButton+Placement.swift b/Sources/JJFloatingActionButton+Placement.swift index 58ee2d3c..6036c54d 100644 --- a/Sources/JJFloatingActionButton+Placement.swift +++ b/Sources/JJFloatingActionButton+Placement.swift @@ -54,15 +54,13 @@ import UIKit trailing.priority = .required trailing.isActive = true - if #available(iOS 11.0, *) { - trailing = trailingAnchor.constraint(equalTo: superview.safeAreaLayoutGuide.trailingAnchor, constant: -safeAreaInset) - trailing.priority = UILayoutPriority(750) - trailing.isActive = true + trailing = trailingAnchor.constraint(equalTo: superview.safeAreaLayoutGuide.trailingAnchor, constant: -safeAreaInset) + trailing.priority = UILayoutPriority(750) + trailing.isActive = true - trailing = trailingAnchor.constraint(lessThanOrEqualTo: superview.safeAreaLayoutGuide.trailingAnchor, constant: -safeAreaInset) - trailing.priority = .required - trailing.isActive = true - } + trailing = trailingAnchor.constraint(lessThanOrEqualTo: superview.safeAreaLayoutGuide.trailingAnchor, constant: -safeAreaInset) + trailing.priority = .required + trailing.isActive = true var bottom: NSLayoutConstraint @@ -74,15 +72,13 @@ import UIKit bottom.priority = .required bottom.isActive = true - if #available(iOS 11.0, *) { - bottom = bottomAnchor.constraint(equalTo: superview.safeAreaLayoutGuide.bottomAnchor, constant: -safeAreaInset) - bottom.priority = UILayoutPriority(750) - bottom.isActive = true + bottom = bottomAnchor.constraint(equalTo: superview.safeAreaLayoutGuide.bottomAnchor, constant: -safeAreaInset) + bottom.priority = UILayoutPriority(750) + bottom.isActive = true - bottom = bottomAnchor.constraint(lessThanOrEqualTo: superview.safeAreaLayoutGuide.bottomAnchor, constant: -safeAreaInset) - bottom.priority = .required - bottom.isActive = true - } + bottom = bottomAnchor.constraint(lessThanOrEqualTo: superview.safeAreaLayoutGuide.bottomAnchor, constant: -safeAreaInset) + bottom.priority = .required + bottom.isActive = true } /// Add floating action button to a view of a given view controller and place in trailing bottom corner. @@ -104,12 +100,13 @@ import UIKit if let superview = viewController.view { display(inView: superview, bottomInset: bottomInset, trailingInset: trailingInset, safeAreaInset: safeAreaInset) var bottom: NSLayoutConstraint + let bottomAnchor = viewController.view.safeAreaLayoutGuide.bottomAnchor - bottom = bottomAnchor.constraint(equalTo: viewController.bottomLayoutGuide.topAnchor, constant: -bottomInset) + bottom = bottomAnchor.constraint(equalTo: bottomAnchor, constant: -bottomInset) bottom.priority = UILayoutPriority(500) bottom.isActive = true - bottom = bottomAnchor.constraint(lessThanOrEqualTo: viewController.bottomLayoutGuide.topAnchor, constant: -bottomInset) + bottom = bottomAnchor.constraint(lessThanOrEqualTo: bottomAnchor, constant: -bottomInset) bottom.priority = .required bottom.isActive = true } diff --git a/Sources/JJFloatingActionButton.swift b/Sources/JJFloatingActionButton.swift index afeece28..093500e8 100644 --- a/Sources/JJFloatingActionButton.swift +++ b/Sources/JJFloatingActionButton.swift @@ -65,7 +65,7 @@ import UIKit /// /// - SeeAlso: `circleView` /// - @objc @IBInspectable public dynamic var buttonColor: UIColor { + @IBInspectable public dynamic var buttonColor: UIColor { get { return circleView.color } @@ -79,7 +79,7 @@ import UIKit /// /// - SeeAlso: `circleView` /// - @objc @IBInspectable public dynamic var highlightedButtonColor: UIColor? { + @IBInspectable public dynamic var highlightedButtonColor: UIColor? { get { return circleView.highlightedColor } @@ -96,7 +96,7 @@ import UIKit /// /// - SeeAlso: `imageView` /// - @objc @IBInspectable public dynamic var buttonImage: UIImage? { + @IBInspectable public dynamic var buttonImage: UIImage? { didSet { configureButtonImage() } @@ -121,7 +121,7 @@ import UIKit /// /// - SeeAlso: `imageView` /// - @objc @IBInspectable public dynamic var buttonImageColor: UIColor { + @IBInspectable public dynamic var buttonImageColor: UIColor { get { return imageView.tintColor } @@ -134,7 +134,7 @@ import UIKit /// This is ignored if the size is defined by auto-layout. /// Default is `56`. /// - @objc @IBInspectable public dynamic var buttonDiameter: CGFloat = 56 { + @IBInspectable public dynamic var buttonDiameter: CGFloat = 56 { didSet { invalidateIntrinsicContentSize() } @@ -143,7 +143,7 @@ import UIKit /// The size of an action item in relation to the floating action button. /// Default is `0.75`. /// - @objc @IBInspectable public dynamic var itemSizeRatio: CGFloat = 0.75 + @IBInspectable public dynamic var itemSizeRatio: CGFloat = 0.75 /// The opening style of the floating action button itself. /// Default is `JJButtonAnimationConfiguration.rotation()` @@ -167,7 +167,7 @@ import UIKit /// /// Default is `true`. /// - @objc @IBInspectable public var handleSingleActionDirectly: Bool = true { + @IBInspectable public var handleSingleActionDirectly: Bool = true { didSet { configureButtonImage() } @@ -180,7 +180,7 @@ import UIKit /// /// - SeeAlso: `close` /// - @objc @IBInspectable public var closeAutomatically: Bool = true + @IBInspectable public var closeAutomatically: Bool = true /// The current state of the floating action button. /// Possible values are @@ -246,7 +246,7 @@ import UIKit /// /// - SeeAlso: init?(coder: NSCoder) /// - public override init(frame: CGRect) { + override public init(frame: CGRect) { super.init(frame: frame) setup() } @@ -276,7 +276,7 @@ import UIKit addItem(title: nil, image: image, action: action) } - internal lazy var itemContainerView: UIView = { + lazy var itemContainerView: UIView = { let view = UIView() view.isUserInteractionEnabled = true view.backgroundColor = .clear @@ -284,9 +284,9 @@ import UIKit return view }() - internal var currentButtonAnimationConfiguration: JJButtonAnimationConfiguration? - internal var currentItemAnimationConfiguration: JJItemAnimationConfiguration? - internal var openItems: [JJActionItem] = [] + var currentButtonAnimationConfiguration: JJButtonAnimationConfiguration? + var currentItemAnimationConfiguration: JJItemAnimationConfiguration? + var openItems: [JJActionItem] = [] fileprivate var defaultItemConfiguration: ((JJActionItem) -> Void)? fileprivate var itemsWithSetup: Set = [] @@ -394,14 +394,14 @@ import UIKit extension JJFloatingActionButton { /// A Boolean value indicating whether the action button draws a highlight. /// - open override var isHighlighted: Bool { + override open var isHighlighted: Bool { + get { + return super.isHighlighted + } set { super.isHighlighted = newValue circleView.isHighlighted = newValue } - get { - return super.isHighlighted - } } } @@ -410,20 +410,20 @@ extension JJFloatingActionButton { extension JJFloatingActionButton { /// The natural size for the floating action button. /// - open override var intrinsicContentSize: CGSize { + override open var intrinsicContentSize: CGSize { return CGSize(width: buttonDiameter, height: buttonDiameter) } /// Updates constraints for the view. /// - open override func updateConstraints() { + override open func updateConstraints() { updateDynamicConstraints() super.updateConstraints() } /// Tells the view that its superview changed. /// - public override func didMoveToSuperview() { + override public func didMoveToSuperview() { super.didMoveToSuperview() if superview == nil { close(animated: false) @@ -434,7 +434,7 @@ extension JJFloatingActionButton { // MARK: - Setup -fileprivate extension JJFloatingActionButton { +private extension JJFloatingActionButton { func setup() { backgroundColor = .clear clipsToBounds = false @@ -531,7 +531,7 @@ fileprivate extension JJFloatingActionButton { // MARK: - Helper -internal extension JJFloatingActionButton { +extension JJFloatingActionButton { var currentButtonImage: UIImage? { if isSingleActionButton, let image = enabledItems.first?.imageView.image { return image @@ -551,7 +551,7 @@ internal extension JJFloatingActionButton { // MARK: - Actions -fileprivate extension JJFloatingActionButton { +private extension JJFloatingActionButton { @objc func buttonWasTapped() { switch buttonState { case .open, .opening: diff --git a/Sources/LayerProperties.swift b/Sources/LayerProperties.swift index e247f158..9196f263 100644 --- a/Sources/LayerProperties.swift +++ b/Sources/LayerProperties.swift @@ -28,7 +28,7 @@ public extension JJFloatingActionButton { /// The shadow color of the floating action button. /// Default is `UIColor.black`. /// - @objc @IBInspectable dynamic var shadowColor: UIColor? { + @IBInspectable dynamic var shadowColor: UIColor? { get { guard let cgColor = layer.shadowColor else { return nil @@ -43,7 +43,7 @@ public extension JJFloatingActionButton { /// The shadow offset of the floating action button. /// Default is `CGSize(width: 0, height: 1)`. /// - @objc @IBInspectable dynamic var shadowOffset: CGSize { + @IBInspectable dynamic var shadowOffset: CGSize { get { return layer.shadowOffset } @@ -55,7 +55,7 @@ public extension JJFloatingActionButton { /// The shadow opacity of the floating action button. /// Default is `0.4`. /// - @objc @IBInspectable dynamic var shadowOpacity: Float { + @IBInspectable dynamic var shadowOpacity: Float { get { return layer.shadowOpacity } @@ -67,7 +67,7 @@ public extension JJFloatingActionButton { /// The shadow radius of the floating action button. /// Default is `2`. /// - @objc @IBInspectable dynamic var shadowRadius: CGFloat { + @IBInspectable dynamic var shadowRadius: CGFloat { get { return layer.shadowRadius } @@ -81,7 +81,7 @@ extension JJActionItem { /// The shadow color of the action item. /// Default is `UIColor.black`. /// - @objc @IBInspectable dynamic var shadowColor: UIColor? { + @IBInspectable dynamic var shadowColor: UIColor? { get { guard let cgColor = layer.shadowColor else { return nil @@ -96,7 +96,7 @@ extension JJActionItem { /// The shadow offset of the action item. /// Default is `CGSize(width: 0, height: 1)`. /// - @objc @IBInspectable dynamic var shadowOffset: CGSize { + @IBInspectable dynamic var shadowOffset: CGSize { get { return layer.shadowOffset } @@ -108,7 +108,7 @@ extension JJActionItem { /// The shadow opacity of the action item. /// Default is `0.4`. /// - @objc @IBInspectable dynamic var shadowOpacity: Float { + @IBInspectable dynamic var shadowOpacity: Float { get { return layer.shadowOpacity } @@ -120,7 +120,7 @@ extension JJActionItem { /// The shadow radius of the action item. /// Default is `2`. /// - @objc @IBInspectable dynamic var shadowRadius: CGFloat { + @IBInspectable dynamic var shadowRadius: CGFloat { get { return layer.shadowRadius } diff --git a/Sources/Styles.swift b/Sources/Styles.swift index a843f20e..5bf3a108 100644 --- a/Sources/Styles.swift +++ b/Sources/Styles.swift @@ -24,11 +24,11 @@ import UIKit -internal struct Styles {} +struct Styles {} // MARK: - Colors -internal extension Styles { +extension Styles { static var defaultButtonColor: UIColor { return UIColor(hue: 0.31, saturation: 0.37, brightness: 0.76, alpha: 1.00) } @@ -60,7 +60,7 @@ internal extension Styles { // MARK: - Images -internal extension Styles { +extension Styles { static var plusImage: UIImage? { return drawImage(name: "plus", size: CGSize(width: 24, height: 24)) { let bezierPath = UIBezierPath() @@ -109,7 +109,7 @@ internal extension Styles { // MARK: - Helper -fileprivate extension Styles { +private extension Styles { static var cache = NSCache() static func drawImage(name: NSString, diff --git a/Sources/UIColor+JJFloatingActionButton.swift b/Sources/UIColor+JJFloatingActionButton.swift index c5fb086c..fa398caa 100644 --- a/Sources/UIColor+JJFloatingActionButton.swift +++ b/Sources/UIColor+JJFloatingActionButton.swift @@ -24,7 +24,7 @@ import UIKit -internal extension UIColor { +extension UIColor { var highlighted: UIColor { var hue = CGFloat(0) var saturation = CGFloat(0) diff --git a/Sources/UIView+JJFloatingActionButton.swift b/Sources/UIView+JJFloatingActionButton.swift index 6c0cc855..c0fd34d3 100644 --- a/Sources/UIView+JJFloatingActionButton.swift +++ b/Sources/UIView+JJFloatingActionButton.swift @@ -24,7 +24,7 @@ import UIKit -internal extension UIView { +extension UIView { class func animate(duration: TimeInterval, delay: TimeInterval = 0, usingSpringWithDamping dampingRatio: CGFloat, diff --git a/Sources/UIWindow+Key.swift b/Sources/UIWindow+Key.swift new file mode 100644 index 00000000..000ca95d --- /dev/null +++ b/Sources/UIWindow+Key.swift @@ -0,0 +1,31 @@ +// +// UIWindow+Key.swift +// +// Copyright (c) 2017-Present Jochen Pfeiffer +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// + +import Foundation + +extension UIWindow { + static var key: UIWindow? { + return UIApplication.shared.windows.first { $0.isKeyWindow } + } +} diff --git a/docs/docsets/JJFloatingActionButton.docset/Contents/Resources/Documents/index.html b/docs/docsets/JJFloatingActionButton.docset/Contents/Resources/Documents/index.html index 921fba01..52c88502 100644 --- a/docs/docsets/JJFloatingActionButton.docset/Contents/Resources/Documents/index.html +++ b/docs/docsets/JJFloatingActionButton.docset/Contents/Resources/Documents/index.html @@ -240,7 +240,7 @@

Configuration

item.layer.shadowRadius = CGFloat(2) } -actionButton.addItem(title: "Balloon", image: UIImage(named: "Baloon")) { item in +actionButton.addItem(title: "Balloon", image: UIImage(named: "Balloon")) { item in // Do something } diff --git a/docs/index.html b/docs/index.html index 921fba01..52c88502 100644 --- a/docs/index.html +++ b/docs/index.html @@ -240,7 +240,7 @@

Configuration

item.layer.shadowRadius = CGFloat(2) } -actionButton.addItem(title: "Balloon", image: UIImage(named: "Baloon")) { item in +actionButton.addItem(title: "Balloon", image: UIImage(named: "Balloon")) { item in // Do something }