From 6ab808dfd01ed53ad6593031f4235c6dd8b75d0c Mon Sep 17 00:00:00 2001 From: Anna-Mariia Shkarlinska Date: Thu, 20 Dec 2018 17:29:37 +0100 Subject: [PATCH 01/44] Add .gitignore --- .gitignore | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e636384 --- /dev/null +++ b/.gitignore @@ -0,0 +1,39 @@ +.DS_Store +.Trashes +.localized + +build +.build +xcuserdata +DerivedData + +*.mode1v3 +*.mode2v3 +*.perspectivev3 +*.pbxuser +*.xccheckout +*.xcuserstate +*.xcscmblueprint +*.moved-aside +*.hmap +*.o +*.hmap +*.ipa +*.dSYM.zip + +timeline.xctimeline +playground.xcworkspace + +.idea +*.iml + +Pods +Carthage +Packages + +fastlane/report.xml +fastlane/Preview.html +fastlane/screenshots +fastlane/test_output + +.env From 5506625b759880265fbf19bddfd75f1543675a99 Mon Sep 17 00:00:00 2001 From: Anna-Mariia Shkarlinska Date: Thu, 20 Dec 2018 17:30:49 +0100 Subject: [PATCH 02/44] Initial setup --- .../project.pbxproj | 335 ++++++++++++++++++ .../contents.xcworkspacedata | 7 + .../xcshareddata/IDEWorkspaceChecks.plist | 8 + .../CarlensCollectionViewLayout.h | 19 + .../CarlensCollectionViewLayout/Info.plist | 22 ++ 5 files changed, 391 insertions(+) create mode 100644 CarlensCollectionViewLayout/CarlensCollectionViewLayout.xcodeproj/project.pbxproj create mode 100644 CarlensCollectionViewLayout/CarlensCollectionViewLayout.xcodeproj/project.xcworkspace/contents.xcworkspacedata create mode 100644 CarlensCollectionViewLayout/CarlensCollectionViewLayout.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist create mode 100644 CarlensCollectionViewLayout/CarlensCollectionViewLayout/CarlensCollectionViewLayout.h create mode 100644 CarlensCollectionViewLayout/CarlensCollectionViewLayout/Info.plist diff --git a/CarlensCollectionViewLayout/CarlensCollectionViewLayout.xcodeproj/project.pbxproj b/CarlensCollectionViewLayout/CarlensCollectionViewLayout.xcodeproj/project.pbxproj new file mode 100644 index 0000000..b623573 --- /dev/null +++ b/CarlensCollectionViewLayout/CarlensCollectionViewLayout.xcodeproj/project.pbxproj @@ -0,0 +1,335 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 50; + objects = { + +/* Begin PBXBuildFile section */ + 955E4FD421CBFB2800B4C3BB /* CarlensCollectionViewLayout.h in Headers */ = {isa = PBXBuildFile; fileRef = 955E4FD221CBFB2800B4C3BB /* CarlensCollectionViewLayout.h */; settings = {ATTRIBUTES = (Public, ); }; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 955E4FCF21CBFB2800B4C3BB /* CarlensCollectionViewLayout.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = CarlensCollectionViewLayout.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 955E4FD221CBFB2800B4C3BB /* CarlensCollectionViewLayout.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CarlensCollectionViewLayout.h; sourceTree = ""; }; + 955E4FD321CBFB2800B4C3BB /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 955E4FCC21CBFB2800B4C3BB /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 955E4FC521CBFB2800B4C3BB = { + isa = PBXGroup; + children = ( + 955E4FD121CBFB2800B4C3BB /* CarlensCollectionViewLayout */, + 955E4FD021CBFB2800B4C3BB /* Products */, + ); + sourceTree = ""; + }; + 955E4FD021CBFB2800B4C3BB /* Products */ = { + isa = PBXGroup; + children = ( + 955E4FCF21CBFB2800B4C3BB /* CarlensCollectionViewLayout.framework */, + ); + name = Products; + sourceTree = ""; + }; + 955E4FD121CBFB2800B4C3BB /* CarlensCollectionViewLayout */ = { + isa = PBXGroup; + children = ( + 955E4FD221CBFB2800B4C3BB /* CarlensCollectionViewLayout.h */, + 955E4FD321CBFB2800B4C3BB /* Info.plist */, + ); + path = CarlensCollectionViewLayout; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + 955E4FCA21CBFB2800B4C3BB /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 955E4FD421CBFB2800B4C3BB /* CarlensCollectionViewLayout.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + 955E4FCE21CBFB2800B4C3BB /* CarlensCollectionViewLayout */ = { + isa = PBXNativeTarget; + buildConfigurationList = 955E4FD721CBFB2800B4C3BB /* Build configuration list for PBXNativeTarget "CarlensCollectionViewLayout" */; + buildPhases = ( + 955E4FCA21CBFB2800B4C3BB /* Headers */, + 955E4FCB21CBFB2800B4C3BB /* Sources */, + 955E4FCC21CBFB2800B4C3BB /* Frameworks */, + 955E4FCD21CBFB2800B4C3BB /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = CarlensCollectionViewLayout; + productName = CarlensCollectionViewLayout; + productReference = 955E4FCF21CBFB2800B4C3BB /* CarlensCollectionViewLayout.framework */; + productType = "com.apple.product-type.framework"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 955E4FC621CBFB2800B4C3BB /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 1010; + ORGANIZATIONNAME = Netguru; + TargetAttributes = { + 955E4FCE21CBFB2800B4C3BB = { + CreatedOnToolsVersion = 10.1; + }; + }; + }; + buildConfigurationList = 955E4FC921CBFB2800B4C3BB /* Build configuration list for PBXProject "CarlensCollectionViewLayout" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = 955E4FC521CBFB2800B4C3BB; + productRefGroup = 955E4FD021CBFB2800B4C3BB /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 955E4FCE21CBFB2800B4C3BB /* CarlensCollectionViewLayout */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 955E4FCD21CBFB2800B4C3BB /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 955E4FCB21CBFB2800B4C3BB /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + 955E4FD521CBFB2800B4C3BB /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_IDENTITY = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 12.1; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; + 955E4FD621CBFB2800B4C3BB /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_IDENTITY = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 12.1; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SDKROOT = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + VALIDATE_PRODUCT = YES; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; + 955E4FD821CBFB2800B4C3BB /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_IDENTITY = ""; + CODE_SIGN_STYLE = Automatic; + DEFINES_MODULE = YES; + DEVELOPMENT_TEAM = 9HJ69C5G9K; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + INFOPLIST_FILE = CarlensCollectionViewLayout/Info.plist; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = co.netguru.CarlensCollectionViewLayout; + PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; + SKIP_INSTALL = YES; + SWIFT_VERSION = 4.2; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 955E4FD921CBFB2800B4C3BB /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_IDENTITY = ""; + CODE_SIGN_STYLE = Automatic; + DEFINES_MODULE = YES; + DEVELOPMENT_TEAM = 9HJ69C5G9K; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + INFOPLIST_FILE = CarlensCollectionViewLayout/Info.plist; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = co.netguru.CarlensCollectionViewLayout; + PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; + SKIP_INSTALL = YES; + SWIFT_VERSION = 4.2; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 955E4FC921CBFB2800B4C3BB /* Build configuration list for PBXProject "CarlensCollectionViewLayout" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 955E4FD521CBFB2800B4C3BB /* Debug */, + 955E4FD621CBFB2800B4C3BB /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 955E4FD721CBFB2800B4C3BB /* Build configuration list for PBXNativeTarget "CarlensCollectionViewLayout" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 955E4FD821CBFB2800B4C3BB /* Debug */, + 955E4FD921CBFB2800B4C3BB /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 955E4FC621CBFB2800B4C3BB /* Project object */; +} diff --git a/CarlensCollectionViewLayout/CarlensCollectionViewLayout.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/CarlensCollectionViewLayout/CarlensCollectionViewLayout.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..fb0b20f --- /dev/null +++ b/CarlensCollectionViewLayout/CarlensCollectionViewLayout.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/CarlensCollectionViewLayout/CarlensCollectionViewLayout.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/CarlensCollectionViewLayout/CarlensCollectionViewLayout.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/CarlensCollectionViewLayout/CarlensCollectionViewLayout.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/CarlensCollectionViewLayout/CarlensCollectionViewLayout/CarlensCollectionViewLayout.h b/CarlensCollectionViewLayout/CarlensCollectionViewLayout/CarlensCollectionViewLayout.h new file mode 100644 index 0000000..d112195 --- /dev/null +++ b/CarlensCollectionViewLayout/CarlensCollectionViewLayout/CarlensCollectionViewLayout.h @@ -0,0 +1,19 @@ +// +// CarlensCollectionViewLayout.h +// CarlensCollectionViewLayout +// +// Created by Anna on 20/12/2018. +// Copyright © 2018 Netguru. All rights reserved. +// + +#import + +//! Project version number for CarlensCollectionViewLayout. +FOUNDATION_EXPORT double CarlensCollectionViewLayoutVersionNumber; + +//! Project version string for CarlensCollectionViewLayout. +FOUNDATION_EXPORT const unsigned char CarlensCollectionViewLayoutVersionString[]; + +// In this header, you should import all the public headers of your framework using statements like #import + + diff --git a/CarlensCollectionViewLayout/CarlensCollectionViewLayout/Info.plist b/CarlensCollectionViewLayout/CarlensCollectionViewLayout/Info.plist new file mode 100644 index 0000000..e1fe4cf --- /dev/null +++ b/CarlensCollectionViewLayout/CarlensCollectionViewLayout/Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleVersion + $(CURRENT_PROJECT_VERSION) + + From cf75d35483a5110cdcb8c3deeda35f59b6c8832d Mon Sep 17 00:00:00 2001 From: Anna-Mariia Shkarlinska Date: Fri, 21 Dec 2018 13:04:34 +0100 Subject: [PATCH 03/44] Add bitrise.yml --- bitrise.yml | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 bitrise.yml diff --git a/bitrise.yml b/bitrise.yml new file mode 100644 index 0000000..76bb1fc --- /dev/null +++ b/bitrise.yml @@ -0,0 +1,48 @@ +# +# bitrise.yml +# +# Copyright © 2017 Netguru Sp. z o.o. All rights reserved. +# + +# CLI metadata + +format_version: 1.3.1 +default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git + +# Workflow trigger map + +trigger_map: + + - pull_request_target_branch: develop + workflow: build + + - push_branch: develop + workflow: build + +# Environment configuration + +app: + envs: + - XCODEBUILD_PROJECT: ./CarlensCollectionViewLayout.xcodeproj + - XCODEBUILD_OPTIONS: '' + +# Workflow declarations + +workflows: + + # Top level build workflows + + build: + steps: + - script: + inputs: + - content: xcodebuild -project $XCODEBUILD_PROJECT + + # Deploy workflows + + deploy-artifacts: + steps: + - deploy-to-bitrise-io: + inputs: + - notify_user_groups: none + - is_enable_public_page: false From a09a4cda96fe69aa611959921c4c5f99f1377c06 Mon Sep 17 00:00:00 2001 From: Anna-Mariia Shkarlinska Date: Fri, 21 Dec 2018 15:20:57 +0100 Subject: [PATCH 04/44] Update project structure --- .../project.pbxproj | 0 .../contents.xcworkspacedata | 0 .../xcshareddata/IDEWorkspaceChecks.plist | 0 .../CarlensCollectionViewLayout.xcscheme | 80 +++++++++++++++++++ .../CarlensCollectionViewLayout.h | 0 .../Info.plist | 0 6 files changed, 80 insertions(+) rename {CarlensCollectionViewLayout/CarlensCollectionViewLayout.xcodeproj => CarlensCollectionViewLayout.xcodeproj}/project.pbxproj (100%) rename {CarlensCollectionViewLayout/CarlensCollectionViewLayout.xcodeproj => CarlensCollectionViewLayout.xcodeproj}/project.xcworkspace/contents.xcworkspacedata (100%) rename {CarlensCollectionViewLayout/CarlensCollectionViewLayout.xcodeproj => CarlensCollectionViewLayout.xcodeproj}/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist (100%) create mode 100644 CarlensCollectionViewLayout.xcodeproj/xcshareddata/xcschemes/CarlensCollectionViewLayout.xcscheme rename CarlensCollectionViewLayout/{CarlensCollectionViewLayout => }/CarlensCollectionViewLayout.h (100%) rename CarlensCollectionViewLayout/{CarlensCollectionViewLayout => }/Info.plist (100%) diff --git a/CarlensCollectionViewLayout/CarlensCollectionViewLayout.xcodeproj/project.pbxproj b/CarlensCollectionViewLayout.xcodeproj/project.pbxproj similarity index 100% rename from CarlensCollectionViewLayout/CarlensCollectionViewLayout.xcodeproj/project.pbxproj rename to CarlensCollectionViewLayout.xcodeproj/project.pbxproj diff --git a/CarlensCollectionViewLayout/CarlensCollectionViewLayout.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/CarlensCollectionViewLayout.xcodeproj/project.xcworkspace/contents.xcworkspacedata similarity index 100% rename from CarlensCollectionViewLayout/CarlensCollectionViewLayout.xcodeproj/project.xcworkspace/contents.xcworkspacedata rename to CarlensCollectionViewLayout.xcodeproj/project.xcworkspace/contents.xcworkspacedata diff --git a/CarlensCollectionViewLayout/CarlensCollectionViewLayout.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/CarlensCollectionViewLayout.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist similarity index 100% rename from CarlensCollectionViewLayout/CarlensCollectionViewLayout.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist rename to CarlensCollectionViewLayout.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist diff --git a/CarlensCollectionViewLayout.xcodeproj/xcshareddata/xcschemes/CarlensCollectionViewLayout.xcscheme b/CarlensCollectionViewLayout.xcodeproj/xcshareddata/xcschemes/CarlensCollectionViewLayout.xcscheme new file mode 100644 index 0000000..b1490b2 --- /dev/null +++ b/CarlensCollectionViewLayout.xcodeproj/xcshareddata/xcschemes/CarlensCollectionViewLayout.xcscheme @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CarlensCollectionViewLayout/CarlensCollectionViewLayout/CarlensCollectionViewLayout.h b/CarlensCollectionViewLayout/CarlensCollectionViewLayout.h similarity index 100% rename from CarlensCollectionViewLayout/CarlensCollectionViewLayout/CarlensCollectionViewLayout.h rename to CarlensCollectionViewLayout/CarlensCollectionViewLayout.h diff --git a/CarlensCollectionViewLayout/CarlensCollectionViewLayout/Info.plist b/CarlensCollectionViewLayout/Info.plist similarity index 100% rename from CarlensCollectionViewLayout/CarlensCollectionViewLayout/Info.plist rename to CarlensCollectionViewLayout/Info.plist From f201c17866de7e642b0e69b0374195dcc842f60f Mon Sep 17 00:00:00 2001 From: Anna-Mariia Shkarlinska Date: Fri, 21 Dec 2018 15:26:24 +0100 Subject: [PATCH 05/44] Add Pull Request template --- PULL_REQUEST_TEMPLATE.md | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 PULL_REQUEST_TEMPLATE.md diff --git a/PULL_REQUEST_TEMPLATE.md b/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..106400c --- /dev/null +++ b/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,10 @@ +### Ticket + + + +### Task Description + + + +### Aditional Notes (optional) + From 96d21d423f6ebced4a46af5050196131bff7fbe5 Mon Sep 17 00:00:00 2001 From: Anna-Mariia Shkarlinska Date: Fri, 21 Dec 2018 16:14:13 +0100 Subject: [PATCH 06/44] Update README.md with initial info --- README.md | 40 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 333404c..6d58761 100644 --- a/README.md +++ b/README.md @@ -1 +1,39 @@ -# CarlensCollectionViewLayout \ No newline at end of file +# CarlensCollectionViewLayout + +The beautiful animation of collection view cells. + +## Team + +* [Julia Wolszczak](mailto:julia.wolszczak@netguru.co) - Project Manager +* [Anna-Mariia Shkarlinska](mailto:anna-mariia.shkarlinska@netguru.co) - iOS Developer + +## Tools & Services + +* Tools: + * Xcode 10.1 with latest iOS stable SDK (12.0) and Swift 4.2 +* Services: + * [JIRA](https://netguru.atlassian.net/secure/RapidBoard.jspa?rapidView=584&view=detail) + * [Bitrise](https://app.bitrise.io/app/8f268362f4edaa0d) + +## Coding guidelines + +- Respect Swift [API Design Guidelines](https://swift.org/documentation/api-design-guidelines/) +- The code must be readable and self-explanatory - full variable names, meaningful methods, etc. +- Don't leave any commented-out code. +- Write documentation for every method and property accessible outside the class. For example well documented method looks as follows: + + ```swift + /// Tells the magician to perform a given trick. + /// + /// - Parameter trick: The magic trick to perform. + /// - Returns: Whether the magician succeeded in performing the magic trick. + func perform(magicTrick trick: MagicTrick) -> Bool { + // body + } + ``` + +## Related repositories + +- [Carlens iOS](https://github.com/netguru/car-recognition-ios) +- [Carlens Android](https://github.com/netguru/car-recognition-android) +- [Carlens Machine Learning](https://github.com/netguru/car-recognition-ml) From f42383623cf575dee33ce703eabb7aca3c0d18fc Mon Sep 17 00:00:00 2001 From: Anna-Mariia Shkarlinska Date: Fri, 21 Dec 2018 16:27:20 +0100 Subject: [PATCH 07/44] Provide a default link in PR template --- PULL_REQUEST_TEMPLATE.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/PULL_REQUEST_TEMPLATE.md b/PULL_REQUEST_TEMPLATE.md index 106400c..5e8a07c 100644 --- a/PULL_REQUEST_TEMPLATE.md +++ b/PULL_REQUEST_TEMPLATE.md @@ -1,6 +1,5 @@ ### Ticket - - +[CRAI-](https://netguru.atlassian.net/browse/CRAI-) ### Task Description From e4d689772d6dbafebe70978dbd1b73b6de0ea5c8 Mon Sep 17 00:00:00 2001 From: Anna-Mariia Shkarlinska Date: Fri, 21 Dec 2018 18:11:53 +0100 Subject: [PATCH 08/44] Update bundle identifier --- CarlensCollectionViewLayout.xcodeproj/project.pbxproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CarlensCollectionViewLayout.xcodeproj/project.pbxproj b/CarlensCollectionViewLayout.xcodeproj/project.pbxproj index b623573..9233cc7 100644 --- a/CarlensCollectionViewLayout.xcodeproj/project.pbxproj +++ b/CarlensCollectionViewLayout.xcodeproj/project.pbxproj @@ -275,7 +275,7 @@ "@executable_path/Frameworks", "@loader_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = co.netguru.CarlensCollectionViewLayout; + PRODUCT_BUNDLE_IDENTIFIER = co.netguru.lib.CarlensCollectionViewLayout; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; SKIP_INSTALL = YES; SWIFT_VERSION = 4.2; @@ -300,7 +300,7 @@ "@executable_path/Frameworks", "@loader_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = co.netguru.CarlensCollectionViewLayout; + PRODUCT_BUNDLE_IDENTIFIER = co.netguru.lib.CarlensCollectionViewLayout; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; SKIP_INSTALL = YES; SWIFT_VERSION = 4.2; From cc14987217cb5fcba205c2390ccbebcecd90fbfd Mon Sep 17 00:00:00 2001 From: Anna-Mariia Shkarlinska Date: Fri, 21 Dec 2018 18:23:46 +0100 Subject: [PATCH 09/44] Set code signing to manual --- CarlensCollectionViewLayout.xcodeproj/project.pbxproj | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/CarlensCollectionViewLayout.xcodeproj/project.pbxproj b/CarlensCollectionViewLayout.xcodeproj/project.pbxproj index 9233cc7..41f1b68 100644 --- a/CarlensCollectionViewLayout.xcodeproj/project.pbxproj +++ b/CarlensCollectionViewLayout.xcodeproj/project.pbxproj @@ -262,9 +262,9 @@ isa = XCBuildConfiguration; buildSettings = { CODE_SIGN_IDENTITY = ""; - CODE_SIGN_STYLE = Automatic; + CODE_SIGN_STYLE = Manual; DEFINES_MODULE = YES; - DEVELOPMENT_TEAM = 9HJ69C5G9K; + DEVELOPMENT_TEAM = ""; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; @@ -277,6 +277,7 @@ ); PRODUCT_BUNDLE_IDENTIFIER = co.netguru.lib.CarlensCollectionViewLayout; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; + PROVISIONING_PROFILE_SPECIFIER = ""; SKIP_INSTALL = YES; SWIFT_VERSION = 4.2; TARGETED_DEVICE_FAMILY = "1,2"; @@ -287,9 +288,9 @@ isa = XCBuildConfiguration; buildSettings = { CODE_SIGN_IDENTITY = ""; - CODE_SIGN_STYLE = Automatic; + CODE_SIGN_STYLE = Manual; DEFINES_MODULE = YES; - DEVELOPMENT_TEAM = 9HJ69C5G9K; + DEVELOPMENT_TEAM = ""; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; @@ -302,6 +303,7 @@ ); PRODUCT_BUNDLE_IDENTIFIER = co.netguru.lib.CarlensCollectionViewLayout; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; + PROVISIONING_PROFILE_SPECIFIER = ""; SKIP_INSTALL = YES; SWIFT_VERSION = 4.2; TARGETED_DEVICE_FAMILY = "1,2"; From db689a25b9711bda44950729fee2d3c9b5d32991 Mon Sep 17 00:00:00 2001 From: Anna-Mariia Shkarlinska Date: Fri, 21 Dec 2018 18:54:57 +0100 Subject: [PATCH 10/44] Update build step in bitrise.yml --- bitrise.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/bitrise.yml b/bitrise.yml index 76bb1fc..8f295d7 100644 --- a/bitrise.yml +++ b/bitrise.yml @@ -24,7 +24,6 @@ trigger_map: app: envs: - XCODEBUILD_PROJECT: ./CarlensCollectionViewLayout.xcodeproj - - XCODEBUILD_OPTIONS: '' # Workflow declarations @@ -33,10 +32,18 @@ workflows: # Top level build workflows build: + envs: + - XCODEBUILD_SCHEME: CarlensCollectionViewLayout + before_run: + - build-scheme + after_run: + - deploy-artifacts + + build-scheme: steps: - script: inputs: - - content: xcodebuild -project $XCODEBUILD_PROJECT + - content: xcodebuild -project $XCODEBUILD_PROJECT -scheme $XCODEBUILD_SCHEME -destination 'platform=iOS Simulator,name=iPhone 7 Plus' # Deploy workflows From 110e29aef831762379fabbea89023cefdcc9e638 Mon Sep 17 00:00:00 2001 From: Anna-Mariia Shkarlinska Date: Mon, 24 Dec 2018 14:14:36 +0100 Subject: [PATCH 11/44] Update iOS deployment target --- CarlensCollectionViewLayout.xcodeproj/project.pbxproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CarlensCollectionViewLayout.xcodeproj/project.pbxproj b/CarlensCollectionViewLayout.xcodeproj/project.pbxproj index 41f1b68..619d0a9 100644 --- a/CarlensCollectionViewLayout.xcodeproj/project.pbxproj +++ b/CarlensCollectionViewLayout.xcodeproj/project.pbxproj @@ -188,7 +188,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 12.1; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; ONLY_ACTIVE_ARCH = YES; @@ -246,7 +246,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 12.1; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; SDKROOT = iphoneos; From 3262fd0224ac8491be439bd7c658205fa593c17b Mon Sep 17 00:00:00 2001 From: Anna-Mariia Shkarlinska Date: Fri, 28 Dec 2018 15:38:56 +0100 Subject: [PATCH 12/44] Add collection view layout and attributes files --- .../project.pbxproj | 8 ++ .../CarlensCollectionViewLayout.swift | 77 +++++++++++++++++++ .../CarlensLayoutAttributes.swift | 27 +++++++ 3 files changed, 112 insertions(+) create mode 100644 CarlensCollectionViewLayout/CarlensCollectionViewLayout.swift create mode 100644 CarlensCollectionViewLayout/CarlensLayoutAttributes.swift diff --git a/CarlensCollectionViewLayout.xcodeproj/project.pbxproj b/CarlensCollectionViewLayout.xcodeproj/project.pbxproj index 619d0a9..fed292b 100644 --- a/CarlensCollectionViewLayout.xcodeproj/project.pbxproj +++ b/CarlensCollectionViewLayout.xcodeproj/project.pbxproj @@ -7,10 +7,14 @@ objects = { /* Begin PBXBuildFile section */ + 9505725E21D4D8FB009EA422 /* CarlensCollectionViewLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9505725D21D4D8FB009EA422 /* CarlensCollectionViewLayout.swift */; }; + 9505726021D4D922009EA422 /* CarlensLayoutAttributes.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9505725F21D4D922009EA422 /* CarlensLayoutAttributes.swift */; }; 955E4FD421CBFB2800B4C3BB /* CarlensCollectionViewLayout.h in Headers */ = {isa = PBXBuildFile; fileRef = 955E4FD221CBFB2800B4C3BB /* CarlensCollectionViewLayout.h */; settings = {ATTRIBUTES = (Public, ); }; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ + 9505725D21D4D8FB009EA422 /* CarlensCollectionViewLayout.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CarlensCollectionViewLayout.swift; sourceTree = ""; }; + 9505725F21D4D922009EA422 /* CarlensLayoutAttributes.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CarlensLayoutAttributes.swift; sourceTree = ""; }; 955E4FCF21CBFB2800B4C3BB /* CarlensCollectionViewLayout.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = CarlensCollectionViewLayout.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 955E4FD221CBFB2800B4C3BB /* CarlensCollectionViewLayout.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CarlensCollectionViewLayout.h; sourceTree = ""; }; 955E4FD321CBFB2800B4C3BB /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; @@ -47,6 +51,8 @@ isa = PBXGroup; children = ( 955E4FD221CBFB2800B4C3BB /* CarlensCollectionViewLayout.h */, + 9505725D21D4D8FB009EA422 /* CarlensCollectionViewLayout.swift */, + 9505725F21D4D922009EA422 /* CarlensLayoutAttributes.swift */, 955E4FD321CBFB2800B4C3BB /* Info.plist */, ); path = CarlensCollectionViewLayout; @@ -130,6 +136,8 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + 9505725E21D4D8FB009EA422 /* CarlensCollectionViewLayout.swift in Sources */, + 9505726021D4D922009EA422 /* CarlensLayoutAttributes.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/CarlensCollectionViewLayout/CarlensCollectionViewLayout.swift b/CarlensCollectionViewLayout/CarlensCollectionViewLayout.swift new file mode 100644 index 0000000..238e980 --- /dev/null +++ b/CarlensCollectionViewLayout/CarlensCollectionViewLayout.swift @@ -0,0 +1,77 @@ +// +// CarlensCollectionViewLayout.swift +// CarlensCollectionViewLayout +// +// Created by Anna on 27/12/2018. +// Copyright © 2018 Netguru. All rights reserved. +// + +import UIKit + +public final class CarlensCollectionViewLayout: UICollectionViewFlowLayout { + + private var firstSetupDone = false + + private let spacingBetweenElements = 20 + + public override func prepare() { + super.prepare() + guard !firstSetupDone else { return } + setup() + firstSetupDone = true + } + + private func setup() { + guard let collectionView = collectionView else { return } + scrollDirection = .horizontal + minimumLineSpacing = 20 + itemSize = CGSize(width: collectionView.bounds.width - 80, height: collectionView.bounds.height) + let inset = (collectionView.bounds.width - itemSize.width) / 2 + collectionView.contentInset = .init(top: 0, left: inset, bottom: 0, right: inset) + collectionView.decelerationRate = UIScrollView.DecelerationRate.fast + } + + /// SeeAlso: UICollectionViewFlowLayout + public override func shouldInvalidateLayout(forBoundsChange newBounds: CGRect) -> Bool { + return true + } + + /// SeeAlso: UICollectionViewFlowLayout + override public class var layoutAttributesClass: AnyClass { + return CarlensLayoutAttributes.self + } + + /// SeeAlso: UICollectionViewFlowLayout + public override func layoutAttributesForElements(in rect: CGRect) -> [UICollectionViewLayoutAttributes]? { + guard let collectionView = collectionView, let allAttributes = super.layoutAttributesForElements(in: rect) else { return nil } + + for attributes in allAttributes { + let collectionCenter = collectionView.bounds.size.width / 2 + let offset = collectionView.contentOffset.x + let normalizedCenter = attributes.center.x - offset + + let maxDistance = itemSize.width + minimumLineSpacing + let distanceFromCenter = min(collectionCenter - normalizedCenter, maxDistance) + let ratio = (maxDistance - abs(distanceFromCenter)) / maxDistance + let normalizedRatio = min(1, max(0, ratio)) + + guard let attributes = attributes as? CarlensLayoutAttributes else { continue } + attributes.progress = Double(normalizedRatio) + } + return allAttributes + } + + /// SeeAlso: UICollectionViewFlowLayout + public override func targetContentOffset(forProposedContentOffset proposedContentOffset: CGPoint, withScrollingVelocity velocity: CGPoint) -> CGPoint { + guard let collectionView = collectionView, let layoutAttributes = layoutAttributesForElements(in: collectionView.bounds) else { + return .init(x: 0, y: 0) + } + // Snapping closest cell to the center + let centerOffset = collectionView.bounds.size.width / 2 + let offsetWithCenter = proposedContentOffset.x + (proposedContentOffset.x * velocity.x) + centerOffset + let closestAttribute = layoutAttributes + .sorted { abs($0.center.x - offsetWithCenter) < abs($1.center.x - offsetWithCenter) } + .first ?? UICollectionViewLayoutAttributes() + return CGPoint(x: closestAttribute.center.x - centerOffset, y: 0) + } +} diff --git a/CarlensCollectionViewLayout/CarlensLayoutAttributes.swift b/CarlensCollectionViewLayout/CarlensLayoutAttributes.swift new file mode 100644 index 0000000..67b045e --- /dev/null +++ b/CarlensCollectionViewLayout/CarlensLayoutAttributes.swift @@ -0,0 +1,27 @@ +// +// CarListLayoutAttributes.swift +// CarRecognition +// + + +import UIKit + +public final class CarlensLayoutAttributes: UICollectionViewLayoutAttributes { + + /// Progress towards the center of the screen, value between 0 and 1. + public var progress = 0.0 + + /// SeeAlso: UICollectionViewLayoutAttributes + public override func copy(with zone: NSZone?) -> Any { + guard let attributes = super.copy(with: zone) as? CarlensLayoutAttributes else { return super.copy(with: zone) } + attributes.progress = progress + return attributes + } + + /// SeeAlso: UICollectionViewLayoutAttributes + public override func isEqual(_ object: Any?) -> Bool { + guard let attributes = object as? CarlensLayoutAttributes else { return false } + guard attributes.progress == progress else { return false } + return super.isEqual(object) + } +} From 4b373a18e167274c7abd9eede408a98f700809ff Mon Sep 17 00:00:00 2001 From: Anna-Mariia Shkarlinska Date: Wed, 2 Jan 2019 11:58:25 +0100 Subject: [PATCH 13/44] Add collection view cell --- .../project.pbxproj | 4 ++ .../CarlensCollectionViewCell.swift | 52 +++++++++++++++++++ 2 files changed, 56 insertions(+) create mode 100644 CarlensCollectionViewLayout/CarlensCollectionViewCell.swift diff --git a/CarlensCollectionViewLayout.xcodeproj/project.pbxproj b/CarlensCollectionViewLayout.xcodeproj/project.pbxproj index fed292b..6274d01 100644 --- a/CarlensCollectionViewLayout.xcodeproj/project.pbxproj +++ b/CarlensCollectionViewLayout.xcodeproj/project.pbxproj @@ -10,6 +10,7 @@ 9505725E21D4D8FB009EA422 /* CarlensCollectionViewLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9505725D21D4D8FB009EA422 /* CarlensCollectionViewLayout.swift */; }; 9505726021D4D922009EA422 /* CarlensLayoutAttributes.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9505725F21D4D922009EA422 /* CarlensLayoutAttributes.swift */; }; 955E4FD421CBFB2800B4C3BB /* CarlensCollectionViewLayout.h in Headers */ = {isa = PBXBuildFile; fileRef = 955E4FD221CBFB2800B4C3BB /* CarlensCollectionViewLayout.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 958D17C021D66DF00067BED6 /* CarlensCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 958D17BF21D66DF00067BED6 /* CarlensCollectionViewCell.swift */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ @@ -18,6 +19,7 @@ 955E4FCF21CBFB2800B4C3BB /* CarlensCollectionViewLayout.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = CarlensCollectionViewLayout.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 955E4FD221CBFB2800B4C3BB /* CarlensCollectionViewLayout.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CarlensCollectionViewLayout.h; sourceTree = ""; }; 955E4FD321CBFB2800B4C3BB /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 958D17BF21D66DF00067BED6 /* CarlensCollectionViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CarlensCollectionViewCell.swift; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -52,6 +54,7 @@ children = ( 955E4FD221CBFB2800B4C3BB /* CarlensCollectionViewLayout.h */, 9505725D21D4D8FB009EA422 /* CarlensCollectionViewLayout.swift */, + 958D17BF21D66DF00067BED6 /* CarlensCollectionViewCell.swift */, 9505725F21D4D922009EA422 /* CarlensLayoutAttributes.swift */, 955E4FD321CBFB2800B4C3BB /* Info.plist */, ); @@ -137,6 +140,7 @@ buildActionMask = 2147483647; files = ( 9505725E21D4D8FB009EA422 /* CarlensCollectionViewLayout.swift in Sources */, + 958D17C021D66DF00067BED6 /* CarlensCollectionViewCell.swift in Sources */, 9505726021D4D922009EA422 /* CarlensLayoutAttributes.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; diff --git a/CarlensCollectionViewLayout/CarlensCollectionViewCell.swift b/CarlensCollectionViewLayout/CarlensCollectionViewCell.swift new file mode 100644 index 0000000..ab3e779 --- /dev/null +++ b/CarlensCollectionViewLayout/CarlensCollectionViewCell.swift @@ -0,0 +1,52 @@ +// +// CarListCollectionViewCell.swift +// CarRecognition +// + + +import UIKit.UICollectionView + +open class CarlensCollectionViewCell: UICollectionViewCell { + + /// Indicates if the cell is currently displayed as primary cell + var isCurrentlyPrimary = false + + private let topViewHeight: CGFloat = UIScreen.main.bounds.height > 568 ? 200 : 170 + + public var topView: UIView! + + public var cardView: UIView! + + open func configure(topView: UIView, cardView: UIView) { + self.topView = topView + self.cardView = cardView + setupView() + } + + private func animateViews(toProgress progress: Double) { + let offset = topViewHeight - (CGFloat(progress) * topViewHeight) + cardView.transform = .init(translationX: 0, y: -offset) + } + + private func setupView() { + [topView, cardView].forEach(contentView.addSubview) + NSLayoutConstraint.activate([ + topView.topAnchor.constraint(equalTo: topAnchor), + topView.leadingAnchor.constraint(equalTo: leadingAnchor), + topView.trailingAnchor.constraint(equalTo: trailingAnchor), + topView.heightAnchor.constraint(equalToConstant: topViewHeight), + cardView.bottomAnchor.constraint(equalTo: bottomAnchor), + cardView.leadingAnchor.constraint(equalTo: leadingAnchor), + cardView.trailingAnchor.constraint(equalTo: trailingAnchor), + cardView.topAnchor.constraint(equalTo: topView.bottomAnchor) + ]) + } + + /// - SeeAlso: UICollectionViewCell + override open func apply(_ layoutAttributes: UICollectionViewLayoutAttributes) { + super.apply(layoutAttributes) + guard let attributes = layoutAttributes as? CarlensLayoutAttributes else { return } + isCurrentlyPrimary = !(attributes.progress == 0) + animateViews(toProgress: attributes.progress) + } +} From 8453800538a4616085eaa1c7bcb6080d3e30ab9e Mon Sep 17 00:00:00 2001 From: Anna-Mariia Shkarlinska Date: Wed, 2 Jan 2019 12:14:44 +0100 Subject: [PATCH 14/44] Make cell property public --- CarlensCollectionViewLayout/CarlensCollectionViewCell.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CarlensCollectionViewLayout/CarlensCollectionViewCell.swift b/CarlensCollectionViewLayout/CarlensCollectionViewCell.swift index ab3e779..029644d 100644 --- a/CarlensCollectionViewLayout/CarlensCollectionViewCell.swift +++ b/CarlensCollectionViewLayout/CarlensCollectionViewCell.swift @@ -9,7 +9,7 @@ import UIKit.UICollectionView open class CarlensCollectionViewCell: UICollectionViewCell { /// Indicates if the cell is currently displayed as primary cell - var isCurrentlyPrimary = false + public var isCurrentlyPrimary = false private let topViewHeight: CGFloat = UIScreen.main.bounds.height > 568 ? 200 : 170 From b61216d1a05d20f0111b0be8fa592ec44a414792 Mon Sep 17 00:00:00 2001 From: Anna-Mariia Shkarlinska Date: Wed, 2 Jan 2019 12:25:29 +0100 Subject: [PATCH 15/44] Add guard statement to animation method --- CarlensCollectionViewLayout/CarlensCollectionViewCell.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/CarlensCollectionViewLayout/CarlensCollectionViewCell.swift b/CarlensCollectionViewLayout/CarlensCollectionViewCell.swift index 029644d..8ea8681 100644 --- a/CarlensCollectionViewLayout/CarlensCollectionViewCell.swift +++ b/CarlensCollectionViewLayout/CarlensCollectionViewCell.swift @@ -24,6 +24,7 @@ open class CarlensCollectionViewCell: UICollectionViewCell { } private func animateViews(toProgress progress: Double) { + guard cardView != nil else { return } let offset = topViewHeight - (CGFloat(progress) * topViewHeight) cardView.transform = .init(translationX: 0, y: -offset) } From 9dacfc9096e90361f35dbd80d96082bd74438d9a Mon Sep 17 00:00:00 2001 From: Anna-Mariia Shkarlinska Date: Wed, 2 Jan 2019 15:51:28 +0100 Subject: [PATCH 16/44] Update documentation --- .../CarlensCollectionViewCell.swift | 9 ++++++++- .../CarlensCollectionViewLayout.swift | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CarlensCollectionViewLayout/CarlensCollectionViewCell.swift b/CarlensCollectionViewLayout/CarlensCollectionViewCell.swift index 8ea8681..d04b7fd 100644 --- a/CarlensCollectionViewLayout/CarlensCollectionViewCell.swift +++ b/CarlensCollectionViewLayout/CarlensCollectionViewCell.swift @@ -8,15 +8,22 @@ import UIKit.UICollectionView open class CarlensCollectionViewCell: UICollectionViewCell { - /// Indicates if the cell is currently displayed as primary cell + /// Indicates if the cell is currently displayed as primary cell. public var isCurrentlyPrimary = false private let topViewHeight: CGFloat = UIScreen.main.bounds.height > 568 ? 200 : 170 + /// The upper view of the cell. public var topView: UIView! + /// The bottom view of the cell. public var cardView: UIView! + /// Configuration of the cell. Must be called on a start. + /// + /// - Parameters: + /// - topView: The upper view of the cell. + /// - cardView: The bottom view of the cell. open func configure(topView: UIView, cardView: UIView) { self.topView = topView self.cardView = cardView diff --git a/CarlensCollectionViewLayout/CarlensCollectionViewLayout.swift b/CarlensCollectionViewLayout/CarlensCollectionViewLayout.swift index 238e980..0ef85f8 100644 --- a/CarlensCollectionViewLayout/CarlensCollectionViewLayout.swift +++ b/CarlensCollectionViewLayout/CarlensCollectionViewLayout.swift @@ -14,6 +14,7 @@ public final class CarlensCollectionViewLayout: UICollectionViewFlowLayout { private let spacingBetweenElements = 20 + /// SeeAlso: UICollectionViewFlowLayout public override func prepare() { super.prepare() guard !firstSetupDone else { return } @@ -44,7 +45,6 @@ public final class CarlensCollectionViewLayout: UICollectionViewFlowLayout { /// SeeAlso: UICollectionViewFlowLayout public override func layoutAttributesForElements(in rect: CGRect) -> [UICollectionViewLayoutAttributes]? { guard let collectionView = collectionView, let allAttributes = super.layoutAttributesForElements(in: rect) else { return nil } - for attributes in allAttributes { let collectionCenter = collectionView.bounds.size.width / 2 let offset = collectionView.contentOffset.x From b98e7d90f793861c9dc3e15c1125b79ab12c9849 Mon Sep 17 00:00:00 2001 From: Anna-Mariia Shkarlinska Date: Wed, 2 Jan 2019 15:52:25 +0100 Subject: [PATCH 17/44] Update attributes access level --- CarlensCollectionViewLayout/CarlensLayoutAttributes.swift | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CarlensCollectionViewLayout/CarlensLayoutAttributes.swift b/CarlensCollectionViewLayout/CarlensLayoutAttributes.swift index 67b045e..3d4096e 100644 --- a/CarlensCollectionViewLayout/CarlensLayoutAttributes.swift +++ b/CarlensCollectionViewLayout/CarlensLayoutAttributes.swift @@ -6,20 +6,20 @@ import UIKit -public final class CarlensLayoutAttributes: UICollectionViewLayoutAttributes { +final class CarlensLayoutAttributes: UICollectionViewLayoutAttributes { /// Progress towards the center of the screen, value between 0 and 1. - public var progress = 0.0 + var progress = 0.0 /// SeeAlso: UICollectionViewLayoutAttributes - public override func copy(with zone: NSZone?) -> Any { + override func copy(with zone: NSZone?) -> Any { guard let attributes = super.copy(with: zone) as? CarlensLayoutAttributes else { return super.copy(with: zone) } attributes.progress = progress return attributes } /// SeeAlso: UICollectionViewLayoutAttributes - public override func isEqual(_ object: Any?) -> Bool { + override func isEqual(_ object: Any?) -> Bool { guard let attributes = object as? CarlensLayoutAttributes else { return false } guard attributes.progress == progress else { return false } return super.isEqual(object) From 688272e91d0489329d10fcf69aa4d8845c138c9c Mon Sep 17 00:00:00 2001 From: Anna-Mariia Shkarlinska Date: Wed, 2 Jan 2019 18:46:03 +0100 Subject: [PATCH 18/44] Reorder properties in the cell --- CarlensCollectionViewLayout/CarlensCollectionViewCell.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CarlensCollectionViewLayout/CarlensCollectionViewCell.swift b/CarlensCollectionViewLayout/CarlensCollectionViewCell.swift index d04b7fd..8de329e 100644 --- a/CarlensCollectionViewLayout/CarlensCollectionViewCell.swift +++ b/CarlensCollectionViewLayout/CarlensCollectionViewCell.swift @@ -11,14 +11,14 @@ open class CarlensCollectionViewCell: UICollectionViewCell { /// Indicates if the cell is currently displayed as primary cell. public var isCurrentlyPrimary = false - private let topViewHeight: CGFloat = UIScreen.main.bounds.height > 568 ? 200 : 170 - /// The upper view of the cell. public var topView: UIView! /// The bottom view of the cell. public var cardView: UIView! + private let topViewHeight: CGFloat = UIScreen.main.bounds.height > 568 ? 200 : 170 + /// Configuration of the cell. Must be called on a start. /// /// - Parameters: From 2c9297a44e2dade739776386db55464f87446df6 Mon Sep 17 00:00:00 2001 From: Anna-Mariia Shkarlinska Date: Thu, 3 Jan 2019 12:08:15 +0100 Subject: [PATCH 19/44] Improve guard statements usage --- CarlensCollectionViewLayout/CarlensLayoutAttributes.swift | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CarlensCollectionViewLayout/CarlensLayoutAttributes.swift b/CarlensCollectionViewLayout/CarlensLayoutAttributes.swift index 3d4096e..7e3b184 100644 --- a/CarlensCollectionViewLayout/CarlensLayoutAttributes.swift +++ b/CarlensCollectionViewLayout/CarlensLayoutAttributes.swift @@ -13,15 +13,15 @@ final class CarlensLayoutAttributes: UICollectionViewLayoutAttributes { /// SeeAlso: UICollectionViewLayoutAttributes override func copy(with zone: NSZone?) -> Any { - guard let attributes = super.copy(with: zone) as? CarlensLayoutAttributes else { return super.copy(with: zone) } - attributes.progress = progress + let attributes = super.copy(with: zone) + (attributes as? CarlensLayoutAttributes)?.progress = progress return attributes } /// SeeAlso: UICollectionViewLayoutAttributes override func isEqual(_ object: Any?) -> Bool { - guard let attributes = object as? CarlensLayoutAttributes else { return false } - guard attributes.progress == progress else { return false } + guard let attributes = object as? CarlensLayoutAttributes, + attributes.progress == progress else { return false } return super.isEqual(object) } } From dd4cf6d1e452d7dd9bbbd0a5600ab6709421d819 Mon Sep 17 00:00:00 2001 From: Anna-Mariia Shkarlinska Date: Thu, 3 Jan 2019 12:16:10 +0100 Subject: [PATCH 20/44] Remove unused variable --- CarlensCollectionViewLayout/CarlensCollectionViewLayout.swift | 2 -- 1 file changed, 2 deletions(-) diff --git a/CarlensCollectionViewLayout/CarlensCollectionViewLayout.swift b/CarlensCollectionViewLayout/CarlensCollectionViewLayout.swift index 0ef85f8..ef1c906 100644 --- a/CarlensCollectionViewLayout/CarlensCollectionViewLayout.swift +++ b/CarlensCollectionViewLayout/CarlensCollectionViewLayout.swift @@ -12,8 +12,6 @@ public final class CarlensCollectionViewLayout: UICollectionViewFlowLayout { private var firstSetupDone = false - private let spacingBetweenElements = 20 - /// SeeAlso: UICollectionViewFlowLayout public override func prepare() { super.prepare() From f5744b1815ba7d0a448c4f0067dc8b23b15bf610 Mon Sep 17 00:00:00 2001 From: Anna-Mariia Shkarlinska Date: Thu, 3 Jan 2019 12:37:18 +0100 Subject: [PATCH 21/44] Remove guard statement from cell file --- CarlensCollectionViewLayout/CarlensCollectionViewCell.swift | 1 - 1 file changed, 1 deletion(-) diff --git a/CarlensCollectionViewLayout/CarlensCollectionViewCell.swift b/CarlensCollectionViewLayout/CarlensCollectionViewCell.swift index 8de329e..fc79c4e 100644 --- a/CarlensCollectionViewLayout/CarlensCollectionViewCell.swift +++ b/CarlensCollectionViewLayout/CarlensCollectionViewCell.swift @@ -31,7 +31,6 @@ open class CarlensCollectionViewCell: UICollectionViewCell { } private func animateViews(toProgress progress: Double) { - guard cardView != nil else { return } let offset = topViewHeight - (CGFloat(progress) * topViewHeight) cardView.transform = .init(translationX: 0, y: -offset) } From 1e6fd6562382709e684e11beba0136eefaeb852d Mon Sep 17 00:00:00 2001 From: Anna-Mariia Shkarlinska Date: Thu, 3 Jan 2019 15:09:03 +0100 Subject: [PATCH 22/44] Rename project to CarLensCollectionViewLayout --- .../project.pbxproj | 62 +++++++++---------- .../xcshareddata/IDEWorkspaceChecks.plist | 0 .../CarlensCollectionViewLayout.xcscheme | 18 +++--- .../CarLensCollectionViewCell.swift | 10 +-- .../CarLensCollectionViewLayout.h | 4 +- .../CarLensCollectionViewLayout.swift | 10 +-- .../CarLensLayoutAttributes.swift | 12 ++-- .../Info.plist | 0 .../contents.xcworkspacedata | 7 --- README.md | 8 +-- bitrise.yml | 4 +- 11 files changed, 66 insertions(+), 69 deletions(-) rename {CarlensCollectionViewLayout.xcodeproj => CarLensCollectionViewLayout.xcodeproj}/project.pbxproj (81%) rename {CarlensCollectionViewLayout.xcodeproj => CarLensCollectionViewLayout.xcodeproj}/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist (100%) rename {CarlensCollectionViewLayout.xcodeproj => CarLensCollectionViewLayout.xcodeproj}/xcshareddata/xcschemes/CarlensCollectionViewLayout.xcscheme (81%) rename CarlensCollectionViewLayout/CarlensCollectionViewCell.swift => CarLensCollectionViewLayout/CarLensCollectionViewCell.swift (88%) rename CarlensCollectionViewLayout/CarlensCollectionViewLayout.h => CarLensCollectionViewLayout/CarLensCollectionViewLayout.h (89%) rename CarlensCollectionViewLayout/CarlensCollectionViewLayout.swift => CarLensCollectionViewLayout/CarLensCollectionViewLayout.swift (92%) rename CarlensCollectionViewLayout/CarlensLayoutAttributes.swift => CarLensCollectionViewLayout/CarLensLayoutAttributes.swift (63%) rename {CarlensCollectionViewLayout => CarLensCollectionViewLayout}/Info.plist (100%) delete mode 100644 CarlensCollectionViewLayout.xcodeproj/project.xcworkspace/contents.xcworkspacedata diff --git a/CarlensCollectionViewLayout.xcodeproj/project.pbxproj b/CarLensCollectionViewLayout.xcodeproj/project.pbxproj similarity index 81% rename from CarlensCollectionViewLayout.xcodeproj/project.pbxproj rename to CarLensCollectionViewLayout.xcodeproj/project.pbxproj index 6274d01..db68bec 100644 --- a/CarlensCollectionViewLayout.xcodeproj/project.pbxproj +++ b/CarLensCollectionViewLayout.xcodeproj/project.pbxproj @@ -7,19 +7,19 @@ objects = { /* Begin PBXBuildFile section */ - 9505725E21D4D8FB009EA422 /* CarlensCollectionViewLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9505725D21D4D8FB009EA422 /* CarlensCollectionViewLayout.swift */; }; - 9505726021D4D922009EA422 /* CarlensLayoutAttributes.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9505725F21D4D922009EA422 /* CarlensLayoutAttributes.swift */; }; - 955E4FD421CBFB2800B4C3BB /* CarlensCollectionViewLayout.h in Headers */ = {isa = PBXBuildFile; fileRef = 955E4FD221CBFB2800B4C3BB /* CarlensCollectionViewLayout.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 958D17C021D66DF00067BED6 /* CarlensCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 958D17BF21D66DF00067BED6 /* CarlensCollectionViewCell.swift */; }; + 9505725E21D4D8FB009EA422 /* CarLensCollectionViewLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9505725D21D4D8FB009EA422 /* CarLensCollectionViewLayout.swift */; }; + 9505726021D4D922009EA422 /* CarLensLayoutAttributes.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9505725F21D4D922009EA422 /* CarLensLayoutAttributes.swift */; }; + 955E4FD421CBFB2800B4C3BB /* CarLensCollectionViewLayout.h in Headers */ = {isa = PBXBuildFile; fileRef = 955E4FD221CBFB2800B4C3BB /* CarLensCollectionViewLayout.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 958D17C021D66DF00067BED6 /* CarLensCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 958D17BF21D66DF00067BED6 /* CarLensCollectionViewCell.swift */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ - 9505725D21D4D8FB009EA422 /* CarlensCollectionViewLayout.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CarlensCollectionViewLayout.swift; sourceTree = ""; }; - 9505725F21D4D922009EA422 /* CarlensLayoutAttributes.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CarlensLayoutAttributes.swift; sourceTree = ""; }; - 955E4FCF21CBFB2800B4C3BB /* CarlensCollectionViewLayout.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = CarlensCollectionViewLayout.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 955E4FD221CBFB2800B4C3BB /* CarlensCollectionViewLayout.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CarlensCollectionViewLayout.h; sourceTree = ""; }; + 9505725D21D4D8FB009EA422 /* CarLensCollectionViewLayout.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CarLensCollectionViewLayout.swift; sourceTree = ""; }; + 9505725F21D4D922009EA422 /* CarLensLayoutAttributes.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CarLensLayoutAttributes.swift; sourceTree = ""; }; + 955E4FCF21CBFB2800B4C3BB /* CarLensCollectionViewLayout.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = CarLensCollectionViewLayout.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 955E4FD221CBFB2800B4C3BB /* CarLensCollectionViewLayout.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CarLensCollectionViewLayout.h; sourceTree = ""; }; 955E4FD321CBFB2800B4C3BB /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 958D17BF21D66DF00067BED6 /* CarlensCollectionViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CarlensCollectionViewCell.swift; sourceTree = ""; }; + 958D17BF21D66DF00067BED6 /* CarLensCollectionViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CarLensCollectionViewCell.swift; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -36,7 +36,7 @@ 955E4FC521CBFB2800B4C3BB = { isa = PBXGroup; children = ( - 955E4FD121CBFB2800B4C3BB /* CarlensCollectionViewLayout */, + 955E4FD121CBFB2800B4C3BB /* CarLensCollectionViewLayout */, 955E4FD021CBFB2800B4C3BB /* Products */, ); sourceTree = ""; @@ -44,21 +44,21 @@ 955E4FD021CBFB2800B4C3BB /* Products */ = { isa = PBXGroup; children = ( - 955E4FCF21CBFB2800B4C3BB /* CarlensCollectionViewLayout.framework */, + 955E4FCF21CBFB2800B4C3BB /* CarLensCollectionViewLayout.framework */, ); name = Products; sourceTree = ""; }; - 955E4FD121CBFB2800B4C3BB /* CarlensCollectionViewLayout */ = { + 955E4FD121CBFB2800B4C3BB /* CarLensCollectionViewLayout */ = { isa = PBXGroup; children = ( - 955E4FD221CBFB2800B4C3BB /* CarlensCollectionViewLayout.h */, - 9505725D21D4D8FB009EA422 /* CarlensCollectionViewLayout.swift */, - 958D17BF21D66DF00067BED6 /* CarlensCollectionViewCell.swift */, - 9505725F21D4D922009EA422 /* CarlensLayoutAttributes.swift */, + 955E4FD221CBFB2800B4C3BB /* CarLensCollectionViewLayout.h */, + 9505725D21D4D8FB009EA422 /* CarLensCollectionViewLayout.swift */, + 958D17BF21D66DF00067BED6 /* CarLensCollectionViewCell.swift */, + 9505725F21D4D922009EA422 /* CarLensLayoutAttributes.swift */, 955E4FD321CBFB2800B4C3BB /* Info.plist */, ); - path = CarlensCollectionViewLayout; + path = CarLensCollectionViewLayout; sourceTree = ""; }; /* End PBXGroup section */ @@ -68,16 +68,16 @@ isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( - 955E4FD421CBFB2800B4C3BB /* CarlensCollectionViewLayout.h in Headers */, + 955E4FD421CBFB2800B4C3BB /* CarLensCollectionViewLayout.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXHeadersBuildPhase section */ /* Begin PBXNativeTarget section */ - 955E4FCE21CBFB2800B4C3BB /* CarlensCollectionViewLayout */ = { + 955E4FCE21CBFB2800B4C3BB /* CarLensCollectionViewLayout */ = { isa = PBXNativeTarget; - buildConfigurationList = 955E4FD721CBFB2800B4C3BB /* Build configuration list for PBXNativeTarget "CarlensCollectionViewLayout" */; + buildConfigurationList = 955E4FD721CBFB2800B4C3BB /* Build configuration list for PBXNativeTarget "CarLensCollectionViewLayout" */; buildPhases = ( 955E4FCA21CBFB2800B4C3BB /* Headers */, 955E4FCB21CBFB2800B4C3BB /* Sources */, @@ -88,9 +88,9 @@ ); dependencies = ( ); - name = CarlensCollectionViewLayout; + name = CarLensCollectionViewLayout; productName = CarlensCollectionViewLayout; - productReference = 955E4FCF21CBFB2800B4C3BB /* CarlensCollectionViewLayout.framework */; + productReference = 955E4FCF21CBFB2800B4C3BB /* CarLensCollectionViewLayout.framework */; productType = "com.apple.product-type.framework"; }; /* End PBXNativeTarget section */ @@ -107,7 +107,7 @@ }; }; }; - buildConfigurationList = 955E4FC921CBFB2800B4C3BB /* Build configuration list for PBXProject "CarlensCollectionViewLayout" */; + buildConfigurationList = 955E4FC921CBFB2800B4C3BB /* Build configuration list for PBXProject "CarLensCollectionViewLayout" */; compatibilityVersion = "Xcode 9.3"; developmentRegion = en; hasScannedForEncodings = 0; @@ -119,7 +119,7 @@ projectDirPath = ""; projectRoot = ""; targets = ( - 955E4FCE21CBFB2800B4C3BB /* CarlensCollectionViewLayout */, + 955E4FCE21CBFB2800B4C3BB /* CarLensCollectionViewLayout */, ); }; /* End PBXProject section */ @@ -139,9 +139,9 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 9505725E21D4D8FB009EA422 /* CarlensCollectionViewLayout.swift in Sources */, - 958D17C021D66DF00067BED6 /* CarlensCollectionViewCell.swift in Sources */, - 9505726021D4D922009EA422 /* CarlensLayoutAttributes.swift in Sources */, + 9505725E21D4D8FB009EA422 /* CarLensCollectionViewLayout.swift in Sources */, + 958D17C021D66DF00067BED6 /* CarLensCollectionViewCell.swift in Sources */, + 9505726021D4D922009EA422 /* CarLensLayoutAttributes.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -287,7 +287,7 @@ "@executable_path/Frameworks", "@loader_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = co.netguru.lib.CarlensCollectionViewLayout; + PRODUCT_BUNDLE_IDENTIFIER = co.netguru.lib.CarLensCollectionViewLayout; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; PROVISIONING_PROFILE_SPECIFIER = ""; SKIP_INSTALL = YES; @@ -313,7 +313,7 @@ "@executable_path/Frameworks", "@loader_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = co.netguru.lib.CarlensCollectionViewLayout; + PRODUCT_BUNDLE_IDENTIFIER = co.netguru.lib.CarLensCollectionViewLayout; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; PROVISIONING_PROFILE_SPECIFIER = ""; SKIP_INSTALL = YES; @@ -325,7 +325,7 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ - 955E4FC921CBFB2800B4C3BB /* Build configuration list for PBXProject "CarlensCollectionViewLayout" */ = { + 955E4FC921CBFB2800B4C3BB /* Build configuration list for PBXProject "CarLensCollectionViewLayout" */ = { isa = XCConfigurationList; buildConfigurations = ( 955E4FD521CBFB2800B4C3BB /* Debug */, @@ -334,7 +334,7 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 955E4FD721CBFB2800B4C3BB /* Build configuration list for PBXNativeTarget "CarlensCollectionViewLayout" */ = { + 955E4FD721CBFB2800B4C3BB /* Build configuration list for PBXNativeTarget "CarLensCollectionViewLayout" */ = { isa = XCConfigurationList; buildConfigurations = ( 955E4FD821CBFB2800B4C3BB /* Debug */, diff --git a/CarlensCollectionViewLayout.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/CarLensCollectionViewLayout.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist similarity index 100% rename from CarlensCollectionViewLayout.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist rename to CarLensCollectionViewLayout.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist diff --git a/CarlensCollectionViewLayout.xcodeproj/xcshareddata/xcschemes/CarlensCollectionViewLayout.xcscheme b/CarLensCollectionViewLayout.xcodeproj/xcshareddata/xcschemes/CarlensCollectionViewLayout.xcscheme similarity index 81% rename from CarlensCollectionViewLayout.xcodeproj/xcshareddata/xcschemes/CarlensCollectionViewLayout.xcscheme rename to CarLensCollectionViewLayout.xcodeproj/xcshareddata/xcschemes/CarlensCollectionViewLayout.xcscheme index b1490b2..5643a70 100644 --- a/CarlensCollectionViewLayout.xcodeproj/xcshareddata/xcschemes/CarlensCollectionViewLayout.xcscheme +++ b/CarLensCollectionViewLayout.xcodeproj/xcshareddata/xcschemes/CarlensCollectionViewLayout.xcscheme @@ -15,9 +15,9 @@ + BuildableName = "CarLensCollectionViewLayout.framework" + BlueprintName = "CarLensCollectionViewLayout" + ReferencedContainer = "container:CarLensCollectionViewLayout.xcodeproj"> @@ -46,9 +46,9 @@ + BuildableName = "CarLensCollectionViewLayout.framework" + BlueprintName = "CarLensCollectionViewLayout" + ReferencedContainer = "container:CarLensCollectionViewLayout.xcodeproj"> @@ -64,9 +64,9 @@ + BuildableName = "CarLensCollectionViewLayout.framework" + BlueprintName = "CarLensCollectionViewLayout" + ReferencedContainer = "container:CarLensCollectionViewLayout.xcodeproj"> diff --git a/CarlensCollectionViewLayout/CarlensCollectionViewCell.swift b/CarLensCollectionViewLayout/CarLensCollectionViewCell.swift similarity index 88% rename from CarlensCollectionViewLayout/CarlensCollectionViewCell.swift rename to CarLensCollectionViewLayout/CarLensCollectionViewCell.swift index fc79c4e..351a754 100644 --- a/CarlensCollectionViewLayout/CarlensCollectionViewCell.swift +++ b/CarLensCollectionViewLayout/CarLensCollectionViewCell.swift @@ -1,12 +1,14 @@ // -// CarListCollectionViewCell.swift -// CarRecognition +// CarLensCollectionViewCell.swift +// CarLensCollectionViewCell +// +// Copyright © 2018 Netguru. All rights reserved. // import UIKit.UICollectionView -open class CarlensCollectionViewCell: UICollectionViewCell { +open class CarLensCollectionViewCell: UICollectionViewCell { /// Indicates if the cell is currently displayed as primary cell. public var isCurrentlyPrimary = false @@ -52,7 +54,7 @@ open class CarlensCollectionViewCell: UICollectionViewCell { /// - SeeAlso: UICollectionViewCell override open func apply(_ layoutAttributes: UICollectionViewLayoutAttributes) { super.apply(layoutAttributes) - guard let attributes = layoutAttributes as? CarlensLayoutAttributes else { return } + guard let attributes = layoutAttributes as? CarLensLayoutAttributes else { return } isCurrentlyPrimary = !(attributes.progress == 0) animateViews(toProgress: attributes.progress) } diff --git a/CarlensCollectionViewLayout/CarlensCollectionViewLayout.h b/CarLensCollectionViewLayout/CarLensCollectionViewLayout.h similarity index 89% rename from CarlensCollectionViewLayout/CarlensCollectionViewLayout.h rename to CarLensCollectionViewLayout/CarLensCollectionViewLayout.h index d112195..d01fbe4 100644 --- a/CarlensCollectionViewLayout/CarlensCollectionViewLayout.h +++ b/CarLensCollectionViewLayout/CarLensCollectionViewLayout.h @@ -1,6 +1,6 @@ // -// CarlensCollectionViewLayout.h -// CarlensCollectionViewLayout +// CarLensCollectionViewLayout.h +// CarLensCollectionViewLayout // // Created by Anna on 20/12/2018. // Copyright © 2018 Netguru. All rights reserved. diff --git a/CarlensCollectionViewLayout/CarlensCollectionViewLayout.swift b/CarLensCollectionViewLayout/CarLensCollectionViewLayout.swift similarity index 92% rename from CarlensCollectionViewLayout/CarlensCollectionViewLayout.swift rename to CarLensCollectionViewLayout/CarLensCollectionViewLayout.swift index ef1c906..11ef1d5 100644 --- a/CarlensCollectionViewLayout/CarlensCollectionViewLayout.swift +++ b/CarLensCollectionViewLayout/CarLensCollectionViewLayout.swift @@ -1,6 +1,6 @@ // -// CarlensCollectionViewLayout.swift -// CarlensCollectionViewLayout +// CarLensCollectionViewLayout.swift +// CarLensCollectionViewLayout // // Created by Anna on 27/12/2018. // Copyright © 2018 Netguru. All rights reserved. @@ -8,7 +8,7 @@ import UIKit -public final class CarlensCollectionViewLayout: UICollectionViewFlowLayout { +public final class CarLensCollectionViewLayout: UICollectionViewFlowLayout { private var firstSetupDone = false @@ -37,7 +37,7 @@ public final class CarlensCollectionViewLayout: UICollectionViewFlowLayout { /// SeeAlso: UICollectionViewFlowLayout override public class var layoutAttributesClass: AnyClass { - return CarlensLayoutAttributes.self + return CarLensLayoutAttributes.self } /// SeeAlso: UICollectionViewFlowLayout @@ -53,7 +53,7 @@ public final class CarlensCollectionViewLayout: UICollectionViewFlowLayout { let ratio = (maxDistance - abs(distanceFromCenter)) / maxDistance let normalizedRatio = min(1, max(0, ratio)) - guard let attributes = attributes as? CarlensLayoutAttributes else { continue } + guard let attributes = attributes as? CarLensLayoutAttributes else { continue } attributes.progress = Double(normalizedRatio) } return allAttributes diff --git a/CarlensCollectionViewLayout/CarlensLayoutAttributes.swift b/CarLensCollectionViewLayout/CarLensLayoutAttributes.swift similarity index 63% rename from CarlensCollectionViewLayout/CarlensLayoutAttributes.swift rename to CarLensCollectionViewLayout/CarLensLayoutAttributes.swift index 7e3b184..4ef4a94 100644 --- a/CarlensCollectionViewLayout/CarlensLayoutAttributes.swift +++ b/CarLensCollectionViewLayout/CarLensLayoutAttributes.swift @@ -1,12 +1,14 @@ // -// CarListLayoutAttributes.swift -// CarRecognition +// CarLensLayoutAttributes.swift +// CarLensLayoutAttributes +// +// Copyright © 2018 Netguru. All rights reserved. // import UIKit -final class CarlensLayoutAttributes: UICollectionViewLayoutAttributes { +final class CarLensLayoutAttributes: UICollectionViewLayoutAttributes { /// Progress towards the center of the screen, value between 0 and 1. var progress = 0.0 @@ -14,13 +16,13 @@ final class CarlensLayoutAttributes: UICollectionViewLayoutAttributes { /// SeeAlso: UICollectionViewLayoutAttributes override func copy(with zone: NSZone?) -> Any { let attributes = super.copy(with: zone) - (attributes as? CarlensLayoutAttributes)?.progress = progress + (attributes as? CarLensLayoutAttributes)?.progress = progress return attributes } /// SeeAlso: UICollectionViewLayoutAttributes override func isEqual(_ object: Any?) -> Bool { - guard let attributes = object as? CarlensLayoutAttributes, + guard let attributes = object as? CarLensLayoutAttributes, attributes.progress == progress else { return false } return super.isEqual(object) } diff --git a/CarlensCollectionViewLayout/Info.plist b/CarLensCollectionViewLayout/Info.plist similarity index 100% rename from CarlensCollectionViewLayout/Info.plist rename to CarLensCollectionViewLayout/Info.plist diff --git a/CarlensCollectionViewLayout.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/CarlensCollectionViewLayout.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index fb0b20f..0000000 --- a/CarlensCollectionViewLayout.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/README.md b/README.md index 6d58761..d05a2cc 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# CarlensCollectionViewLayout +# CarLensCollectionViewLayout The beautiful animation of collection view cells. @@ -34,6 +34,6 @@ The beautiful animation of collection view cells. ## Related repositories -- [Carlens iOS](https://github.com/netguru/car-recognition-ios) -- [Carlens Android](https://github.com/netguru/car-recognition-android) -- [Carlens Machine Learning](https://github.com/netguru/car-recognition-ml) +- [CarLens iOS](https://github.com/netguru/car-recognition-ios) +- [CarLens Android](https://github.com/netguru/car-recognition-android) +- [CarLens Machine Learning](https://github.com/netguru/car-recognition-ml) diff --git a/bitrise.yml b/bitrise.yml index 8f295d7..b549db6 100644 --- a/bitrise.yml +++ b/bitrise.yml @@ -23,7 +23,7 @@ trigger_map: app: envs: - - XCODEBUILD_PROJECT: ./CarlensCollectionViewLayout.xcodeproj + - XCODEBUILD_PROJECT: ./CarLensCollectionViewLayout.xcodeproj # Workflow declarations @@ -33,7 +33,7 @@ workflows: build: envs: - - XCODEBUILD_SCHEME: CarlensCollectionViewLayout + - XCODEBUILD_SCHEME: CarLensCollectionViewLayout before_run: - build-scheme after_run: From 6a70cb725ed3516b32e19833f9a54ec106dd09b4 Mon Sep 17 00:00:00 2001 From: Anna-Mariia Shkarlinska Date: Thu, 3 Jan 2019 15:44:01 +0100 Subject: [PATCH 23/44] Remove an author and date from the documentation --- CarLensCollectionViewLayout/CarLensCollectionViewLayout.swift | 1 - 1 file changed, 1 deletion(-) diff --git a/CarLensCollectionViewLayout/CarLensCollectionViewLayout.swift b/CarLensCollectionViewLayout/CarLensCollectionViewLayout.swift index 11ef1d5..8ccaacc 100644 --- a/CarLensCollectionViewLayout/CarLensCollectionViewLayout.swift +++ b/CarLensCollectionViewLayout/CarLensCollectionViewLayout.swift @@ -2,7 +2,6 @@ // CarLensCollectionViewLayout.swift // CarLensCollectionViewLayout // -// Created by Anna on 27/12/2018. // Copyright © 2018 Netguru. All rights reserved. // From 2f92b23a08ee3f09150becceac6c925ac0ec67c0 Mon Sep 17 00:00:00 2001 From: Anna-Mariia Shkarlinska Date: Thu, 3 Jan 2019 16:56:21 +0100 Subject: [PATCH 24/44] Add license --- LICENSE.md | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 LICENSE.md diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..1ec5341 --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) 2019 Netguru + +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. From 45dcb782f8a486bf299d7a085a5cf4cc5cf1b09a Mon Sep 17 00:00:00 2001 From: Anna-Mariia Shkarlinska Date: Thu, 3 Jan 2019 19:16:21 +0100 Subject: [PATCH 25/44] Create podspec --- CarLensCollectionViewLayout.podspec | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 CarLensCollectionViewLayout.podspec diff --git a/CarLensCollectionViewLayout.podspec b/CarLensCollectionViewLayout.podspec new file mode 100644 index 0000000..750386c --- /dev/null +++ b/CarLensCollectionViewLayout.podspec @@ -0,0 +1,18 @@ +Pod::Spec.new do |s| + + s.name = "CarLensCollectionViewLayout" + s.version = "1.0.0" + s.summary = "An easy to use Collection View Layout for card-like animation." + + s.homepage = "https://github.com/netguru/CarlensCollectionViewLayout" + s.license = { :type => "MIT", :file => "LICENSE.md" } + s.authors = { "Anna-Mariia Shkarlinska" => "anna-mariia.shkarlinska@netguru.co", + "Michał Kwiecień" => "michal.kwiecien@netguru.co" } + + s.platform = :ios, "9.0" + s.source = { :git => "https://github.com/netguru/CarlensCollectionViewLayout.git", :tag => "#{s.version}" } + s.source_files = "CarlensCollectionViewLayout/**/*.swift" + s.swift_version = "4.2" + s.framework = "UIKit" + +end \ No newline at end of file From 99bc2de4586cf93b08108d5fca581d81f7c6ec66 Mon Sep 17 00:00:00 2001 From: Piotr Sochalewski Date: Fri, 4 Jan 2019 12:46:57 +0100 Subject: [PATCH 26/44] Update company name in LICENSE.md Co-Authored-By: anyashka --- LICENSE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE.md b/LICENSE.md index 1ec5341..35a2e8f 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2019 Netguru +Copyright (c) 2019 Netguru S.A. 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: From b5f3fe303c1618c6c9aa7227e3014849244daf26 Mon Sep 17 00:00:00 2001 From: Anna-Mariia Shkarlinska Date: Fri, 4 Jan 2019 14:25:23 +0100 Subject: [PATCH 27/44] Add cocoapods step to bitrise --- bitrise.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/bitrise.yml b/bitrise.yml index b549db6..44b673a 100644 --- a/bitrise.yml +++ b/bitrise.yml @@ -36,6 +36,7 @@ workflows: - XCODEBUILD_SCHEME: CarLensCollectionViewLayout before_run: - build-scheme + - cocoapods-test after_run: - deploy-artifacts @@ -45,6 +46,13 @@ workflows: inputs: - content: xcodebuild -project $XCODEBUILD_PROJECT -scheme $XCODEBUILD_SCHEME -destination 'platform=iOS Simulator,name=iPhone 7 Plus' + cocoapods-test: + steps: + - script: + title: cocoapods-lint + inputs: + - content: pod lib lint + # Deploy workflows deploy-artifacts: From c977636f2397ff74fed96ec862376081ec18812d Mon Sep 17 00:00:00 2001 From: Anna-Mariia Shkarlinska Date: Fri, 4 Jan 2019 14:27:51 +0100 Subject: [PATCH 28/44] Rename scheme --- ...onViewLayout.xcscheme => CarLensCollectionViewLayout.xcscheme} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename CarLensCollectionViewLayout.xcodeproj/xcshareddata/xcschemes/{CarlensCollectionViewLayout.xcscheme => CarLensCollectionViewLayout.xcscheme} (100%) diff --git a/CarLensCollectionViewLayout.xcodeproj/xcshareddata/xcschemes/CarlensCollectionViewLayout.xcscheme b/CarLensCollectionViewLayout.xcodeproj/xcshareddata/xcschemes/CarLensCollectionViewLayout.xcscheme similarity index 100% rename from CarLensCollectionViewLayout.xcodeproj/xcshareddata/xcschemes/CarlensCollectionViewLayout.xcscheme rename to CarLensCollectionViewLayout.xcodeproj/xcshareddata/xcschemes/CarLensCollectionViewLayout.xcscheme From f1163599fead8f5127368532bbc95f4013e0ac28 Mon Sep 17 00:00:00 2001 From: Anna-Mariia Shkarlinska Date: Fri, 4 Jan 2019 14:55:54 +0100 Subject: [PATCH 29/44] Add --alow-warnings flag to pods step in bitrise.yml Should be removed once repo becomes public --- bitrise.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bitrise.yml b/bitrise.yml index 44b673a..db6718a 100644 --- a/bitrise.yml +++ b/bitrise.yml @@ -51,7 +51,8 @@ workflows: - script: title: cocoapods-lint inputs: - - content: pod lib lint + # -- allow-warnings should be removed once repository is public + - content: pod lib lint --allow-warnings # Deploy workflows From 75c7dc562dceb651b1afa7a6c996d2821f2fec1f Mon Sep 17 00:00:00 2001 From: Anna-Mariia Shkarlinska Date: Fri, 4 Jan 2019 16:44:00 +0100 Subject: [PATCH 30/44] Update README.md for public repository --- README.md | 76 +++++++++++++++++++++++++++++++++++++------------------ 1 file changed, 51 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index d05a2cc..a3d292e 100644 --- a/README.md +++ b/README.md @@ -1,39 +1,65 @@ # CarLensCollectionViewLayout -The beautiful animation of collection view cells. +![](https://img.shields.io/badge/swift-4.2-orange.svg) +![](https://img.shields.io/badge/cocoapods-compatible-green.svg) +![](https://app.bitrise.io/app/23a07b63b3f55f97/status.svg?token=Rt_2gKUavbR8LQ7PVuTbYg&branch=master) -## Team +An easy to use Collection View Layout for card-like animation 🎉 -* [Julia Wolszczak](mailto:julia.wolszczak@netguru.co) - Project Manager -* [Anna-Mariia Shkarlinska](mailto:anna-mariia.shkarlinska@netguru.co) - iOS Developer +That's what you can do with **CarLensCollectionViewLayout**: +

+ +

-## Tools & Services +*CarLensCollectionViewLayout* was created out of the implementation in [**CarLens** application 🚘](https://github.com/netguru/car-recognition-ios). The image above exactly shows the screen from the app! -* Tools: - * Xcode 10.1 with latest iOS stable SDK (12.0) and Swift 4.2 -* Services: - * [JIRA](https://netguru.atlassian.net/secure/RapidBoard.jspa?rapidView=584&view=detail) - * [Bitrise](https://app.bitrise.io/app/8f268362f4edaa0d) +## Requirements -## Coding guidelines +*CarLensCollectionViewLayout* is written in **Swift 4.2** and supports **iOS 9.0+**. -- Respect Swift [API Design Guidelines](https://swift.org/documentation/api-design-guidelines/) -- The code must be readable and self-explanatory - full variable names, meaningful methods, etc. -- Don't leave any commented-out code. -- Write documentation for every method and property accessible outside the class. For example well documented method looks as follows: - ```swift - /// Tells the magician to perform a given trick. - /// - /// - Parameter trick: The magic trick to perform. - /// - Returns: Whether the magician succeeded in performing the magic trick. - func perform(magicTrick trick: MagicTrick) -> Bool { - // body +## Usage + +The two main steps are needed for the configuration of *CarLensCollectionViewLayout*: + +### Step 1 +Assign `CarLensCollectionViewLayout` to yours collection view layout. +```swift +collectionView.collectionViewLayout = CarLensCollectionViewLayout() +``` +### Step 2 +Subsclass `CarLensCollectionViewCell` and call `configure(topView: UIView, cardView: UIView)` right on the start! +```swift +class CarListCollectionViewCell: CarLensCollectionViewCell { + override init(frame: CGRect) { + super.init(frame: frame) + configure(topView: upperView, cardView: bottomView) } - ``` +} +``` +## Installation + +### CocoaPods + +If you're using [CocoaPods](http://cocoapods.org), add the following dependency to your `Podfile`: + +```none +pod 'CarLensCollectionViewLayout' +``` + +## About + +This project is made with ❤️ by [Netguru](https://netguru.co). + +### License + +*CarLensCollectionViewLayout* is licensed under the MIT License. See [LICENSE.md](LICENSE.md) for more info. -## Related repositories +## Related links +- [CarLens Page](https://www.netguru.com/carlens) - [CarLens iOS](https://github.com/netguru/car-recognition-ios) +- [CarLens in App Store](https://itunes.apple.com/us/app/carlens/id1417168518?mt=8) - [CarLens Android](https://github.com/netguru/car-recognition-android) -- [CarLens Machine Learning](https://github.com/netguru/car-recognition-ml) +- [CarLens on Google Play](https://play.google.com/store/apps/details?id=co.netguru.android.carrecognition&hl=en) +- [CarLens Story on a Blog](https://www.netguru.com/blog/machine-learning-and-augmented-reality-combined-in-one-sleek-mobile-app-how-we-built-car-lens) From 8e9d4627090b7fbe35bf32dbcdf3e1109cc61b0f Mon Sep 17 00:00:00 2001 From: Anna-Mariia Shkarlinska Date: Tue, 8 Jan 2019 16:11:41 +0100 Subject: [PATCH 31/44] Add initial demo project --- CarLensCollectionViewDemo/AppDelegate.swift | 46 +++++ .../AppIcon.appiconset/Contents.json | 98 ++++++++++ .../Assets.xcassets/Contents.json | 6 + .../Base.lproj/LaunchScreen.storyboard | 25 +++ .../Base.lproj/Main.storyboard | 24 +++ CarLensCollectionViewDemo/Info.plist | 43 ++++ .../ViewController.swift | 20 ++ .../project.pbxproj | 183 ++++++++++++++++++ .../CarLensCollectionViewLayoutDemo.xcscheme | 91 +++++++++ 9 files changed, 536 insertions(+) create mode 100644 CarLensCollectionViewDemo/AppDelegate.swift create mode 100644 CarLensCollectionViewDemo/Assets.xcassets/AppIcon.appiconset/Contents.json create mode 100644 CarLensCollectionViewDemo/Assets.xcassets/Contents.json create mode 100644 CarLensCollectionViewDemo/Base.lproj/LaunchScreen.storyboard create mode 100644 CarLensCollectionViewDemo/Base.lproj/Main.storyboard create mode 100644 CarLensCollectionViewDemo/Info.plist create mode 100644 CarLensCollectionViewDemo/ViewController.swift create mode 100644 CarLensCollectionViewLayout.xcodeproj/xcshareddata/xcschemes/CarLensCollectionViewLayoutDemo.xcscheme diff --git a/CarLensCollectionViewDemo/AppDelegate.swift b/CarLensCollectionViewDemo/AppDelegate.swift new file mode 100644 index 0000000..40938c8 --- /dev/null +++ b/CarLensCollectionViewDemo/AppDelegate.swift @@ -0,0 +1,46 @@ +// +// AppDelegate.swift +// Example +// +// Created by Anna on 08/01/2019. +// Copyright © 2019 Netguru. All rights reserved. +// + +import UIKit + +@UIApplicationMain +class AppDelegate: UIResponder, UIApplicationDelegate { + + var window: UIWindow? + + + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { + // Override point for customization after application launch. + return true + } + + func applicationWillResignActive(_ application: UIApplication) { + // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. + // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. + } + + func applicationDidEnterBackground(_ application: UIApplication) { + // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. + // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. + } + + func applicationWillEnterForeground(_ application: UIApplication) { + // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. + } + + func applicationDidBecomeActive(_ application: UIApplication) { + // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. + } + + func applicationWillTerminate(_ application: UIApplication) { + // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. + } + + +} + diff --git a/CarLensCollectionViewDemo/Assets.xcassets/AppIcon.appiconset/Contents.json b/CarLensCollectionViewDemo/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..d8db8d6 --- /dev/null +++ b/CarLensCollectionViewDemo/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,98 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "3x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "83.5x83.5", + "scale" : "2x" + }, + { + "idiom" : "ios-marketing", + "size" : "1024x1024", + "scale" : "1x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CarLensCollectionViewDemo/Assets.xcassets/Contents.json b/CarLensCollectionViewDemo/Assets.xcassets/Contents.json new file mode 100644 index 0000000..da4a164 --- /dev/null +++ b/CarLensCollectionViewDemo/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CarLensCollectionViewDemo/Base.lproj/LaunchScreen.storyboard b/CarLensCollectionViewDemo/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 0000000..bfa3612 --- /dev/null +++ b/CarLensCollectionViewDemo/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CarLensCollectionViewDemo/Base.lproj/Main.storyboard b/CarLensCollectionViewDemo/Base.lproj/Main.storyboard new file mode 100644 index 0000000..f1bcf38 --- /dev/null +++ b/CarLensCollectionViewDemo/Base.lproj/Main.storyboard @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CarLensCollectionViewDemo/Info.plist b/CarLensCollectionViewDemo/Info.plist new file mode 100644 index 0000000..89d7858 --- /dev/null +++ b/CarLensCollectionViewDemo/Info.plist @@ -0,0 +1,43 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/CarLensCollectionViewDemo/ViewController.swift b/CarLensCollectionViewDemo/ViewController.swift new file mode 100644 index 0000000..3bdae80 --- /dev/null +++ b/CarLensCollectionViewDemo/ViewController.swift @@ -0,0 +1,20 @@ +// +// ViewController.swift +// Example +// +// Created by Anna on 08/01/2019. +// Copyright © 2019 Netguru. All rights reserved. +// + +import UIKit + +class ViewController: UIViewController { + + override func viewDidLoad() { + super.viewDidLoad() + // Do any additional setup after loading the view, typically from a nib. + } + + +} + diff --git a/CarLensCollectionViewLayout.xcodeproj/project.pbxproj b/CarLensCollectionViewLayout.xcodeproj/project.pbxproj index db68bec..6eee5ac 100644 --- a/CarLensCollectionViewLayout.xcodeproj/project.pbxproj +++ b/CarLensCollectionViewLayout.xcodeproj/project.pbxproj @@ -9,13 +9,51 @@ /* Begin PBXBuildFile section */ 9505725E21D4D8FB009EA422 /* CarLensCollectionViewLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9505725D21D4D8FB009EA422 /* CarLensCollectionViewLayout.swift */; }; 9505726021D4D922009EA422 /* CarLensLayoutAttributes.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9505725F21D4D922009EA422 /* CarLensLayoutAttributes.swift */; }; + 9518381D21E4F04400BEA6EB /* CarLensCollectionViewLayout.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 955E4FCF21CBFB2800B4C3BB /* CarLensCollectionViewLayout.framework */; }; + 9518381E21E4F04400BEA6EB /* CarLensCollectionViewLayout.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 955E4FCF21CBFB2800B4C3BB /* CarLensCollectionViewLayout.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + 9518383121E4F09900BEA6EB /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 9518382721E4F08300BEA6EB /* Main.storyboard */; }; + 9518383321E4F0B500BEA6EB /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 9518382521E4F08300BEA6EB /* LaunchScreen.storyboard */; }; + 9518383721E4F31C00BEA6EB /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9518382321E4F08300BEA6EB /* ViewController.swift */; }; + 9518383821E4F31F00BEA6EB /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 9518382421E4F08300BEA6EB /* Assets.xcassets */; }; + 9518383921E4F32800BEA6EB /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9518382921E4F08300BEA6EB /* AppDelegate.swift */; }; 955E4FD421CBFB2800B4C3BB /* CarLensCollectionViewLayout.h in Headers */ = {isa = PBXBuildFile; fileRef = 955E4FD221CBFB2800B4C3BB /* CarLensCollectionViewLayout.h */; settings = {ATTRIBUTES = (Public, ); }; }; 958D17C021D66DF00067BED6 /* CarLensCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 958D17BF21D66DF00067BED6 /* CarLensCollectionViewCell.swift */; }; /* End PBXBuildFile section */ +/* Begin PBXContainerItemProxy section */ + 9518383521E4F16700BEA6EB /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 955E4FC621CBFB2800B4C3BB /* Project object */; + proxyType = 1; + remoteGlobalIDString = 955E4FCE21CBFB2800B4C3BB; + remoteInfo = CarLensCollectionViewLayout; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 9518382121E4F04400BEA6EB /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + 9518381E21E4F04400BEA6EB /* CarLensCollectionViewLayout.framework in Embed Frameworks */, + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + /* Begin PBXFileReference section */ 9505725D21D4D8FB009EA422 /* CarLensCollectionViewLayout.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CarLensCollectionViewLayout.swift; sourceTree = ""; }; 9505725F21D4D922009EA422 /* CarLensLayoutAttributes.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CarLensLayoutAttributes.swift; sourceTree = ""; }; + 9518380B21E4F00000BEA6EB /* CarLensCollectionViewDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = CarLensCollectionViewDemo.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 9518382321E4F08300BEA6EB /* ViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; + 9518382421E4F08300BEA6EB /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 9518382621E4F08300BEA6EB /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 9518382821E4F08300BEA6EB /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 9518382921E4F08300BEA6EB /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 9518382A21E4F08300BEA6EB /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 955E4FCF21CBFB2800B4C3BB /* CarLensCollectionViewLayout.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = CarLensCollectionViewLayout.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 955E4FD221CBFB2800B4C3BB /* CarLensCollectionViewLayout.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CarLensCollectionViewLayout.h; sourceTree = ""; }; 955E4FD321CBFB2800B4C3BB /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; @@ -23,6 +61,14 @@ /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ + 9518380821E4F00000BEA6EB /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 9518381D21E4F04400BEA6EB /* CarLensCollectionViewLayout.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 955E4FCC21CBFB2800B4C3BB /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; @@ -33,9 +79,23 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 9518382221E4F08300BEA6EB /* CarLensCollectionViewDemo */ = { + isa = PBXGroup; + children = ( + 9518382321E4F08300BEA6EB /* ViewController.swift */, + 9518382421E4F08300BEA6EB /* Assets.xcassets */, + 9518382521E4F08300BEA6EB /* LaunchScreen.storyboard */, + 9518382721E4F08300BEA6EB /* Main.storyboard */, + 9518382921E4F08300BEA6EB /* AppDelegate.swift */, + 9518382A21E4F08300BEA6EB /* Info.plist */, + ); + path = CarLensCollectionViewDemo; + sourceTree = ""; + }; 955E4FC521CBFB2800B4C3BB = { isa = PBXGroup; children = ( + 9518382221E4F08300BEA6EB /* CarLensCollectionViewDemo */, 955E4FD121CBFB2800B4C3BB /* CarLensCollectionViewLayout */, 955E4FD021CBFB2800B4C3BB /* Products */, ); @@ -45,6 +105,7 @@ isa = PBXGroup; children = ( 955E4FCF21CBFB2800B4C3BB /* CarLensCollectionViewLayout.framework */, + 9518380B21E4F00000BEA6EB /* CarLensCollectionViewDemo.app */, ); name = Products; sourceTree = ""; @@ -75,6 +136,25 @@ /* End PBXHeadersBuildPhase section */ /* Begin PBXNativeTarget section */ + 9518380A21E4F00000BEA6EB /* CarLensCollectionViewDemo */ = { + isa = PBXNativeTarget; + buildConfigurationList = 9518381A21E4F00200BEA6EB /* Build configuration list for PBXNativeTarget "CarLensCollectionViewDemo" */; + buildPhases = ( + 9518380721E4F00000BEA6EB /* Sources */, + 9518380821E4F00000BEA6EB /* Frameworks */, + 9518380921E4F00000BEA6EB /* Resources */, + 9518382121E4F04400BEA6EB /* Embed Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + 9518383621E4F16700BEA6EB /* PBXTargetDependency */, + ); + name = CarLensCollectionViewDemo; + productName = Example; + productReference = 9518380B21E4F00000BEA6EB /* CarLensCollectionViewDemo.app */; + productType = "com.apple.product-type.application"; + }; 955E4FCE21CBFB2800B4C3BB /* CarLensCollectionViewLayout */ = { isa = PBXNativeTarget; buildConfigurationList = 955E4FD721CBFB2800B4C3BB /* Build configuration list for PBXNativeTarget "CarLensCollectionViewLayout" */; @@ -99,9 +179,13 @@ 955E4FC621CBFB2800B4C3BB /* Project object */ = { isa = PBXProject; attributes = { + LastSwiftUpdateCheck = 1010; LastUpgradeCheck = 1010; ORGANIZATIONNAME = Netguru; TargetAttributes = { + 9518380A21E4F00000BEA6EB = { + CreatedOnToolsVersion = 10.1; + }; 955E4FCE21CBFB2800B4C3BB = { CreatedOnToolsVersion = 10.1; }; @@ -113,6 +197,7 @@ hasScannedForEncodings = 0; knownRegions = ( en, + Base, ); mainGroup = 955E4FC521CBFB2800B4C3BB; productRefGroup = 955E4FD021CBFB2800B4C3BB /* Products */; @@ -120,11 +205,22 @@ projectRoot = ""; targets = ( 955E4FCE21CBFB2800B4C3BB /* CarLensCollectionViewLayout */, + 9518380A21E4F00000BEA6EB /* CarLensCollectionViewDemo */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ + 9518380921E4F00000BEA6EB /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 9518383321E4F0B500BEA6EB /* LaunchScreen.storyboard in Resources */, + 9518383821E4F31F00BEA6EB /* Assets.xcassets in Resources */, + 9518383121E4F09900BEA6EB /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 955E4FCD21CBFB2800B4C3BB /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; @@ -135,6 +231,15 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ + 9518380721E4F00000BEA6EB /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 9518383921E4F32800BEA6EB /* AppDelegate.swift in Sources */, + 9518383721E4F31C00BEA6EB /* ViewController.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 955E4FCB21CBFB2800B4C3BB /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -147,7 +252,76 @@ }; /* End PBXSourcesBuildPhase section */ +/* Begin PBXTargetDependency section */ + 9518383621E4F16700BEA6EB /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 955E4FCE21CBFB2800B4C3BB /* CarLensCollectionViewLayout */; + targetProxy = 9518383521E4F16700BEA6EB /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 9518382521E4F08300BEA6EB /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 9518382621E4F08300BEA6EB /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; + 9518382721E4F08300BEA6EB /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 9518382821E4F08300BEA6EB /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + /* Begin XCBuildConfiguration section */ + 9518381B21E4F00200BEA6EB /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Manual; + DEVELOPMENT_TEAM = ""; + INFOPLIST_FILE = "$(SRCROOT)/CarLensCollectionViewDemo/Info.plist"; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = co.netguru.lib.CarLensCollectionViewLayoutDemo; + PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_VERSION = 4.2; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 9518381C21E4F00200BEA6EB /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Manual; + DEVELOPMENT_TEAM = ""; + INFOPLIST_FILE = "$(SRCROOT)/CarLensCollectionViewDemo/Info.plist"; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = co.netguru.lib.CarLensCollectionViewLayoutDemo; + PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_VERSION = 4.2; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; 955E4FD521CBFB2800B4C3BB /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { @@ -325,6 +499,15 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ + 9518381A21E4F00200BEA6EB /* Build configuration list for PBXNativeTarget "CarLensCollectionViewDemo" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 9518381B21E4F00200BEA6EB /* Debug */, + 9518381C21E4F00200BEA6EB /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; 955E4FC921CBFB2800B4C3BB /* Build configuration list for PBXProject "CarLensCollectionViewLayout" */ = { isa = XCConfigurationList; buildConfigurations = ( diff --git a/CarLensCollectionViewLayout.xcodeproj/xcshareddata/xcschemes/CarLensCollectionViewLayoutDemo.xcscheme b/CarLensCollectionViewLayout.xcodeproj/xcshareddata/xcschemes/CarLensCollectionViewLayoutDemo.xcscheme new file mode 100644 index 0000000..07de64d --- /dev/null +++ b/CarLensCollectionViewLayout.xcodeproj/xcshareddata/xcschemes/CarLensCollectionViewLayoutDemo.xcscheme @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 77c568153cfed174fc8d373897ee46f5e07bf8a8 Mon Sep 17 00:00:00 2001 From: Anna-Mariia Shkarlinska Date: Tue, 8 Jan 2019 17:54:14 +0100 Subject: [PATCH 32/44] Add initial implementation to the demo --- CarLensCollectionViewDemo/AppDelegate.swift | 27 ------------ .../Base.lproj/Main.storyboard | 42 +++++++++++++------ .../CollectionViewCell.swift | 36 ++++++++++++++++ .../CollectionViewController.swift | 38 +++++++++++++++++ .../ViewController.swift | 20 --------- .../project.pbxproj | 12 ++++-- 6 files changed, 112 insertions(+), 63 deletions(-) create mode 100644 CarLensCollectionViewDemo/CollectionViewCell.swift create mode 100644 CarLensCollectionViewDemo/CollectionViewController.swift delete mode 100644 CarLensCollectionViewDemo/ViewController.swift diff --git a/CarLensCollectionViewDemo/AppDelegate.swift b/CarLensCollectionViewDemo/AppDelegate.swift index 40938c8..82c73d5 100644 --- a/CarLensCollectionViewDemo/AppDelegate.swift +++ b/CarLensCollectionViewDemo/AppDelegate.swift @@ -13,34 +13,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? - func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { - // Override point for customization after application launch. return true } - - func applicationWillResignActive(_ application: UIApplication) { - // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. - // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. - } - - func applicationDidEnterBackground(_ application: UIApplication) { - // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. - // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. - } - - func applicationWillEnterForeground(_ application: UIApplication) { - // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. - } - - func applicationDidBecomeActive(_ application: UIApplication) { - // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. - } - - func applicationWillTerminate(_ application: UIApplication) { - // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. - } - - } - diff --git a/CarLensCollectionViewDemo/Base.lproj/Main.storyboard b/CarLensCollectionViewDemo/Base.lproj/Main.storyboard index f1bcf38..1268dd7 100644 --- a/CarLensCollectionViewDemo/Base.lproj/Main.storyboard +++ b/CarLensCollectionViewDemo/Base.lproj/Main.storyboard @@ -1,24 +1,42 @@ - + + + + - - + + - - + + - - + + - - - - - + + + + + + + + + + + + + + + + + + + + diff --git a/CarLensCollectionViewDemo/CollectionViewCell.swift b/CarLensCollectionViewDemo/CollectionViewCell.swift new file mode 100644 index 0000000..20c25bd --- /dev/null +++ b/CarLensCollectionViewDemo/CollectionViewCell.swift @@ -0,0 +1,36 @@ +// +// CollectionViewCell.swift +// CarLensCollectionViewDemo +// +// Created by Anna on 08/01/2019. +// Copyright © 2019 Netguru. All rights reserved. +// + +import Foundation +import CarLensCollectionViewLayout + +class CollectionViewCell: CarLensCollectionViewCell { + + var upperView: UIView = { + var view = UIView() + view.translatesAutoresizingMaskIntoConstraints = false + view.backgroundColor = UIColor.red + return view + }() + + var bottomView: UIView = { + var view = UIView() + view.translatesAutoresizingMaskIntoConstraints = false + view.backgroundColor = UIColor.blue + return view + }() + + override init(frame: CGRect) { + super.init(frame: frame) + configure(topView: upperView, cardView: bottomView) + } + + required init?(coder aDecoder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } +} diff --git a/CarLensCollectionViewDemo/CollectionViewController.swift b/CarLensCollectionViewDemo/CollectionViewController.swift new file mode 100644 index 0000000..52a5e9c --- /dev/null +++ b/CarLensCollectionViewDemo/CollectionViewController.swift @@ -0,0 +1,38 @@ +// +// ViewController.swift +// Example +// +// Created by Anna on 08/01/2019. +// Copyright © 2019 Netguru. All rights reserved. +// + +import UIKit +import CarLensCollectionViewLayout + +class CollectionViewController: UICollectionViewController { + + override func viewWillAppear(_ animated: Bool) { + super.viewWillAppear(animated) + collectionView.collectionViewLayout = CarLensCollectionViewLayout() + } + + override func viewDidLoad() { + super.viewDidLoad() + + collectionView.dataSource = self + collectionView.delegate = self + collectionView.register(CollectionViewCell.self, forCellWithReuseIdentifier: "CollectionViewCell") + } + + override func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { + return 5 + } + + override func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { + guard let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "CollectionViewCell", for: indexPath) as? CollectionViewCell else { + return UICollectionViewCell() + } + return cell + } +} + diff --git a/CarLensCollectionViewDemo/ViewController.swift b/CarLensCollectionViewDemo/ViewController.swift deleted file mode 100644 index 3bdae80..0000000 --- a/CarLensCollectionViewDemo/ViewController.swift +++ /dev/null @@ -1,20 +0,0 @@ -// -// ViewController.swift -// Example -// -// Created by Anna on 08/01/2019. -// Copyright © 2019 Netguru. All rights reserved. -// - -import UIKit - -class ViewController: UIViewController { - - override func viewDidLoad() { - super.viewDidLoad() - // Do any additional setup after loading the view, typically from a nib. - } - - -} - diff --git a/CarLensCollectionViewLayout.xcodeproj/project.pbxproj b/CarLensCollectionViewLayout.xcodeproj/project.pbxproj index 6eee5ac..a740385 100644 --- a/CarLensCollectionViewLayout.xcodeproj/project.pbxproj +++ b/CarLensCollectionViewLayout.xcodeproj/project.pbxproj @@ -13,9 +13,10 @@ 9518381E21E4F04400BEA6EB /* CarLensCollectionViewLayout.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 955E4FCF21CBFB2800B4C3BB /* CarLensCollectionViewLayout.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 9518383121E4F09900BEA6EB /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 9518382721E4F08300BEA6EB /* Main.storyboard */; }; 9518383321E4F0B500BEA6EB /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 9518382521E4F08300BEA6EB /* LaunchScreen.storyboard */; }; - 9518383721E4F31C00BEA6EB /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9518382321E4F08300BEA6EB /* ViewController.swift */; }; + 9518383721E4F31C00BEA6EB /* CollectionViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9518382321E4F08300BEA6EB /* CollectionViewController.swift */; }; 9518383821E4F31F00BEA6EB /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 9518382421E4F08300BEA6EB /* Assets.xcassets */; }; 9518383921E4F32800BEA6EB /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9518382921E4F08300BEA6EB /* AppDelegate.swift */; }; + 9518383C21E4FFCA00BEA6EB /* CollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9518383B21E4FFCA00BEA6EB /* CollectionViewCell.swift */; }; 955E4FD421CBFB2800B4C3BB /* CarLensCollectionViewLayout.h in Headers */ = {isa = PBXBuildFile; fileRef = 955E4FD221CBFB2800B4C3BB /* CarLensCollectionViewLayout.h */; settings = {ATTRIBUTES = (Public, ); }; }; 958D17C021D66DF00067BED6 /* CarLensCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 958D17BF21D66DF00067BED6 /* CarLensCollectionViewCell.swift */; }; /* End PBXBuildFile section */ @@ -48,12 +49,13 @@ 9505725D21D4D8FB009EA422 /* CarLensCollectionViewLayout.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CarLensCollectionViewLayout.swift; sourceTree = ""; }; 9505725F21D4D922009EA422 /* CarLensLayoutAttributes.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CarLensLayoutAttributes.swift; sourceTree = ""; }; 9518380B21E4F00000BEA6EB /* CarLensCollectionViewDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = CarLensCollectionViewDemo.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 9518382321E4F08300BEA6EB /* ViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; + 9518382321E4F08300BEA6EB /* CollectionViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CollectionViewController.swift; sourceTree = ""; }; 9518382421E4F08300BEA6EB /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 9518382621E4F08300BEA6EB /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 9518382821E4F08300BEA6EB /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 9518382921E4F08300BEA6EB /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 9518382A21E4F08300BEA6EB /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 9518383B21E4FFCA00BEA6EB /* CollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CollectionViewCell.swift; sourceTree = ""; }; 955E4FCF21CBFB2800B4C3BB /* CarLensCollectionViewLayout.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = CarLensCollectionViewLayout.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 955E4FD221CBFB2800B4C3BB /* CarLensCollectionViewLayout.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CarLensCollectionViewLayout.h; sourceTree = ""; }; 955E4FD321CBFB2800B4C3BB /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; @@ -82,7 +84,8 @@ 9518382221E4F08300BEA6EB /* CarLensCollectionViewDemo */ = { isa = PBXGroup; children = ( - 9518382321E4F08300BEA6EB /* ViewController.swift */, + 9518382321E4F08300BEA6EB /* CollectionViewController.swift */, + 9518383B21E4FFCA00BEA6EB /* CollectionViewCell.swift */, 9518382421E4F08300BEA6EB /* Assets.xcassets */, 9518382521E4F08300BEA6EB /* LaunchScreen.storyboard */, 9518382721E4F08300BEA6EB /* Main.storyboard */, @@ -236,7 +239,8 @@ buildActionMask = 2147483647; files = ( 9518383921E4F32800BEA6EB /* AppDelegate.swift in Sources */, - 9518383721E4F31C00BEA6EB /* ViewController.swift in Sources */, + 9518383721E4F31C00BEA6EB /* CollectionViewController.swift in Sources */, + 9518383C21E4FFCA00BEA6EB /* CollectionViewCell.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; From 49e414e47e60698332de750f17291923703e41c5 Mon Sep 17 00:00:00 2001 From: Anna-Mariia Shkarlinska Date: Tue, 8 Jan 2019 18:20:36 +0100 Subject: [PATCH 33/44] Update UI of the cell --- .../CollectionViewCell.swift | 18 +++++++++++------- .../CollectionViewController.swift | 9 +++++++-- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/CarLensCollectionViewDemo/CollectionViewCell.swift b/CarLensCollectionViewDemo/CollectionViewCell.swift index 20c25bd..1296ede 100644 --- a/CarLensCollectionViewDemo/CollectionViewCell.swift +++ b/CarLensCollectionViewDemo/CollectionViewCell.swift @@ -11,17 +11,21 @@ import CarLensCollectionViewLayout class CollectionViewCell: CarLensCollectionViewCell { - var upperView: UIView = { - var view = UIView() - view.translatesAutoresizingMaskIntoConstraints = false - view.backgroundColor = UIColor.red - return view + private var upperView: UILabel = { + var label = UILabel() + label.translatesAutoresizingMaskIntoConstraints = false + label.font = .boldSystemFont(ofSize: 60) + label.textAlignment = .center + label.textColor = .white + label.text = "CarLens" + return label }() - var bottomView: UIView = { + private var bottomView: UIView = { var view = UIView() view.translatesAutoresizingMaskIntoConstraints = false - view.backgroundColor = UIColor.blue + view.backgroundColor = .white + view.layer.cornerRadius = 10 return view }() diff --git a/CarLensCollectionViewDemo/CollectionViewController.swift b/CarLensCollectionViewDemo/CollectionViewController.swift index 52a5e9c..89f153e 100644 --- a/CarLensCollectionViewDemo/CollectionViewController.swift +++ b/CarLensCollectionViewDemo/CollectionViewController.swift @@ -18,10 +18,15 @@ class CollectionViewController: UICollectionViewController { override func viewDidLoad() { super.viewDidLoad() - + setupView() + } + + private func setupView() { collectionView.dataSource = self collectionView.delegate = self + collectionView.backgroundColor = .lightGray collectionView.register(CollectionViewCell.self, forCellWithReuseIdentifier: "CollectionViewCell") + collectionView.showsHorizontalScrollIndicator = false } override func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { @@ -34,5 +39,5 @@ class CollectionViewController: UICollectionViewController { } return cell } -} +} From 8f5d71a31146f0e0cade00393e4812d0c3200aab Mon Sep 17 00:00:00 2001 From: Anna-Mariia Shkarlinska Date: Tue, 8 Jan 2019 18:35:28 +0100 Subject: [PATCH 34/44] Update demo project structure --- .../AppIcon.appiconset/Contents.json | 0 .../Assets.xcassets/Contents.json | 0 .../Base.lproj/LaunchScreen.storyboard | 0 .../Base.lproj/Main.storyboard | 0 .../{ => Supporting files}/Info.plist | 0 .../project.pbxproj | 16 ++++++++++++---- 6 files changed, 12 insertions(+), 4 deletions(-) rename CarLensCollectionViewDemo/{ => Supporting files}/Assets.xcassets/AppIcon.appiconset/Contents.json (100%) rename CarLensCollectionViewDemo/{ => Supporting files}/Assets.xcassets/Contents.json (100%) rename CarLensCollectionViewDemo/{ => Supporting files}/Base.lproj/LaunchScreen.storyboard (100%) rename CarLensCollectionViewDemo/{ => Supporting files}/Base.lproj/Main.storyboard (100%) rename CarLensCollectionViewDemo/{ => Supporting files}/Info.plist (100%) diff --git a/CarLensCollectionViewDemo/Assets.xcassets/AppIcon.appiconset/Contents.json b/CarLensCollectionViewDemo/Supporting files/Assets.xcassets/AppIcon.appiconset/Contents.json similarity index 100% rename from CarLensCollectionViewDemo/Assets.xcassets/AppIcon.appiconset/Contents.json rename to CarLensCollectionViewDemo/Supporting files/Assets.xcassets/AppIcon.appiconset/Contents.json diff --git a/CarLensCollectionViewDemo/Assets.xcassets/Contents.json b/CarLensCollectionViewDemo/Supporting files/Assets.xcassets/Contents.json similarity index 100% rename from CarLensCollectionViewDemo/Assets.xcassets/Contents.json rename to CarLensCollectionViewDemo/Supporting files/Assets.xcassets/Contents.json diff --git a/CarLensCollectionViewDemo/Base.lproj/LaunchScreen.storyboard b/CarLensCollectionViewDemo/Supporting files/Base.lproj/LaunchScreen.storyboard similarity index 100% rename from CarLensCollectionViewDemo/Base.lproj/LaunchScreen.storyboard rename to CarLensCollectionViewDemo/Supporting files/Base.lproj/LaunchScreen.storyboard diff --git a/CarLensCollectionViewDemo/Base.lproj/Main.storyboard b/CarLensCollectionViewDemo/Supporting files/Base.lproj/Main.storyboard similarity index 100% rename from CarLensCollectionViewDemo/Base.lproj/Main.storyboard rename to CarLensCollectionViewDemo/Supporting files/Base.lproj/Main.storyboard diff --git a/CarLensCollectionViewDemo/Info.plist b/CarLensCollectionViewDemo/Supporting files/Info.plist similarity index 100% rename from CarLensCollectionViewDemo/Info.plist rename to CarLensCollectionViewDemo/Supporting files/Info.plist diff --git a/CarLensCollectionViewLayout.xcodeproj/project.pbxproj b/CarLensCollectionViewLayout.xcodeproj/project.pbxproj index a740385..3f618c5 100644 --- a/CarLensCollectionViewLayout.xcodeproj/project.pbxproj +++ b/CarLensCollectionViewLayout.xcodeproj/project.pbxproj @@ -84,15 +84,23 @@ 9518382221E4F08300BEA6EB /* CarLensCollectionViewDemo */ = { isa = PBXGroup; children = ( + 9518382921E4F08300BEA6EB /* AppDelegate.swift */, 9518382321E4F08300BEA6EB /* CollectionViewController.swift */, 9518383B21E4FFCA00BEA6EB /* CollectionViewCell.swift */, + 9518384121E5166100BEA6EB /* Supporting files */, + ); + path = CarLensCollectionViewDemo; + sourceTree = ""; + }; + 9518384121E5166100BEA6EB /* Supporting files */ = { + isa = PBXGroup; + children = ( 9518382421E4F08300BEA6EB /* Assets.xcassets */, 9518382521E4F08300BEA6EB /* LaunchScreen.storyboard */, 9518382721E4F08300BEA6EB /* Main.storyboard */, - 9518382921E4F08300BEA6EB /* AppDelegate.swift */, 9518382A21E4F08300BEA6EB /* Info.plist */, ); - path = CarLensCollectionViewDemo; + path = "Supporting files"; sourceTree = ""; }; 955E4FC521CBFB2800B4C3BB = { @@ -291,7 +299,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_STYLE = Manual; DEVELOPMENT_TEAM = ""; - INFOPLIST_FILE = "$(SRCROOT)/CarLensCollectionViewDemo/Info.plist"; + INFOPLIST_FILE = "$(SRCROOT)/CarLensCollectionViewDemo/Supporting Files/Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", @@ -312,7 +320,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_STYLE = Manual; DEVELOPMENT_TEAM = ""; - INFOPLIST_FILE = "$(SRCROOT)/CarLensCollectionViewDemo/Info.plist"; + INFOPLIST_FILE = "$(SRCROOT)/CarLensCollectionViewDemo/Supporting Files/Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", From 8b3ed1066b66bd975f967e8cb4b93e6437f6f7e4 Mon Sep 17 00:00:00 2001 From: Anna-Mariia Shkarlinska Date: Tue, 8 Jan 2019 18:51:27 +0100 Subject: [PATCH 35/44] Update bitrise.yml for demo build --- bitrise.yml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/bitrise.yml b/bitrise.yml index db6718a..5cebc3b 100644 --- a/bitrise.yml +++ b/bitrise.yml @@ -34,18 +34,28 @@ workflows: build: envs: - XCODEBUILD_SCHEME: CarLensCollectionViewLayout + - XCODEBUILD_SCHEME_DEMO: CarLensCollectionViewLayoutDemo before_run: - - build-scheme + - build-lib + - build-demo - cocoapods-test after_run: - deploy-artifacts - build-scheme: + build-lib: steps: - script: + title: build-lib inputs: - content: xcodebuild -project $XCODEBUILD_PROJECT -scheme $XCODEBUILD_SCHEME -destination 'platform=iOS Simulator,name=iPhone 7 Plus' + build-demo: + steps: + - script: + title: build-demo + inputs: + - content: xcodebuild -project $XCODEBUILD_PROJECT -scheme $XCODEBUILD_SCHEME_DEMO -destination 'platform=iOS Simulator,name=iPhone 7 Plus' + cocoapods-test: steps: - script: From 372be9bd0b673c4863e76a9bc202828f7270b3b0 Mon Sep 17 00:00:00 2001 From: Anna-Mariia Shkarlinska Date: Tue, 8 Jan 2019 19:20:29 +0100 Subject: [PATCH 36/44] Add identifier variable for a cell --- CarLensCollectionViewDemo/AppDelegate.swift | 2 +- CarLensCollectionViewDemo/CollectionViewCell.swift | 4 +++- .../CollectionViewController.swift | 10 ++++------ 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/CarLensCollectionViewDemo/AppDelegate.swift b/CarLensCollectionViewDemo/AppDelegate.swift index 82c73d5..faf2f8d 100644 --- a/CarLensCollectionViewDemo/AppDelegate.swift +++ b/CarLensCollectionViewDemo/AppDelegate.swift @@ -1,6 +1,6 @@ // // AppDelegate.swift -// Example +// CarLensCollectionViewDemo // // Created by Anna on 08/01/2019. // Copyright © 2019 Netguru. All rights reserved. diff --git a/CarLensCollectionViewDemo/CollectionViewCell.swift b/CarLensCollectionViewDemo/CollectionViewCell.swift index 1296ede..3e355ae 100644 --- a/CarLensCollectionViewDemo/CollectionViewCell.swift +++ b/CarLensCollectionViewDemo/CollectionViewCell.swift @@ -6,11 +6,13 @@ // Copyright © 2019 Netguru. All rights reserved. // -import Foundation +import UIKit import CarLensCollectionViewLayout class CollectionViewCell: CarLensCollectionViewCell { + static let identifier = "CollectionViewCell" + private var upperView: UILabel = { var label = UILabel() label.translatesAutoresizingMaskIntoConstraints = false diff --git a/CarLensCollectionViewDemo/CollectionViewController.swift b/CarLensCollectionViewDemo/CollectionViewController.swift index 89f153e..90246e8 100644 --- a/CarLensCollectionViewDemo/CollectionViewController.swift +++ b/CarLensCollectionViewDemo/CollectionViewController.swift @@ -1,6 +1,6 @@ // -// ViewController.swift -// Example +// CollectionViewController.swift +// CarLensCollectionViewDemo // // Created by Anna on 08/01/2019. // Copyright © 2019 Netguru. All rights reserved. @@ -22,10 +22,8 @@ class CollectionViewController: UICollectionViewController { } private func setupView() { - collectionView.dataSource = self - collectionView.delegate = self collectionView.backgroundColor = .lightGray - collectionView.register(CollectionViewCell.self, forCellWithReuseIdentifier: "CollectionViewCell") + collectionView.register(CollectionViewCell.self, forCellWithReuseIdentifier: CollectionViewCell.identifier) collectionView.showsHorizontalScrollIndicator = false } @@ -34,7 +32,7 @@ class CollectionViewController: UICollectionViewController { } override func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { - guard let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "CollectionViewCell", for: indexPath) as? CollectionViewCell else { + guard let cell = collectionView.dequeueReusableCell(withReuseIdentifier: CollectionViewCell.identifier, for: indexPath) as? CollectionViewCell else { return UICollectionViewCell() } return cell From f6a8f7ed4b4e5e878565e1b561268b21f8a076eb Mon Sep 17 00:00:00 2001 From: Anna-Mariia Shkarlinska Date: Wed, 9 Jan 2019 12:36:14 +0100 Subject: [PATCH 37/44] Remove viewDidAppear method implementation --- CarLensCollectionViewDemo/CollectionViewController.swift | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/CarLensCollectionViewDemo/CollectionViewController.swift b/CarLensCollectionViewDemo/CollectionViewController.swift index 90246e8..5946403 100644 --- a/CarLensCollectionViewDemo/CollectionViewController.swift +++ b/CarLensCollectionViewDemo/CollectionViewController.swift @@ -11,11 +11,6 @@ import CarLensCollectionViewLayout class CollectionViewController: UICollectionViewController { - override func viewWillAppear(_ animated: Bool) { - super.viewWillAppear(animated) - collectionView.collectionViewLayout = CarLensCollectionViewLayout() - } - override func viewDidLoad() { super.viewDidLoad() setupView() @@ -25,6 +20,7 @@ class CollectionViewController: UICollectionViewController { collectionView.backgroundColor = .lightGray collectionView.register(CollectionViewCell.self, forCellWithReuseIdentifier: CollectionViewCell.identifier) collectionView.showsHorizontalScrollIndicator = false + collectionView.collectionViewLayout = CarLensCollectionViewLayout() } override func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { From 180ad550b8d322309f10c9e15c5803ecb84a3411 Mon Sep 17 00:00:00 2001 From: Anna-Mariia Shkarlinska Date: Wed, 9 Jan 2019 12:38:48 +0100 Subject: [PATCH 38/44] Fix a demo project target name --- .../project.pbxproj | 26 +++++++++---------- .../CarLensCollectionViewLayoutDemo.xcscheme | 16 ++++++------ .../AppDelegate.swift | 0 .../CollectionViewCell.swift | 0 .../CollectionViewController.swift | 0 .../AppIcon.appiconset/Contents.json | 0 .../Assets.xcassets/Contents.json | 0 .../Base.lproj/LaunchScreen.storyboard | 0 .../Base.lproj/Main.storyboard | 2 +- .../Supporting files/Info.plist | 0 10 files changed, 22 insertions(+), 22 deletions(-) rename {CarLensCollectionViewDemo => CarLensCollectionViewLayoutDemo}/AppDelegate.swift (100%) rename {CarLensCollectionViewDemo => CarLensCollectionViewLayoutDemo}/CollectionViewCell.swift (100%) rename {CarLensCollectionViewDemo => CarLensCollectionViewLayoutDemo}/CollectionViewController.swift (100%) rename {CarLensCollectionViewDemo => CarLensCollectionViewLayoutDemo}/Supporting files/Assets.xcassets/AppIcon.appiconset/Contents.json (100%) rename {CarLensCollectionViewDemo => CarLensCollectionViewLayoutDemo}/Supporting files/Assets.xcassets/Contents.json (100%) rename {CarLensCollectionViewDemo => CarLensCollectionViewLayoutDemo}/Supporting files/Base.lproj/LaunchScreen.storyboard (100%) rename {CarLensCollectionViewDemo => CarLensCollectionViewLayoutDemo}/Supporting files/Base.lproj/Main.storyboard (98%) rename {CarLensCollectionViewDemo => CarLensCollectionViewLayoutDemo}/Supporting files/Info.plist (100%) diff --git a/CarLensCollectionViewLayout.xcodeproj/project.pbxproj b/CarLensCollectionViewLayout.xcodeproj/project.pbxproj index 3f618c5..1d6cc6b 100644 --- a/CarLensCollectionViewLayout.xcodeproj/project.pbxproj +++ b/CarLensCollectionViewLayout.xcodeproj/project.pbxproj @@ -48,7 +48,7 @@ /* Begin PBXFileReference section */ 9505725D21D4D8FB009EA422 /* CarLensCollectionViewLayout.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CarLensCollectionViewLayout.swift; sourceTree = ""; }; 9505725F21D4D922009EA422 /* CarLensLayoutAttributes.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CarLensLayoutAttributes.swift; sourceTree = ""; }; - 9518380B21E4F00000BEA6EB /* CarLensCollectionViewDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = CarLensCollectionViewDemo.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 9518380B21E4F00000BEA6EB /* CarLensCollectionViewLayoutDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = CarLensCollectionViewLayoutDemo.app; sourceTree = BUILT_PRODUCTS_DIR; }; 9518382321E4F08300BEA6EB /* CollectionViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CollectionViewController.swift; sourceTree = ""; }; 9518382421E4F08300BEA6EB /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 9518382621E4F08300BEA6EB /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; @@ -81,7 +81,7 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - 9518382221E4F08300BEA6EB /* CarLensCollectionViewDemo */ = { + 9518382221E4F08300BEA6EB /* CarLensCollectionViewLayoutDemo */ = { isa = PBXGroup; children = ( 9518382921E4F08300BEA6EB /* AppDelegate.swift */, @@ -89,7 +89,7 @@ 9518383B21E4FFCA00BEA6EB /* CollectionViewCell.swift */, 9518384121E5166100BEA6EB /* Supporting files */, ); - path = CarLensCollectionViewDemo; + path = CarLensCollectionViewLayoutDemo; sourceTree = ""; }; 9518384121E5166100BEA6EB /* Supporting files */ = { @@ -106,7 +106,7 @@ 955E4FC521CBFB2800B4C3BB = { isa = PBXGroup; children = ( - 9518382221E4F08300BEA6EB /* CarLensCollectionViewDemo */, + 9518382221E4F08300BEA6EB /* CarLensCollectionViewLayoutDemo */, 955E4FD121CBFB2800B4C3BB /* CarLensCollectionViewLayout */, 955E4FD021CBFB2800B4C3BB /* Products */, ); @@ -116,7 +116,7 @@ isa = PBXGroup; children = ( 955E4FCF21CBFB2800B4C3BB /* CarLensCollectionViewLayout.framework */, - 9518380B21E4F00000BEA6EB /* CarLensCollectionViewDemo.app */, + 9518380B21E4F00000BEA6EB /* CarLensCollectionViewLayoutDemo.app */, ); name = Products; sourceTree = ""; @@ -147,9 +147,9 @@ /* End PBXHeadersBuildPhase section */ /* Begin PBXNativeTarget section */ - 9518380A21E4F00000BEA6EB /* CarLensCollectionViewDemo */ = { + 9518380A21E4F00000BEA6EB /* CarLensCollectionViewLayoutDemo */ = { isa = PBXNativeTarget; - buildConfigurationList = 9518381A21E4F00200BEA6EB /* Build configuration list for PBXNativeTarget "CarLensCollectionViewDemo" */; + buildConfigurationList = 9518381A21E4F00200BEA6EB /* Build configuration list for PBXNativeTarget "CarLensCollectionViewLayoutDemo" */; buildPhases = ( 9518380721E4F00000BEA6EB /* Sources */, 9518380821E4F00000BEA6EB /* Frameworks */, @@ -161,9 +161,9 @@ dependencies = ( 9518383621E4F16700BEA6EB /* PBXTargetDependency */, ); - name = CarLensCollectionViewDemo; + name = CarLensCollectionViewLayoutDemo; productName = Example; - productReference = 9518380B21E4F00000BEA6EB /* CarLensCollectionViewDemo.app */; + productReference = 9518380B21E4F00000BEA6EB /* CarLensCollectionViewLayoutDemo.app */; productType = "com.apple.product-type.application"; }; 955E4FCE21CBFB2800B4C3BB /* CarLensCollectionViewLayout */ = { @@ -216,7 +216,7 @@ projectRoot = ""; targets = ( 955E4FCE21CBFB2800B4C3BB /* CarLensCollectionViewLayout */, - 9518380A21E4F00000BEA6EB /* CarLensCollectionViewDemo */, + 9518380A21E4F00000BEA6EB /* CarLensCollectionViewLayoutDemo */, ); }; /* End PBXProject section */ @@ -299,7 +299,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_STYLE = Manual; DEVELOPMENT_TEAM = ""; - INFOPLIST_FILE = "$(SRCROOT)/CarLensCollectionViewDemo/Supporting Files/Info.plist"; + INFOPLIST_FILE = "$(SRCROOT)/CarLensCollectionViewLayoutDemo/Supporting Files/Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", @@ -320,7 +320,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_STYLE = Manual; DEVELOPMENT_TEAM = ""; - INFOPLIST_FILE = "$(SRCROOT)/CarLensCollectionViewDemo/Supporting Files/Info.plist"; + INFOPLIST_FILE = "$(SRCROOT)/CarLensCollectionViewLayoutDemo/Supporting Files/Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", @@ -511,7 +511,7 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ - 9518381A21E4F00200BEA6EB /* Build configuration list for PBXNativeTarget "CarLensCollectionViewDemo" */ = { + 9518381A21E4F00200BEA6EB /* Build configuration list for PBXNativeTarget "CarLensCollectionViewLayoutDemo" */ = { isa = XCConfigurationList; buildConfigurations = ( 9518381B21E4F00200BEA6EB /* Debug */, diff --git a/CarLensCollectionViewLayout.xcodeproj/xcshareddata/xcschemes/CarLensCollectionViewLayoutDemo.xcscheme b/CarLensCollectionViewLayout.xcodeproj/xcshareddata/xcschemes/CarLensCollectionViewLayoutDemo.xcscheme index 07de64d..76b6a74 100644 --- a/CarLensCollectionViewLayout.xcodeproj/xcshareddata/xcschemes/CarLensCollectionViewLayoutDemo.xcscheme +++ b/CarLensCollectionViewLayout.xcodeproj/xcshareddata/xcschemes/CarLensCollectionViewLayoutDemo.xcscheme @@ -15,8 +15,8 @@ @@ -33,8 +33,8 @@ @@ -56,8 +56,8 @@ @@ -75,8 +75,8 @@ diff --git a/CarLensCollectionViewDemo/AppDelegate.swift b/CarLensCollectionViewLayoutDemo/AppDelegate.swift similarity index 100% rename from CarLensCollectionViewDemo/AppDelegate.swift rename to CarLensCollectionViewLayoutDemo/AppDelegate.swift diff --git a/CarLensCollectionViewDemo/CollectionViewCell.swift b/CarLensCollectionViewLayoutDemo/CollectionViewCell.swift similarity index 100% rename from CarLensCollectionViewDemo/CollectionViewCell.swift rename to CarLensCollectionViewLayoutDemo/CollectionViewCell.swift diff --git a/CarLensCollectionViewDemo/CollectionViewController.swift b/CarLensCollectionViewLayoutDemo/CollectionViewController.swift similarity index 100% rename from CarLensCollectionViewDemo/CollectionViewController.swift rename to CarLensCollectionViewLayoutDemo/CollectionViewController.swift diff --git a/CarLensCollectionViewDemo/Supporting files/Assets.xcassets/AppIcon.appiconset/Contents.json b/CarLensCollectionViewLayoutDemo/Supporting files/Assets.xcassets/AppIcon.appiconset/Contents.json similarity index 100% rename from CarLensCollectionViewDemo/Supporting files/Assets.xcassets/AppIcon.appiconset/Contents.json rename to CarLensCollectionViewLayoutDemo/Supporting files/Assets.xcassets/AppIcon.appiconset/Contents.json diff --git a/CarLensCollectionViewDemo/Supporting files/Assets.xcassets/Contents.json b/CarLensCollectionViewLayoutDemo/Supporting files/Assets.xcassets/Contents.json similarity index 100% rename from CarLensCollectionViewDemo/Supporting files/Assets.xcassets/Contents.json rename to CarLensCollectionViewLayoutDemo/Supporting files/Assets.xcassets/Contents.json diff --git a/CarLensCollectionViewDemo/Supporting files/Base.lproj/LaunchScreen.storyboard b/CarLensCollectionViewLayoutDemo/Supporting files/Base.lproj/LaunchScreen.storyboard similarity index 100% rename from CarLensCollectionViewDemo/Supporting files/Base.lproj/LaunchScreen.storyboard rename to CarLensCollectionViewLayoutDemo/Supporting files/Base.lproj/LaunchScreen.storyboard diff --git a/CarLensCollectionViewDemo/Supporting files/Base.lproj/Main.storyboard b/CarLensCollectionViewLayoutDemo/Supporting files/Base.lproj/Main.storyboard similarity index 98% rename from CarLensCollectionViewDemo/Supporting files/Base.lproj/Main.storyboard rename to CarLensCollectionViewLayoutDemo/Supporting files/Base.lproj/Main.storyboard index 1268dd7..03e55f6 100644 --- a/CarLensCollectionViewDemo/Supporting files/Base.lproj/Main.storyboard +++ b/CarLensCollectionViewLayoutDemo/Supporting files/Base.lproj/Main.storyboard @@ -19,7 +19,7 @@ - + diff --git a/CarLensCollectionViewDemo/Supporting files/Info.plist b/CarLensCollectionViewLayoutDemo/Supporting files/Info.plist similarity index 100% rename from CarLensCollectionViewDemo/Supporting files/Info.plist rename to CarLensCollectionViewLayoutDemo/Supporting files/Info.plist From 1e7cb178f84203ddb68bf4662104a590e7849d89 Mon Sep 17 00:00:00 2001 From: Anna-Mariia Shkarlinska Date: Wed, 9 Jan 2019 12:53:58 +0100 Subject: [PATCH 39/44] Update README.md Usage section --- README.md | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index a3d292e..2abf47b 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ An easy to use Collection View Layout for card-like animation 🎉 That's what you can do with **CarLensCollectionViewLayout**:

- +

*CarLensCollectionViewLayout* was created out of the implementation in [**CarLens** application 🚘](https://github.com/netguru/car-recognition-ios). The image above exactly shows the screen from the app! @@ -23,20 +23,27 @@ That's what you can do with **CarLensCollectionViewLayout**: The two main steps are needed for the configuration of *CarLensCollectionViewLayout*: ### Step 1 -Assign `CarLensCollectionViewLayout` to yours collection view layout. +Assign `CarLensCollectionViewLayout` to yours collection view layout: ```swift collectionView.collectionViewLayout = CarLensCollectionViewLayout() ``` +or initialize your collection view with `CarLensCollectionViewLayout`: +```swift +UICollectionView(frame: .zero, collectionViewLayout: CarLensCollectionViewLayout()) +``` + ### Step 2 Subsclass `CarLensCollectionViewCell` and call `configure(topView: UIView, cardView: UIView)` right on the start! ```swift -class CarListCollectionViewCell: CarLensCollectionViewCell { - override init(frame: CGRect) { - super.init(frame: frame) - configure(topView: upperView, cardView: bottomView) - } +class CollectionViewCell: CarLensCollectionViewCell { + override init(frame: CGRect) { + super.init(frame: frame) + configure(topView: upperView, cardView: bottomView) + } } ``` +The sample implementation is available in [Demo](CarLensCollectionViewDemo) project. + ## Installation ### CocoaPods From 6bad93ab6b80a3777434a8be3850fc377adee3cc Mon Sep 17 00:00:00 2001 From: Anna-Mariia Shkarlinska Date: Wed, 9 Jan 2019 15:35:51 +0100 Subject: [PATCH 40/44] Add Carthage step to README.md --- README.md | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2abf47b..4abc13d 100644 --- a/README.md +++ b/README.md @@ -2,11 +2,11 @@ ![](https://img.shields.io/badge/swift-4.2-orange.svg) ![](https://img.shields.io/badge/cocoapods-compatible-green.svg) +![](https://img.shields.io/badge/carthage-compatible-green.svg) ![](https://app.bitrise.io/app/23a07b63b3f55f97/status.svg?token=Rt_2gKUavbR8LQ7PVuTbYg&branch=master) An easy to use Collection View Layout for card-like animation 🎉 -That's what you can do with **CarLensCollectionViewLayout**:

@@ -51,7 +51,16 @@ The sample implementation is available in [Demo](CarLensCollectionViewDemo) proj If you're using [CocoaPods](http://cocoapods.org), add the following dependency to your `Podfile`: ```none -pod 'CarLensCollectionViewLayout' +use_frameworks! +pod 'CarLensCollectionViewLayout', '~> 1.0.0' +``` + +### Carthage + +If you're using [Carthage](https://github.com/Carthage/Carthage), add the following dependency to your `Cartfile`: + +```none +github "netguru/CarLensCollectionViewLayout" ~> 1.0.0 ``` ## About From 75be655f99e916b6e1a468e121bf2778ef53fc78 Mon Sep 17 00:00:00 2001 From: Anna-Mariia Shkarlinska Date: Wed, 9 Jan 2019 15:56:12 +0100 Subject: [PATCH 41/44] Update Podspec due to repo name change --- CarLensCollectionViewLayout.podspec | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CarLensCollectionViewLayout.podspec b/CarLensCollectionViewLayout.podspec index 750386c..4eee107 100644 --- a/CarLensCollectionViewLayout.podspec +++ b/CarLensCollectionViewLayout.podspec @@ -4,14 +4,14 @@ Pod::Spec.new do |s| s.version = "1.0.0" s.summary = "An easy to use Collection View Layout for card-like animation." - s.homepage = "https://github.com/netguru/CarlensCollectionViewLayout" + s.homepage = "https://github.com/netguru/CarLensCollectionViewLayout" s.license = { :type => "MIT", :file => "LICENSE.md" } s.authors = { "Anna-Mariia Shkarlinska" => "anna-mariia.shkarlinska@netguru.co", "Michał Kwiecień" => "michal.kwiecien@netguru.co" } s.platform = :ios, "9.0" - s.source = { :git => "https://github.com/netguru/CarlensCollectionViewLayout.git", :tag => "#{s.version}" } - s.source_files = "CarlensCollectionViewLayout/**/*.swift" + s.source = { :git => "https://github.com/netguru/CarLensCollectionViewLayout.git", :tag => "#{s.version}" } + s.source_files = "CarLensCollectionViewLayout/**/*.swift" s.swift_version = "4.2" s.framework = "UIKit" From f5e432c165a835244d25be40ba93b8f5bfb60dc3 Mon Sep 17 00:00:00 2001 From: Anna-Mariia Shkarlinska Date: Wed, 9 Jan 2019 15:59:17 +0100 Subject: [PATCH 42/44] Remove PR template Template removed due to future potential open source contributors --- PULL_REQUEST_TEMPLATE.md | 9 --------- 1 file changed, 9 deletions(-) delete mode 100644 PULL_REQUEST_TEMPLATE.md diff --git a/PULL_REQUEST_TEMPLATE.md b/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index 5e8a07c..0000000 --- a/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,9 +0,0 @@ -### Ticket -[CRAI-](https://netguru.atlassian.net/browse/CRAI-) - -### Task Description - - - -### Aditional Notes (optional) - From d36413ddab7253e39286af1989499c1ec9dd8a22 Mon Sep 17 00:00:00 2001 From: Anna-Mariia Shkarlinska Date: Wed, 9 Jan 2019 16:03:45 +0100 Subject: [PATCH 43/44] Update access level order --- CarLensCollectionViewLayout/CarLensCollectionViewCell.swift | 2 +- CarLensCollectionViewLayout/CarLensCollectionViewLayout.swift | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CarLensCollectionViewLayout/CarLensCollectionViewCell.swift b/CarLensCollectionViewLayout/CarLensCollectionViewCell.swift index 351a754..bdd86e0 100644 --- a/CarLensCollectionViewLayout/CarLensCollectionViewCell.swift +++ b/CarLensCollectionViewLayout/CarLensCollectionViewCell.swift @@ -52,7 +52,7 @@ open class CarLensCollectionViewCell: UICollectionViewCell { } /// - SeeAlso: UICollectionViewCell - override open func apply(_ layoutAttributes: UICollectionViewLayoutAttributes) { + open override func apply(_ layoutAttributes: UICollectionViewLayoutAttributes) { super.apply(layoutAttributes) guard let attributes = layoutAttributes as? CarLensLayoutAttributes else { return } isCurrentlyPrimary = !(attributes.progress == 0) diff --git a/CarLensCollectionViewLayout/CarLensCollectionViewLayout.swift b/CarLensCollectionViewLayout/CarLensCollectionViewLayout.swift index 8ccaacc..c8eb235 100644 --- a/CarLensCollectionViewLayout/CarLensCollectionViewLayout.swift +++ b/CarLensCollectionViewLayout/CarLensCollectionViewLayout.swift @@ -35,7 +35,7 @@ public final class CarLensCollectionViewLayout: UICollectionViewFlowLayout { } /// SeeAlso: UICollectionViewFlowLayout - override public class var layoutAttributesClass: AnyClass { + public override class var layoutAttributesClass: AnyClass { return CarLensLayoutAttributes.self } From 19c9e663f76ff09c54e2cb876396027bc53b7e21 Mon Sep 17 00:00:00 2001 From: Anna-Mariia Shkarlinska Date: Thu, 10 Jan 2019 15:33:05 +0100 Subject: [PATCH 44/44] Remove author's name from the documentation --- CarLensCollectionViewLayout/CarLensCollectionViewLayout.h | 1 - CarLensCollectionViewLayoutDemo/AppDelegate.swift | 1 - CarLensCollectionViewLayoutDemo/CollectionViewCell.swift | 1 - CarLensCollectionViewLayoutDemo/CollectionViewController.swift | 1 - 4 files changed, 4 deletions(-) diff --git a/CarLensCollectionViewLayout/CarLensCollectionViewLayout.h b/CarLensCollectionViewLayout/CarLensCollectionViewLayout.h index d01fbe4..5bbe189 100644 --- a/CarLensCollectionViewLayout/CarLensCollectionViewLayout.h +++ b/CarLensCollectionViewLayout/CarLensCollectionViewLayout.h @@ -2,7 +2,6 @@ // CarLensCollectionViewLayout.h // CarLensCollectionViewLayout // -// Created by Anna on 20/12/2018. // Copyright © 2018 Netguru. All rights reserved. // diff --git a/CarLensCollectionViewLayoutDemo/AppDelegate.swift b/CarLensCollectionViewLayoutDemo/AppDelegate.swift index faf2f8d..3096be2 100644 --- a/CarLensCollectionViewLayoutDemo/AppDelegate.swift +++ b/CarLensCollectionViewLayoutDemo/AppDelegate.swift @@ -2,7 +2,6 @@ // AppDelegate.swift // CarLensCollectionViewDemo // -// Created by Anna on 08/01/2019. // Copyright © 2019 Netguru. All rights reserved. // diff --git a/CarLensCollectionViewLayoutDemo/CollectionViewCell.swift b/CarLensCollectionViewLayoutDemo/CollectionViewCell.swift index 3e355ae..57fad91 100644 --- a/CarLensCollectionViewLayoutDemo/CollectionViewCell.swift +++ b/CarLensCollectionViewLayoutDemo/CollectionViewCell.swift @@ -2,7 +2,6 @@ // CollectionViewCell.swift // CarLensCollectionViewDemo // -// Created by Anna on 08/01/2019. // Copyright © 2019 Netguru. All rights reserved. // diff --git a/CarLensCollectionViewLayoutDemo/CollectionViewController.swift b/CarLensCollectionViewLayoutDemo/CollectionViewController.swift index 5946403..f6e4fd6 100644 --- a/CarLensCollectionViewLayoutDemo/CollectionViewController.swift +++ b/CarLensCollectionViewLayoutDemo/CollectionViewController.swift @@ -2,7 +2,6 @@ // CollectionViewController.swift // CarLensCollectionViewDemo // -// Created by Anna on 08/01/2019. // Copyright © 2019 Netguru. All rights reserved. //