diff --git a/Examples/Hero/Hero.h b/Examples/Hero/Hero.h new file mode 100644 index 00000000..819ea992 --- /dev/null +++ b/Examples/Hero/Hero.h @@ -0,0 +1,19 @@ +// +// Hero.h +// Hero +// +// Created by YiLun Zhao on 2017-01-03. +// Copyright © 2017 Luke Zhao. All rights reserved. +// + +#import + +//! Project version number for Hero. +FOUNDATION_EXPORT double HeroVersionNumber; + +//! Project version string for Hero. +FOUNDATION_EXPORT const unsigned char HeroVersionString[]; + +// In this header, you should import all the public headers of your framework using statements like #import + + diff --git a/Examples/Hero/Info.plist b/Examples/Hero/Info.plist new file mode 100644 index 00000000..db8ba7b3 --- /dev/null +++ b/Examples/Hero/Info.plist @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + FMWK + CFBundleShortVersionString + 0.1.0 + CFBundleVersion + $(CURRENT_PROJECT_VERSION) + NSPrincipalClass + + + diff --git a/Examples/HeroExamples.xcodeproj/project.pbxproj b/Examples/HeroExamples.xcodeproj/project.pbxproj index 9eb311fc..fcf8d66a 100644 --- a/Examples/HeroExamples.xcodeproj/project.pbxproj +++ b/Examples/HeroExamples.xcodeproj/project.pbxproj @@ -10,6 +10,32 @@ 83043017B73BC66DBB920D5C /* Pods_HeroExamples.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EEE340F89FF0A49DD23A5A6E /* Pods_HeroExamples.framework */; }; A304BF841DF2717900A03345 /* ImageViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A304BF831DF2717900A03345 /* ImageViewController.swift */; }; A304BF8A1DF647FC00A03345 /* ImageCells.swift in Sources */ = {isa = PBXBuildFile; fileRef = A304BF891DF647FC00A03345 /* ImageCells.swift */; }; + A306D3B61E1C7A2E00B6C23A /* Hero.h in Headers */ = {isa = PBXBuildFile; fileRef = A306D3B41E1C7A2E00B6C23A /* Hero.h */; settings = {ATTRIBUTES = (Public, ); }; }; + A306D3B91E1C7A2E00B6C23A /* Hero.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A306D3B21E1C7A2E00B6C23A /* Hero.framework */; }; + A306D3BB1E1C7A2E00B6C23A /* Hero.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = A306D3B21E1C7A2E00B6C23A /* Hero.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + A306D3D21E1C7A3C00B6C23A /* CALayer+Hero.swift in Sources */ = {isa = PBXBuildFile; fileRef = A306D3BF1E1C7A3C00B6C23A /* CALayer+Hero.swift */; }; + A306D3D31E1C7A3C00B6C23A /* CAMediaTimingFunction+Hero.swift in Sources */ = {isa = PBXBuildFile; fileRef = A306D3C01E1C7A3C00B6C23A /* CAMediaTimingFunction+Hero.swift */; }; + A306D3D41E1C7A3C00B6C23A /* CascadePreprocessor.swift in Sources */ = {isa = PBXBuildFile; fileRef = A306D3C11E1C7A3C00B6C23A /* CascadePreprocessor.swift */; }; + A306D3D51E1C7A3C00B6C23A /* CG+Hero.swift in Sources */ = {isa = PBXBuildFile; fileRef = A306D3C21E1C7A3C00B6C23A /* CG+Hero.swift */; }; + A306D3D61E1C7A3C00B6C23A /* IgnoreSubviewModifiersPreprocessor.swift in Sources */ = {isa = PBXBuildFile; fileRef = A306D3C31E1C7A3C00B6C23A /* IgnoreSubviewModifiersPreprocessor.swift */; }; + A306D3D71E1C7A3C00B6C23A /* DispatchQueue+Hero.swift in Sources */ = {isa = PBXBuildFile; fileRef = A306D3C41E1C7A3C00B6C23A /* DispatchQueue+Hero.swift */; }; + A306D3D81E1C7A3C00B6C23A /* Hero.swift in Sources */ = {isa = PBXBuildFile; fileRef = A306D3C51E1C7A3C00B6C23A /* Hero.swift */; }; + A306D3D91E1C7A3C00B6C23A /* HeroContext.swift in Sources */ = {isa = PBXBuildFile; fileRef = A306D3C61E1C7A3C00B6C23A /* HeroContext.swift */; }; + A306D3DA1E1C7A3C00B6C23A /* HeroDebugPlugin.swift in Sources */ = {isa = PBXBuildFile; fileRef = A306D3C71E1C7A3C00B6C23A /* HeroDebugPlugin.swift */; }; + A306D3DB1E1C7A3C00B6C23A /* HeroDebugView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A306D3C81E1C7A3C00B6C23A /* HeroDebugView.swift */; }; + A306D3DC1E1C7A3C00B6C23A /* HeroDefaultAnimator.swift in Sources */ = {isa = PBXBuildFile; fileRef = A306D3C91E1C7A3C00B6C23A /* HeroDefaultAnimator.swift */; }; + A306D3DD1E1C7A3C00B6C23A /* HeroDefaultAnimatorViewContext.swift in Sources */ = {isa = PBXBuildFile; fileRef = A306D3CA1E1C7A3C00B6C23A /* HeroDefaultAnimatorViewContext.swift */; }; + A306D3DF1E1C7A3C00B6C23A /* HeroPlugin.swift in Sources */ = {isa = PBXBuildFile; fileRef = A306D3CC1E1C7A3C00B6C23A /* HeroPlugin.swift */; }; + A306D3E01E1C7A3C00B6C23A /* HeroTypes.swift in Sources */ = {isa = PBXBuildFile; fileRef = A306D3CD1E1C7A3C00B6C23A /* HeroTypes.swift */; }; + A306D3E11E1C7A3C00B6C23A /* SourcePreprocessor.swift in Sources */ = {isa = PBXBuildFile; fileRef = A306D3CE1E1C7A3C00B6C23A /* SourcePreprocessor.swift */; }; + A306D3E21E1C7A3C00B6C23A /* UIKit+Hero.swift in Sources */ = {isa = PBXBuildFile; fileRef = A306D3CF1E1C7A3C00B6C23A /* UIKit+Hero.swift */; }; + A306D3E31E1C7A3C00B6C23A /* Array+HeroModifier.swift in Sources */ = {isa = PBXBuildFile; fileRef = A306D3D01E1C7A3C00B6C23A /* Array+HeroModifier.swift */; }; + A306D3E41E1C7A3C00B6C23A /* MatchPreprocessor.swift in Sources */ = {isa = PBXBuildFile; fileRef = A306D3D11E1C7A3C00B6C23A /* MatchPreprocessor.swift */; }; + A306D3E51E1C7A5A00B6C23A /* CG+Hero.swift in Sources */ = {isa = PBXBuildFile; fileRef = A306D3C21E1C7A3C00B6C23A /* CG+Hero.swift */; }; + A306D3E71E1C7A6E00B6C23A /* DispatchQueue+Hero.swift in Sources */ = {isa = PBXBuildFile; fileRef = A306D3C41E1C7A3C00B6C23A /* DispatchQueue+Hero.swift */; }; + A306D3F61E1D7A1A00B6C23A /* LiveInjection2ViewControllers.swift in Sources */ = {isa = PBXBuildFile; fileRef = A306D3F51E1D7A1A00B6C23A /* LiveInjection2ViewControllers.swift */; }; + A306D3FB1E1D7A7200B6C23A /* LiveInjection.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A306D3F91E1D7A7200B6C23A /* LiveInjection.storyboard */; }; + A313499B1E1E2AED00EB5139 /* ImageLibrary.swift in Sources */ = {isa = PBXBuildFile; fileRef = A313499A1E1E2AED00EB5139 /* ImageLibrary.swift */; }; A33E60A51DE761C90065CBD8 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = A33E60A41DE761C90065CBD8 /* AppDelegate.swift */; }; A33E60AA1DE761C90065CBD8 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A33E60A81DE761C90065CBD8 /* Main.storyboard */; }; A33E60AC1DE761C90065CBD8 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = A33E60AB1DE761C90065CBD8 /* Assets.xcassets */; }; @@ -20,17 +46,77 @@ A33E60C01DE7621C0065CBD8 /* CityGuideViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A33E60BB1DE7621C0065CBD8 /* CityGuideViewController.swift */; }; A33E60C11DE7621C0065CBD8 /* CityViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A33E60BC1DE7621C0065CBD8 /* CityViewController.swift */; }; A3499D9F1DF2024E0049B541 /* ImageGalleryCollectionViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A3499D9E1DF2024E0049B541 /* ImageGalleryCollectionViewController.swift */; }; + A35949131E1A29800095F407 /* Basic.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A35949111E1A29800095F407 /* Basic.storyboard */; }; + A35949161E1A2A6A0095F407 /* MusicPlayer.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A35949141E1A2A6A0095F407 /* MusicPlayer.storyboard */; }; + A35949181E1A2BE60095F407 /* InitialViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A35949171E1A2BE60095F407 /* InitialViewController.swift */; }; + A359491B1E1A31E20095F407 /* Menu.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A35949191E1A31E20095F407 /* Menu.storyboard */; }; + A359491E1E1A325A0095F407 /* CityGuide.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A359491C1E1A325A0095F407 /* CityGuide.storyboard */; }; + A35949211E1A32C50095F407 /* ImageGallery.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A359491F1E1A32C50095F407 /* ImageGallery.storyboard */; }; + A35949241E1A36D00095F407 /* ImageViewer.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A35949221E1A36D00095F407 /* ImageViewer.storyboard */; }; + A35949271E1A384E0095F407 /* ListToGrid.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A35949251E1A384E0095F407 /* ListToGrid.storyboard */; }; + A359492A1E1A39B30095F407 /* Debug.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A35949281E1A39B30095F407 /* Debug.storyboard */; }; + A359492D1E1A39D00095F407 /* LabelTransform.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A359492B1E1A39D00095F407 /* LabelTransform.storyboard */; }; + A39400B61E1D8749005E5454 /* LiveInjection1ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A39400B51E1D8749005E5454 /* LiveInjection1ViewController.swift */; }; + A3FEFAAA1E1F1F1F00A9F150 /* HeroModifier.swift in Sources */ = {isa = PBXBuildFile; fileRef = A3FEFAA91E1F1F1F00A9F150 /* HeroModifier.swift */; }; + A3FEFAAC1E1F353E00A9F150 /* HeroTargetState.swift in Sources */ = {isa = PBXBuildFile; fileRef = A3FEFAAB1E1F353E00A9F150 /* HeroTargetState.swift */; }; B10FDD451E00DD9800B7B66E /* DebugViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = B10FDD441E00DD9800B7B66E /* DebugViewController.swift */; }; - B15C85D51DF75E8F00586E64 /* CG+HeroExamples.swift in Sources */ = {isa = PBXBuildFile; fileRef = B15C85D41DF75E8F00586E64 /* CG+HeroExamples.swift */; }; B185A4E61DFA6E0C00C3B85D /* ListTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = B185A4E51DFA6E0C00C3B85D /* ListTableViewController.swift */; }; B185A4E81DFA6FE200C3B85D /* GridCollectionViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = B185A4E71DFA6FE200C3B85D /* GridCollectionViewController.swift */; }; B195F5771DFE516F00B1343C /* LabelTransformViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = B195F5761DFE516F00B1343C /* LabelTransformViewController.swift */; }; /* End PBXBuildFile section */ +/* Begin PBXContainerItemProxy section */ + A306D3B71E1C7A2E00B6C23A /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = A33E60991DE761C90065CBD8 /* Project object */; + proxyType = 1; + remoteGlobalIDString = A306D3B11E1C7A2E00B6C23A; + remoteInfo = Hero; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXCopyFilesBuildPhase section */ + A306D3BA1E1C7A2E00B6C23A /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + A306D3BB1E1C7A2E00B6C23A /* Hero.framework in Embed Frameworks */, + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + /* Begin PBXFileReference section */ 5CD4F09A588E81DA75C2BE38 /* Pods-HeroExamples.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-HeroExamples.debug.xcconfig"; path = "Pods/Target Support Files/Pods-HeroExamples/Pods-HeroExamples.debug.xcconfig"; sourceTree = ""; }; A304BF831DF2717900A03345 /* ImageViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = ImageViewController.swift; path = ImageGallery/ImageViewController.swift; sourceTree = ""; }; A304BF891DF647FC00A03345 /* ImageCells.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = ImageCells.swift; path = ImageGallery/ImageCells.swift; sourceTree = ""; }; + A306D3B21E1C7A2E00B6C23A /* Hero.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Hero.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + A306D3B41E1C7A2E00B6C23A /* Hero.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Hero.h; sourceTree = ""; }; + A306D3B51E1C7A2E00B6C23A /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + A306D3BF1E1C7A3C00B6C23A /* CALayer+Hero.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "CALayer+Hero.swift"; path = "../../Hero/CALayer+Hero.swift"; sourceTree = ""; }; + A306D3C01E1C7A3C00B6C23A /* CAMediaTimingFunction+Hero.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "CAMediaTimingFunction+Hero.swift"; path = "../../Hero/CAMediaTimingFunction+Hero.swift"; sourceTree = ""; }; + A306D3C11E1C7A3C00B6C23A /* CascadePreprocessor.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = CascadePreprocessor.swift; path = ../../Hero/CascadePreprocessor.swift; sourceTree = ""; }; + A306D3C21E1C7A3C00B6C23A /* CG+Hero.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "CG+Hero.swift"; path = "../../Hero/CG+Hero.swift"; sourceTree = ""; }; + A306D3C31E1C7A3C00B6C23A /* IgnoreSubviewModifiersPreprocessor.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = IgnoreSubviewModifiersPreprocessor.swift; path = ../../Hero/IgnoreSubviewModifiersPreprocessor.swift; sourceTree = ""; }; + A306D3C41E1C7A3C00B6C23A /* DispatchQueue+Hero.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "DispatchQueue+Hero.swift"; path = "../../Hero/DispatchQueue+Hero.swift"; sourceTree = ""; }; + A306D3C51E1C7A3C00B6C23A /* Hero.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Hero.swift; path = ../../Hero/Hero.swift; sourceTree = ""; }; + A306D3C61E1C7A3C00B6C23A /* HeroContext.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; name = HeroContext.swift; path = ../../Hero/HeroContext.swift; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.swift; }; + A306D3C71E1C7A3C00B6C23A /* HeroDebugPlugin.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = HeroDebugPlugin.swift; path = ../../Hero/HeroDebugPlugin.swift; sourceTree = ""; }; + A306D3C81E1C7A3C00B6C23A /* HeroDebugView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = HeroDebugView.swift; path = ../../Hero/HeroDebugView.swift; sourceTree = ""; }; + A306D3C91E1C7A3C00B6C23A /* HeroDefaultAnimator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = HeroDefaultAnimator.swift; path = ../../Hero/HeroDefaultAnimator.swift; sourceTree = ""; }; + A306D3CA1E1C7A3C00B6C23A /* HeroDefaultAnimatorViewContext.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = HeroDefaultAnimatorViewContext.swift; path = ../../Hero/HeroDefaultAnimatorViewContext.swift; sourceTree = ""; }; + A306D3CC1E1C7A3C00B6C23A /* HeroPlugin.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = HeroPlugin.swift; path = ../../Hero/HeroPlugin.swift; sourceTree = ""; }; + A306D3CD1E1C7A3C00B6C23A /* HeroTypes.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = HeroTypes.swift; path = ../../Hero/HeroTypes.swift; sourceTree = ""; }; + A306D3CE1E1C7A3C00B6C23A /* SourcePreprocessor.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = SourcePreprocessor.swift; path = ../../Hero/SourcePreprocessor.swift; sourceTree = ""; }; + A306D3CF1E1C7A3C00B6C23A /* UIKit+Hero.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; name = "UIKit+Hero.swift"; path = "../../Hero/UIKit+Hero.swift"; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.swift; }; + A306D3D01E1C7A3C00B6C23A /* Array+HeroModifier.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "Array+HeroModifier.swift"; path = "../../Hero/Array+HeroModifier.swift"; sourceTree = ""; }; + A306D3D11E1C7A3C00B6C23A /* MatchPreprocessor.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = MatchPreprocessor.swift; path = ../../Hero/MatchPreprocessor.swift; sourceTree = ""; }; + A306D3F51E1D7A1A00B6C23A /* LiveInjection2ViewControllers.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = LiveInjection2ViewControllers.swift; path = LiveInjection/LiveInjection2ViewControllers.swift; sourceTree = ""; }; + A306D3FA1E1D7A7200B6C23A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = HeroExamples/Base.lproj/LiveInjection.storyboard; sourceTree = SOURCE_ROOT; }; + A313499A1E1E2AED00EB5139 /* ImageLibrary.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = ImageLibrary.swift; path = ImageGallery/ImageLibrary.swift; sourceTree = ""; }; A33E60A11DE761C90065CBD8 /* HeroExamples.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = HeroExamples.app; sourceTree = BUILT_PRODUCTS_DIR; }; A33E60A41DE761C90065CBD8 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; A33E60A91DE761C90065CBD8 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; @@ -43,8 +129,20 @@ A33E60BB1DE7621C0065CBD8 /* CityGuideViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CityGuideViewController.swift; sourceTree = ""; }; A33E60BC1DE7621C0065CBD8 /* CityViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CityViewController.swift; sourceTree = ""; }; A3499D9E1DF2024E0049B541 /* ImageGalleryCollectionViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = ImageGalleryCollectionViewController.swift; path = ImageGallery/ImageGalleryCollectionViewController.swift; sourceTree = ""; }; + A35949121E1A29800095F407 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Basic.storyboard; sourceTree = ""; }; + A35949151E1A2A6A0095F407 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = HeroExamples/Base.lproj/MusicPlayer.storyboard; sourceTree = SOURCE_ROOT; }; + A35949171E1A2BE60095F407 /* InitialViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = InitialViewController.swift; sourceTree = ""; }; + A359491A1E1A31E20095F407 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = HeroExamples/Base.lproj/Menu.storyboard; sourceTree = SOURCE_ROOT; }; + A359491D1E1A325A0095F407 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = HeroExamples/Base.lproj/CityGuide.storyboard; sourceTree = SOURCE_ROOT; }; + A35949201E1A32C50095F407 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = HeroExamples/Base.lproj/ImageGallery.storyboard; sourceTree = SOURCE_ROOT; }; + A35949231E1A36D00095F407 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/ImageViewer.storyboard; sourceTree = ""; }; + A35949261E1A384E0095F407 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = HeroExamples/Base.lproj/ListToGrid.storyboard; sourceTree = SOURCE_ROOT; }; + A35949291E1A39B30095F407 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Debug.storyboard; sourceTree = ""; }; + A359492C1E1A39D00095F407 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LabelTransform.storyboard; sourceTree = ""; }; + A39400B51E1D8749005E5454 /* LiveInjection1ViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = LiveInjection1ViewController.swift; path = LiveInjection/LiveInjection1ViewController.swift; sourceTree = ""; }; + A3FEFAA91E1F1F1F00A9F150 /* HeroModifier.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = HeroModifier.swift; path = ../../Hero/HeroModifier.swift; sourceTree = ""; }; + A3FEFAAB1E1F353E00A9F150 /* HeroTargetState.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = HeroTargetState.swift; path = ../../Hero/HeroTargetState.swift; sourceTree = ""; }; B10FDD441E00DD9800B7B66E /* DebugViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = DebugViewController.swift; path = Debug/DebugViewController.swift; sourceTree = ""; }; - B15C85D41DF75E8F00586E64 /* CG+HeroExamples.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "CG+HeroExamples.swift"; sourceTree = ""; }; B185A4E51DFA6E0C00C3B85D /* ListTableViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = ListTableViewController.swift; path = ListToGrid/ListTableViewController.swift; sourceTree = ""; }; B185A4E71DFA6FE200C3B85D /* GridCollectionViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = GridCollectionViewController.swift; path = ListToGrid/GridCollectionViewController.swift; sourceTree = ""; }; B195F5761DFE516F00B1343C /* LabelTransformViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = LabelTransformViewController.swift; path = LabelTransform/LabelTransformViewController.swift; sourceTree = ""; }; @@ -53,10 +151,18 @@ /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ + A306D3AE1E1C7A2E00B6C23A /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; A33E609E1DE761C90065CBD8 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + A306D3B91E1C7A2E00B6C23A /* Hero.framework in Frameworks */, 83043017B73BC66DBB920D5C /* Pods_HeroExamples.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; @@ -81,10 +187,82 @@ name = Pods; sourceTree = ""; }; + A306D3B31E1C7A2E00B6C23A /* Hero */ = { + isa = PBXGroup; + children = ( + A306D3C51E1C7A3C00B6C23A /* Hero.swift */, + A306D3C61E1C7A3C00B6C23A /* HeroContext.swift */, + A306D3CC1E1C7A3C00B6C23A /* HeroPlugin.swift */, + A306D3CD1E1C7A3C00B6C23A /* HeroTypes.swift */, + A3FEFAA91E1F1F1F00A9F150 /* HeroModifier.swift */, + A3FEFAAB1E1F353E00A9F150 /* HeroTargetState.swift */, + A306D3EA1E1C7A9100B6C23A /* Animator */, + A306D3E91E1C7A8700B6C23A /* DebugPlugin */, + A306D3E81E1C7A7D00B6C23A /* Preprocessors */, + A306D3E61E1C7A6800B6C23A /* Extensions */, + A306D3B41E1C7A2E00B6C23A /* Hero.h */, + A306D3B51E1C7A2E00B6C23A /* Info.plist */, + ); + path = Hero; + sourceTree = ""; + }; + A306D3E61E1C7A6800B6C23A /* Extensions */ = { + isa = PBXGroup; + children = ( + A306D3BF1E1C7A3C00B6C23A /* CALayer+Hero.swift */, + A306D3C01E1C7A3C00B6C23A /* CAMediaTimingFunction+Hero.swift */, + A306D3C41E1C7A3C00B6C23A /* DispatchQueue+Hero.swift */, + A306D3CF1E1C7A3C00B6C23A /* UIKit+Hero.swift */, + A306D3D01E1C7A3C00B6C23A /* Array+HeroModifier.swift */, + A306D3C21E1C7A3C00B6C23A /* CG+Hero.swift */, + ); + name = Extensions; + sourceTree = ""; + }; + A306D3E81E1C7A7D00B6C23A /* Preprocessors */ = { + isa = PBXGroup; + children = ( + A306D3C11E1C7A3C00B6C23A /* CascadePreprocessor.swift */, + A306D3C31E1C7A3C00B6C23A /* IgnoreSubviewModifiersPreprocessor.swift */, + A306D3CE1E1C7A3C00B6C23A /* SourcePreprocessor.swift */, + A306D3D11E1C7A3C00B6C23A /* MatchPreprocessor.swift */, + ); + name = Preprocessors; + sourceTree = ""; + }; + A306D3E91E1C7A8700B6C23A /* DebugPlugin */ = { + isa = PBXGroup; + children = ( + A306D3C71E1C7A3C00B6C23A /* HeroDebugPlugin.swift */, + A306D3C81E1C7A3C00B6C23A /* HeroDebugView.swift */, + ); + name = DebugPlugin; + sourceTree = ""; + }; + A306D3EA1E1C7A9100B6C23A /* Animator */ = { + isa = PBXGroup; + children = ( + A306D3C91E1C7A3C00B6C23A /* HeroDefaultAnimator.swift */, + A306D3CA1E1C7A3C00B6C23A /* HeroDefaultAnimatorViewContext.swift */, + ); + name = Animator; + sourceTree = ""; + }; + A306D3FC1E1D82AB00B6C23A /* LiveInjection */ = { + isa = PBXGroup; + children = ( + A306D3F91E1D7A7200B6C23A /* LiveInjection.storyboard */, + A39400B51E1D8749005E5454 /* LiveInjection1ViewController.swift */, + A306D3F51E1D7A1A00B6C23A /* LiveInjection2ViewControllers.swift */, + ); + name = LiveInjection; + sourceTree = ""; + }; A33E60981DE761C90065CBD8 = { isa = PBXGroup; children = ( A33E60A31DE761C90065CBD8 /* HeroExamples */, + A306D3B31E1C7A2E00B6C23A /* Hero */, A33E60A21DE761C90065CBD8 /* Products */, 46383DC6A22A87056E5B40EC /* Pods */, 0ED3C727BC790F37EE7BD698 /* Frameworks */, @@ -95,6 +273,7 @@ isa = PBXGroup; children = ( A33E60A11DE761C90065CBD8 /* HeroExamples.app */, + A306D3B21E1C7A2E00B6C23A /* Hero.framework */, ); name = Products; sourceTree = ""; @@ -103,6 +282,7 @@ isa = PBXGroup; children = ( A33E60A81DE761C90065CBD8 /* Main.storyboard */, + A35949171E1A2BE60095F407 /* InitialViewController.swift */, A33E60B71DE7621C0065CBD8 /* Examples */, A33E60C21DE76CEF0065CBD8 /* Resources */, ); @@ -112,10 +292,13 @@ A33E60B71DE7621C0065CBD8 /* Examples */ = { isa = PBXGroup; children = ( + A35949111E1A29800095F407 /* Basic.storyboard */, + A35949141E1A2A6A0095F407 /* MusicPlayer.storyboard */, + A35949191E1A31E20095F407 /* Menu.storyboard */, + A33E60B81DE7621C0065CBD8 /* CityGuide */, B185A4E91DFA6FE700C3B85D /* ListToGrid */, A3499D9D1DF202350049B541 /* ImageGallery */, - A33E60C31DE76D000065CBD8 /* MusicPlayer */, - A33E60B81DE7621C0065CBD8 /* CityGuide */, + A306D3FC1E1D82AB00B6C23A /* LiveInjection */, B10FDD461E00DD9D00B7B66E /* Debug */, B195F5781DFE517500B1343C /* LabelTransform */, ); @@ -125,6 +308,7 @@ A33E60B81DE7621C0065CBD8 /* CityGuide */ = { isa = PBXGroup; children = ( + A359491C1E1A325A0095F407 /* CityGuide.storyboard */, A33E60B91DE7621C0065CBD8 /* City.swift */, A33E60BA1DE7621C0065CBD8 /* CityGuideCell.swift */, A33E60BB1DE7621C0065CBD8 /* CityGuideViewController.swift */, @@ -138,7 +322,6 @@ children = ( A33E60A41DE761C90065CBD8 /* AppDelegate.swift */, A33E60B61DE7621C0065CBD8 /* UIKit+HeroExamples.swift */, - B15C85D41DF75E8F00586E64 /* CG+HeroExamples.swift */, A33E60AB1DE761C90065CBD8 /* Assets.xcassets */, A33E60AD1DE761C90065CBD8 /* LaunchScreen.storyboard */, A33E60B01DE761C90065CBD8 /* Info.plist */, @@ -146,18 +329,14 @@ name = Resources; sourceTree = ""; }; - A33E60C31DE76D000065CBD8 /* MusicPlayer */ = { - isa = PBXGroup; - children = ( - ); - name = MusicPlayer; - sourceTree = ""; - }; A3499D9D1DF202350049B541 /* ImageGallery */ = { isa = PBXGroup; children = ( + A359491F1E1A32C50095F407 /* ImageGallery.storyboard */, + A35949221E1A36D00095F407 /* ImageViewer.storyboard */, A3499D9E1DF2024E0049B541 /* ImageGalleryCollectionViewController.swift */, A304BF831DF2717900A03345 /* ImageViewController.swift */, + A313499A1E1E2AED00EB5139 /* ImageLibrary.swift */, A304BF891DF647FC00A03345 /* ImageCells.swift */, ); name = ImageGallery; @@ -166,6 +345,7 @@ B10FDD461E00DD9D00B7B66E /* Debug */ = { isa = PBXGroup; children = ( + A35949281E1A39B30095F407 /* Debug.storyboard */, B10FDD441E00DD9800B7B66E /* DebugViewController.swift */, ); name = Debug; @@ -174,6 +354,7 @@ B185A4E91DFA6FE700C3B85D /* ListToGrid */ = { isa = PBXGroup; children = ( + A35949251E1A384E0095F407 /* ListToGrid.storyboard */, B185A4E51DFA6E0C00C3B85D /* ListTableViewController.swift */, B185A4E71DFA6FE200C3B85D /* GridCollectionViewController.swift */, ); @@ -183,6 +364,7 @@ B195F5781DFE517500B1343C /* LabelTransform */ = { isa = PBXGroup; children = ( + A359492B1E1A39D00095F407 /* LabelTransform.storyboard */, B195F5761DFE516F00B1343C /* LabelTransformViewController.swift */, ); name = LabelTransform; @@ -190,7 +372,36 @@ }; /* End PBXGroup section */ +/* Begin PBXHeadersBuildPhase section */ + A306D3AF1E1C7A2E00B6C23A /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + A306D3B61E1C7A2E00B6C23A /* Hero.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + /* Begin PBXNativeTarget section */ + A306D3B11E1C7A2E00B6C23A /* Hero */ = { + isa = PBXNativeTarget; + buildConfigurationList = A306D3BE1E1C7A2E00B6C23A /* Build configuration list for PBXNativeTarget "Hero" */; + buildPhases = ( + A306D3AD1E1C7A2E00B6C23A /* Sources */, + A306D3AE1E1C7A2E00B6C23A /* Frameworks */, + A306D3AF1E1C7A2E00B6C23A /* Headers */, + A306D3B01E1C7A2E00B6C23A /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Hero; + productName = Hero; + productReference = A306D3B21E1C7A2E00B6C23A /* Hero.framework */; + productType = "com.apple.product-type.framework"; + }; A33E60A01DE761C90065CBD8 /* HeroExamples */ = { isa = PBXNativeTarget; buildConfigurationList = A33E60B31DE761C90065CBD8 /* Build configuration list for PBXNativeTarget "HeroExamples" */; @@ -201,10 +412,12 @@ A33E609F1DE761C90065CBD8 /* Resources */, 23B031AF37B3297143AE7376 /* [CP] Embed Pods Frameworks */, B60F2CF0B495F2D785FF29A1 /* [CP] Copy Pods Resources */, + A306D3BA1E1C7A2E00B6C23A /* Embed Frameworks */, ); buildRules = ( ); dependencies = ( + A306D3B81E1C7A2E00B6C23A /* PBXTargetDependency */, ); name = HeroExamples; productName = HeroExamples; @@ -218,9 +431,15 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0800; - LastUpgradeCheck = 0810; + LastUpgradeCheck = 0820; ORGANIZATIONNAME = "Luke Zhao"; TargetAttributes = { + A306D3B11E1C7A2E00B6C23A = { + CreatedOnToolsVersion = 8.2.1; + DevelopmentTeam = 4VSEW78TKT; + LastSwiftMigration = 0820; + ProvisioningStyle = Automatic; + }; A33E60A01DE761C90065CBD8 = { CreatedOnToolsVersion = 8.0; DevelopmentTeam = 4VSEW78TKT; @@ -242,18 +461,36 @@ projectRoot = ""; targets = ( A33E60A01DE761C90065CBD8 /* HeroExamples */, + A306D3B11E1C7A2E00B6C23A /* Hero */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ + A306D3B01E1C7A2E00B6C23A /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; A33E609F1DE761C90065CBD8 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( + A359491B1E1A31E20095F407 /* Menu.storyboard in Resources */, + A35949271E1A384E0095F407 /* ListToGrid.storyboard in Resources */, + A35949211E1A32C50095F407 /* ImageGallery.storyboard in Resources */, + A359491E1E1A325A0095F407 /* CityGuide.storyboard in Resources */, A33E60AF1DE761C90065CBD8 /* LaunchScreen.storyboard in Resources */, + A359492A1E1A39B30095F407 /* Debug.storyboard in Resources */, A33E60AC1DE761C90065CBD8 /* Assets.xcassets in Resources */, + A35949241E1A36D00095F407 /* ImageViewer.storyboard in Resources */, A33E60AA1DE761C90065CBD8 /* Main.storyboard in Resources */, + A306D3FB1E1D7A7200B6C23A /* LiveInjection.storyboard in Resources */, + A35949131E1A29800095F407 /* Basic.storyboard in Resources */, + A35949161E1A2A6A0095F407 /* MusicPlayer.storyboard in Resources */, + A359492D1E1A39D00095F407 /* LabelTransform.storyboard in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -308,30 +545,78 @@ /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ + A306D3AD1E1C7A2E00B6C23A /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + A306D3DC1E1C7A3C00B6C23A /* HeroDefaultAnimator.swift in Sources */, + A306D3DB1E1C7A3C00B6C23A /* HeroDebugView.swift in Sources */, + A306D3DF1E1C7A3C00B6C23A /* HeroPlugin.swift in Sources */, + A306D3E41E1C7A3C00B6C23A /* MatchPreprocessor.swift in Sources */, + A306D3D41E1C7A3C00B6C23A /* CascadePreprocessor.swift in Sources */, + A306D3D31E1C7A3C00B6C23A /* CAMediaTimingFunction+Hero.swift in Sources */, + A306D3E21E1C7A3C00B6C23A /* UIKit+Hero.swift in Sources */, + A306D3D21E1C7A3C00B6C23A /* CALayer+Hero.swift in Sources */, + A306D3E01E1C7A3C00B6C23A /* HeroTypes.swift in Sources */, + A3FEFAAC1E1F353E00A9F150 /* HeroTargetState.swift in Sources */, + A306D3DD1E1C7A3C00B6C23A /* HeroDefaultAnimatorViewContext.swift in Sources */, + A306D3D51E1C7A3C00B6C23A /* CG+Hero.swift in Sources */, + A306D3E11E1C7A3C00B6C23A /* SourcePreprocessor.swift in Sources */, + A306D3D81E1C7A3C00B6C23A /* Hero.swift in Sources */, + A306D3E31E1C7A3C00B6C23A /* Array+HeroModifier.swift in Sources */, + A306D3D61E1C7A3C00B6C23A /* IgnoreSubviewModifiersPreprocessor.swift in Sources */, + A306D3D71E1C7A3C00B6C23A /* DispatchQueue+Hero.swift in Sources */, + A306D3DA1E1C7A3C00B6C23A /* HeroDebugPlugin.swift in Sources */, + A3FEFAAA1E1F1F1F00A9F150 /* HeroModifier.swift in Sources */, + A306D3D91E1C7A3C00B6C23A /* HeroContext.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; A33E609D1DE761C90065CBD8 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + A35949181E1A2BE60095F407 /* InitialViewController.swift in Sources */, + A306D3E71E1C7A6E00B6C23A /* DispatchQueue+Hero.swift in Sources */, A33E60C01DE7621C0065CBD8 /* CityGuideViewController.swift in Sources */, A33E60BD1DE7621C0065CBD8 /* UIKit+HeroExamples.swift in Sources */, A3499D9F1DF2024E0049B541 /* ImageGalleryCollectionViewController.swift in Sources */, - B15C85D51DF75E8F00586E64 /* CG+HeroExamples.swift in Sources */, A33E60BF1DE7621C0065CBD8 /* CityGuideCell.swift in Sources */, A33E60A51DE761C90065CBD8 /* AppDelegate.swift in Sources */, A33E60BE1DE7621C0065CBD8 /* City.swift in Sources */, A304BF841DF2717900A03345 /* ImageViewController.swift in Sources */, + A306D3F61E1D7A1A00B6C23A /* LiveInjection2ViewControllers.swift in Sources */, + A306D3E51E1C7A5A00B6C23A /* CG+Hero.swift in Sources */, B10FDD451E00DD9800B7B66E /* DebugViewController.swift in Sources */, B195F5771DFE516F00B1343C /* LabelTransformViewController.swift in Sources */, B185A4E61DFA6E0C00C3B85D /* ListTableViewController.swift in Sources */, + A39400B61E1D8749005E5454 /* LiveInjection1ViewController.swift in Sources */, A33E60C11DE7621C0065CBD8 /* CityViewController.swift in Sources */, B185A4E81DFA6FE200C3B85D /* GridCollectionViewController.swift in Sources */, A304BF8A1DF647FC00A03345 /* ImageCells.swift in Sources */, + A313499B1E1E2AED00EB5139 /* ImageLibrary.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ +/* Begin PBXTargetDependency section */ + A306D3B81E1C7A2E00B6C23A /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = A306D3B11E1C7A2E00B6C23A /* Hero */; + targetProxy = A306D3B71E1C7A2E00B6C23A /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + /* Begin PBXVariantGroup section */ + A306D3F91E1D7A7200B6C23A /* LiveInjection.storyboard */ = { + isa = PBXVariantGroup; + children = ( + A306D3FA1E1D7A7200B6C23A /* Base */, + ); + name = LiveInjection.storyboard; + sourceTree = ""; + }; A33E60A81DE761C90065CBD8 /* Main.storyboard */ = { isa = PBXVariantGroup; children = ( @@ -348,9 +633,137 @@ name = LaunchScreen.storyboard; sourceTree = ""; }; + A35949111E1A29800095F407 /* Basic.storyboard */ = { + isa = PBXVariantGroup; + children = ( + A35949121E1A29800095F407 /* Base */, + ); + name = Basic.storyboard; + path = ..; + sourceTree = ""; + }; + A35949141E1A2A6A0095F407 /* MusicPlayer.storyboard */ = { + isa = PBXVariantGroup; + children = ( + A35949151E1A2A6A0095F407 /* Base */, + ); + name = MusicPlayer.storyboard; + sourceTree = ""; + }; + A35949191E1A31E20095F407 /* Menu.storyboard */ = { + isa = PBXVariantGroup; + children = ( + A359491A1E1A31E20095F407 /* Base */, + ); + name = Menu.storyboard; + sourceTree = ""; + }; + A359491C1E1A325A0095F407 /* CityGuide.storyboard */ = { + isa = PBXVariantGroup; + children = ( + A359491D1E1A325A0095F407 /* Base */, + ); + name = CityGuide.storyboard; + path = ..; + sourceTree = ""; + }; + A359491F1E1A32C50095F407 /* ImageGallery.storyboard */ = { + isa = PBXVariantGroup; + children = ( + A35949201E1A32C50095F407 /* Base */, + ); + name = ImageGallery.storyboard; + sourceTree = ""; + }; + A35949221E1A36D00095F407 /* ImageViewer.storyboard */ = { + isa = PBXVariantGroup; + children = ( + A35949231E1A36D00095F407 /* Base */, + ); + name = ImageViewer.storyboard; + path = ..; + sourceTree = ""; + }; + A35949251E1A384E0095F407 /* ListToGrid.storyboard */ = { + isa = PBXVariantGroup; + children = ( + A35949261E1A384E0095F407 /* Base */, + ); + name = ListToGrid.storyboard; + sourceTree = ""; + }; + A35949281E1A39B30095F407 /* Debug.storyboard */ = { + isa = PBXVariantGroup; + children = ( + A35949291E1A39B30095F407 /* Base */, + ); + name = Debug.storyboard; + path = ..; + sourceTree = ""; + }; + A359492B1E1A39D00095F407 /* LabelTransform.storyboard */ = { + isa = PBXVariantGroup; + children = ( + A359492C1E1A39D00095F407 /* Base */, + ); + name = LabelTransform.storyboard; + path = ..; + sourceTree = ""; + }; /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ + A306D3BC1E1C7A2E00B6C23A /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_IDENTITY = ""; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DEVELOPMENT_TEAM = 4VSEW78TKT; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + INFOPLIST_FILE = Hero/Info.plist; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.lkzhao.Hero; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 3.0; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; + A306D3BD1E1C7A2E00B6C23A /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_IDENTITY = ""; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DEVELOPMENT_TEAM = 4VSEW78TKT; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + INFOPLIST_FILE = Hero/Info.plist; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.lkzhao.Hero; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + SWIFT_VERSION = 3.0; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; A33E60B11DE761C90065CBD8 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { @@ -448,7 +861,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 5CD4F09A588E81DA75C2BE38 /* Pods-HeroExamples.debug.xcconfig */; buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = "$(inherited)"; + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; DEVELOPMENT_TEAM = 4VSEW78TKT; INFOPLIST_FILE = HeroExamples/Info.plist; @@ -465,7 +878,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = C377744CBFF1E24426E80F55 /* Pods-HeroExamples.release.xcconfig */; buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = "$(inherited)"; + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; DEVELOPMENT_TEAM = 4VSEW78TKT; INFOPLIST_FILE = HeroExamples/Info.plist; @@ -481,6 +894,15 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ + A306D3BE1E1C7A2E00B6C23A /* Build configuration list for PBXNativeTarget "Hero" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + A306D3BC1E1C7A2E00B6C23A /* Debug */, + A306D3BD1E1C7A2E00B6C23A /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; A33E609C1DE761C90065CBD8 /* Build configuration list for PBXProject "HeroExamples" */ = { isa = XCConfigurationList; buildConfigurations = ( diff --git a/Examples/HeroExamples.xcodeproj/xcshareddata/xcschemes/Hero.xcscheme b/Examples/HeroExamples.xcodeproj/xcshareddata/xcschemes/Hero.xcscheme new file mode 100644 index 00000000..29179cea --- /dev/null +++ b/Examples/HeroExamples.xcodeproj/xcshareddata/xcschemes/Hero.xcscheme @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Examples/HeroExamples/AppDelegate.swift b/Examples/HeroExamples/AppDelegate.swift index b2c8135d..fb0fd094 100644 --- a/Examples/HeroExamples/AppDelegate.swift +++ b/Examples/HeroExamples/AppDelegate.swift @@ -1,10 +1,24 @@ +// The MIT License (MIT) // -// AppDelegate.swift -// HeroExamples +// Copyright (c) 2016 Luke Zhao // -// Created by YiLun Zhao on 2016-11-24. -// Copyright © 2016 Luke Zhao. All rights reserved. +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: // +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. import UIKit import Hero diff --git a/Examples/HeroExamples/Assets.xcassets/Foods/Unsplash10.imageset/Contents.json b/Examples/HeroExamples/Assets.xcassets/Foods/Unsplash10.imageset/Contents.json new file mode 100644 index 00000000..85c9978c --- /dev/null +++ b/Examples/HeroExamples/Assets.xcassets/Foods/Unsplash10.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "Unsplash10.jpg", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Examples/HeroExamples/Assets.xcassets/Foods/Unsplash10.imageset/Unsplash10.jpg b/Examples/HeroExamples/Assets.xcassets/Foods/Unsplash10.imageset/Unsplash10.jpg new file mode 100644 index 00000000..96f4256e Binary files /dev/null and b/Examples/HeroExamples/Assets.xcassets/Foods/Unsplash10.imageset/Unsplash10.jpg differ diff --git a/Examples/HeroExamples/Assets.xcassets/Foods/Unsplash10_thumb.imageset/Contents.json b/Examples/HeroExamples/Assets.xcassets/Foods/Unsplash10_thumb.imageset/Contents.json new file mode 100644 index 00000000..1a805dcb --- /dev/null +++ b/Examples/HeroExamples/Assets.xcassets/Foods/Unsplash10_thumb.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "Unsplash10_thumb.jpg", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Examples/HeroExamples/Assets.xcassets/Foods/Unsplash10_thumb.imageset/Unsplash10_thumb.jpg b/Examples/HeroExamples/Assets.xcassets/Foods/Unsplash10_thumb.imageset/Unsplash10_thumb.jpg new file mode 100644 index 00000000..e449f30a Binary files /dev/null and b/Examples/HeroExamples/Assets.xcassets/Foods/Unsplash10_thumb.imageset/Unsplash10_thumb.jpg differ diff --git a/Examples/HeroExamples/Assets.xcassets/ic_input_48pt.imageset/Contents.json b/Examples/HeroExamples/Assets.xcassets/ic_input_48pt.imageset/Contents.json new file mode 100644 index 00000000..f3262a56 --- /dev/null +++ b/Examples/HeroExamples/Assets.xcassets/ic_input_48pt.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "ic_input_48pt.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "ic_input_48pt_2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "ic_input_48pt_3x.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Examples/HeroExamples/Assets.xcassets/ic_input_48pt.imageset/ic_input_48pt.png b/Examples/HeroExamples/Assets.xcassets/ic_input_48pt.imageset/ic_input_48pt.png new file mode 100644 index 00000000..ce9e156b Binary files /dev/null and b/Examples/HeroExamples/Assets.xcassets/ic_input_48pt.imageset/ic_input_48pt.png differ diff --git a/Examples/HeroExamples/Assets.xcassets/ic_input_48pt.imageset/ic_input_48pt_2x.png b/Examples/HeroExamples/Assets.xcassets/ic_input_48pt.imageset/ic_input_48pt_2x.png new file mode 100644 index 00000000..97ee5c20 Binary files /dev/null and b/Examples/HeroExamples/Assets.xcassets/ic_input_48pt.imageset/ic_input_48pt_2x.png differ diff --git a/Examples/HeroExamples/Assets.xcassets/ic_input_48pt.imageset/ic_input_48pt_3x.png b/Examples/HeroExamples/Assets.xcassets/ic_input_48pt.imageset/ic_input_48pt_3x.png new file mode 100644 index 00000000..e469cf17 Binary files /dev/null and b/Examples/HeroExamples/Assets.xcassets/ic_input_48pt.imageset/ic_input_48pt_3x.png differ diff --git a/Examples/HeroExamples/Base.lproj/Basic.storyboard b/Examples/HeroExamples/Base.lproj/Basic.storyboard new file mode 100644 index 00000000..e969cf41 --- /dev/null +++ b/Examples/HeroExamples/Base.lproj/Basic.storyboard @@ -0,0 +1,333 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Examples/HeroExamples/Base.lproj/CityGuide.storyboard b/Examples/HeroExamples/Base.lproj/CityGuide.storyboard new file mode 100644 index 00000000..260495ac --- /dev/null +++ b/Examples/HeroExamples/Base.lproj/CityGuide.storyboard @@ -0,0 +1,325 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Examples/HeroExamples/Base.lproj/Debug.storyboard b/Examples/HeroExamples/Base.lproj/Debug.storyboard new file mode 100644 index 00000000..2babb1cd --- /dev/null +++ b/Examples/HeroExamples/Base.lproj/Debug.storyboard @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Examples/HeroExamples/Base.lproj/ImageGallery.storyboard b/Examples/HeroExamples/Base.lproj/ImageGallery.storyboard new file mode 100644 index 00000000..4574fe3f --- /dev/null +++ b/Examples/HeroExamples/Base.lproj/ImageGallery.storyboard @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Examples/HeroExamples/Base.lproj/ImageViewer.storyboard b/Examples/HeroExamples/Base.lproj/ImageViewer.storyboard new file mode 100644 index 00000000..d21321cf --- /dev/null +++ b/Examples/HeroExamples/Base.lproj/ImageViewer.storyboard @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Examples/HeroExamples/Base.lproj/LabelTransform.storyboard b/Examples/HeroExamples/Base.lproj/LabelTransform.storyboard new file mode 100644 index 00000000..10b49e5f --- /dev/null +++ b/Examples/HeroExamples/Base.lproj/LabelTransform.storyboard @@ -0,0 +1,92 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Examples/HeroExamples/Base.lproj/ListToGrid.storyboard b/Examples/HeroExamples/Base.lproj/ListToGrid.storyboard new file mode 100644 index 00000000..9d93459c --- /dev/null +++ b/Examples/HeroExamples/Base.lproj/ListToGrid.storyboard @@ -0,0 +1,186 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Examples/HeroExamples/Base.lproj/LiveInjection.storyboard b/Examples/HeroExamples/Base.lproj/LiveInjection.storyboard new file mode 100644 index 00000000..ca436a6e --- /dev/null +++ b/Examples/HeroExamples/Base.lproj/LiveInjection.storyboard @@ -0,0 +1,299 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Examples/HeroExamples/Base.lproj/Main.storyboard b/Examples/HeroExamples/Base.lproj/Main.storyboard index a9f7d683..6b31b4c7 100644 --- a/Examples/HeroExamples/Base.lproj/Main.storyboard +++ b/Examples/HeroExamples/Base.lproj/Main.storyboard @@ -1,23 +1,20 @@ - + - - - - + - + - + - + @@ -27,13 +24,14 @@ - + - + + @@ -52,7 +50,7 @@ - + - - - - - + @@ -137,11 +158,47 @@ - - + @@ -184,7 +235,7 @@ - + - - - - - - - @@ -230,14 +283,14 @@ - + - + - - - - - - - - + @@ -295,36 +348,41 @@ - - - - - - - - - - + @@ -339,36 +397,41 @@ - - - - - - - - - - + @@ -383,40 +446,92 @@ - - - - - - - - - - + + + + + + + + + + + + + + + + + + - + @@ -429,36 +544,59 @@ - - - - - - - - - - + - + @@ -471,30 +609,35 @@ - - - - - - - - - @@ -505,1715 +648,23 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - + - - - - - - - - - - - - - diff --git a/Examples/HeroExamples/Base.lproj/Menu.storyboard b/Examples/HeroExamples/Base.lproj/Menu.storyboard new file mode 100644 index 00000000..98bb1099 --- /dev/null +++ b/Examples/HeroExamples/Base.lproj/Menu.storyboard @@ -0,0 +1,292 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Examples/HeroExamples/Base.lproj/MusicPlayer.storyboard b/Examples/HeroExamples/Base.lproj/MusicPlayer.storyboard new file mode 100644 index 00000000..a3e047eb --- /dev/null +++ b/Examples/HeroExamples/Base.lproj/MusicPlayer.storyboard @@ -0,0 +1,346 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Examples/HeroExamples/CG+HeroExamples.swift b/Examples/HeroExamples/CG+HeroExamples.swift deleted file mode 100644 index 0fe2506f..00000000 --- a/Examples/HeroExamples/CG+HeroExamples.swift +++ /dev/null @@ -1,90 +0,0 @@ -// The MIT License (MIT) -// -// Copyright (c) 2015 Luke Zhao -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import MetalKit - -internal struct KeySet{ - var dict:[Key:Set] = [:] - internal subscript(key: Key) -> Set { - mutating get { - if dict[key] == nil { - dict[key] = Set() - } - return dict[key]! - } - set { - dict[key] = newValue - } - } -} - -internal extension CGRect{ - internal var center:CGPoint{ - return CGPoint(x: origin.x + size.width/2, y: origin.y + size.height/2) - } - internal var bounds:CGRect{ - return CGRect(origin: CGPoint.zero, size: size) - } - init(center:CGPoint, size:CGSize) { - self.init(x:center.x - size.width/2, y:center.y - size.height/2,width:size.width,height:size.height) - } -} - -extension CGFloat{ - internal func clamp(_ a:CGFloat, _ b:CGFloat) -> CGFloat{ - return self < a ? a : (self > b ? b : self) - } -} -extension CGPoint{ - internal func translate(_ dx:CGFloat, dy:CGFloat) -> CGPoint{ - return CGPoint(x: self.x+dx, y: self.y+dy) - } - - internal func transform(_ t:CGAffineTransform) -> CGPoint{ - return self.applying(t) - } - - internal func distance(_ b:CGPoint)->CGFloat{ - return sqrt(pow(self.x-b.x,2)+pow(self.y-b.y,2)); - } -} -internal func +(left: CGPoint, right: CGPoint) -> CGPoint { - return CGPoint(x: left.x + right.x, y: left.y + right.y) -} -internal func -(left: CGPoint, right: CGPoint) -> CGPoint { - return CGPoint(x: left.x - right.x, y: left.y - right.y) -} -internal func /(left: CGPoint, right: CGFloat) -> CGPoint { - return CGPoint(x: left.x/right, y: left.y/right) -} -internal func *(left: CGPoint, right: CGFloat) -> CGPoint { - return CGPoint(x: left.x*right, y: left.y*right) -} -internal func *(left: CGFloat, right: CGPoint) -> CGPoint { - return right * left -} -internal func *(left: CGPoint, right: CGPoint) -> CGPoint { - return CGPoint(x: left.x*right.x, y: left.y*right.y) -} -internal prefix func -(point:CGPoint) -> CGPoint { - return CGPoint.zero - point -} diff --git a/Examples/HeroExamples/Examples/CityGuide/City.swift b/Examples/HeroExamples/Examples/CityGuide/City.swift index e717b6dd..034426e1 100644 --- a/Examples/HeroExamples/Examples/CityGuide/City.swift +++ b/Examples/HeroExamples/Examples/CityGuide/City.swift @@ -1,10 +1,24 @@ +// The MIT License (MIT) // -// City.swift -// HeroTransitionExample +// Copyright (c) 2016 Luke Zhao // -// Created by YiLun Zhao on 2016-11-24. -// Copyright © 2016 lkzhao. All rights reserved. +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: // +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. import UIKit diff --git a/Examples/HeroExamples/Examples/CityGuide/CityGuideCell.swift b/Examples/HeroExamples/Examples/CityGuide/CityGuideCell.swift index dc7a67a8..fce3a91c 100644 --- a/Examples/HeroExamples/Examples/CityGuide/CityGuideCell.swift +++ b/Examples/HeroExamples/Examples/CityGuide/CityGuideCell.swift @@ -1,10 +1,24 @@ +// The MIT License (MIT) // -// CityGuideCell.swift -// HeroTransitionExample +// Copyright (c) 2016 Luke Zhao // -// Created by YiLun Zhao on 2016-11-24. -// Copyright © 2016 lkzhao. All rights reserved. +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: // +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. import UIKit @@ -18,14 +32,15 @@ class CityCell:UICollectionViewCell{ var city:City?{ didSet{ - imageView.image = city?.image - nameLabel.text = city?.name - descriptionLabel.text = useShortDescription ? city?.shortDescription : city?.description - if let name = city?.name{ - heroID = "\(name)_backgroundImage" - nameLabel.heroID = "\(name)_cityName" - descriptionLabel.heroID = "\(name)_cityDescription" - } + guard let city = city else { return } + let name = city.name + + heroID = "\(name)" + heroModifiers = [.zPositionIfMatched(3)] + + nameLabel.text = name + imageView.image = city.image + descriptionLabel.text = useShortDescription ? city.shortDescription : city.description } } } diff --git a/Examples/HeroExamples/Examples/CityGuide/CityGuideViewController.swift b/Examples/HeroExamples/Examples/CityGuide/CityGuideViewController.swift index 7f6b827a..c6a13c4e 100644 --- a/Examples/HeroExamples/Examples/CityGuide/CityGuideViewController.swift +++ b/Examples/HeroExamples/Examples/CityGuide/CityGuideViewController.swift @@ -1,10 +1,24 @@ +// The MIT License (MIT) // -// CityGuideViewController.swift -// HeroTransitionExample +// Copyright (c) 2016 Luke Zhao // -// Created by Luke Zhao on 2016-11-23. -// Copyright © 2016 lkzhao. All rights reserved. +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: // +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. import UIKit @@ -16,15 +30,6 @@ class CityGuideViewController: UIViewController { let vc = segue.destination as? CityViewController, let currentCellIndex = collectionView.indexPath(for: currentCell){ vc.selectedIndex = currentCellIndex - - for indexPath in collectionView.indexPathsForVisibleItems{ - if let cell = collectionView.cellForItem(at: indexPath) as? CityCell, - indexPath != currentCellIndex { - let beforeCurrentCell = indexPath < currentCellIndex - // want right side cells to slide right, and left side cells to slide left - cell.heroModifiers = "fade translate(\(beforeCurrentCell ? -100 : 100),0)" - } - } } } } diff --git a/Examples/HeroExamples/Examples/CityGuide/CityViewController.swift b/Examples/HeroExamples/Examples/CityGuide/CityViewController.swift index ca16130d..b039991f 100644 --- a/Examples/HeroExamples/Examples/CityGuide/CityViewController.swift +++ b/Examples/HeroExamples/Examples/CityGuide/CityViewController.swift @@ -1,10 +1,24 @@ +// The MIT License (MIT) // -// CityViewController.swift -// HeroTransitionExample +// Copyright (c) 2016 Luke Zhao // -// Created by Luke Zhao on 2016-11-23. -// Copyright © 2016 lkzhao. All rights reserved. +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: // +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. import UIKit diff --git a/Examples/HeroExamples/Examples/Debug/DebugViewController.swift b/Examples/HeroExamples/Examples/Debug/DebugViewController.swift index 97719b9c..b2e31ed3 100644 --- a/Examples/HeroExamples/Examples/Debug/DebugViewController.swift +++ b/Examples/HeroExamples/Examples/Debug/DebugViewController.swift @@ -1,10 +1,24 @@ +// The MIT License (MIT) // -// DebugViewController.swift -// HeroExamples +// Copyright (c) 2016 Luke Zhao // -// Created by Luke Zhao on 2016-12-13. -// Copyright © 2016 Luke Zhao. All rights reserved. +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: // +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. import UIKit import Hero diff --git a/Examples/HeroExamples/Examples/ImageGallery/ImageCells.swift b/Examples/HeroExamples/Examples/ImageGallery/ImageCells.swift index 3b8c3fd3..929886b2 100644 --- a/Examples/HeroExamples/Examples/ImageGallery/ImageCells.swift +++ b/Examples/HeroExamples/Examples/ImageGallery/ImageCells.swift @@ -1,10 +1,24 @@ +// The MIT License (MIT) // -// ScrollingImageCell.swift -// HeroExamples +// Copyright (c) 2016 Luke Zhao // -// Created by YiLun Zhao on 2016-12-05. -// Copyright © 2016 Luke Zhao. All rights reserved. +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: // +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. import UIKit @@ -16,6 +30,13 @@ class ScrollingImageCell:UICollectionViewCell{ var imageView:UIImageView! var scrollView:UIScrollView! var dTapGR:UITapGestureRecognizer! + var image:UIImage?{ + get{ return imageView.image } + set{ + imageView.image = newValue + setNeedsLayout() + } + } var topInset:CGFloat = 0{ didSet{ centerIfNeeded() @@ -61,7 +82,12 @@ class ScrollingImageCell:UICollectionViewCell{ override func layoutSubviews() { super.layoutSubviews() scrollView.frame = bounds - let size = CGSize(width: bounds.width, height: bounds.width) + let size:CGSize + if let image = imageView.image{ + size = CGSize(width: bounds.width, height: bounds.width * image.size.height / image.size.width ) + } else { + size = CGSize(width: bounds.width, height: bounds.width) + } imageView.frame = CGRect(origin: .zero, size: size) scrollView.contentSize = size centerIfNeeded() diff --git a/Examples/HeroExamples/Examples/ImageGallery/ImageGalleryCollectionViewController.swift b/Examples/HeroExamples/Examples/ImageGallery/ImageGalleryCollectionViewController.swift index c258aee1..ab6afc0c 100644 --- a/Examples/HeroExamples/Examples/ImageGallery/ImageGalleryCollectionViewController.swift +++ b/Examples/HeroExamples/Examples/ImageGallery/ImageGalleryCollectionViewController.swift @@ -1,10 +1,24 @@ +// The MIT License (MIT) // -// ImageGalleryViewController.swift -// HeroExamples +// Copyright (c) 2016 Luke Zhao // -// Created by YiLun Zhao on 2016-12-02. -// Copyright © 2016 Luke Zhao. All rights reserved. +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: // +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. import UIKit import Hero @@ -24,30 +38,29 @@ class ImageGalleryViewController: UIViewController { @IBAction func switchLayout(_ sender: Any) { // just replace the root view controller with the same view controller // animation is automatic! Holy - let next = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "imageGallery") as! ImageGalleryViewController + let next = UIStoryboard(name: "ImageGallery", bundle: nil).instantiateViewController(withIdentifier: "imageGallery") as! ImageGalleryViewController next.columns = columns == 3 ? 5 : 3 heroReplaceViewController(with: next) } - - override func prepare(for segue: UIStoryboardSegue, sender: Any?) { - if let currentCell = sender as? ImageCell, - let vc = segue.destination as? ImageViewController, - let currentCellIndex = collectionView.indexPath(for: currentCell){ - vc.selectedIndex = currentCellIndex - } - } } extension ImageGalleryViewController:UICollectionViewDataSource{ + func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { + let vc = viewController(forStoryboardName: "ImageViewer") as! ImageViewController + vc.selectedIndex = indexPath + navigationController!.pushViewController(vc, animated: true) + } + func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { - return 50 + return ImageLibrary.count } func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { let imageCell = collectionView.dequeueReusableCell(withReuseIdentifier: "item", for: indexPath) as! ImageCell - imageCell.imageView.image = UIImage(named: "Unsplash\(indexPath.item % 10)_thumb") - imageCell.heroID = "image_\(indexPath.item)" - imageCell.heroModifiers = "fade translate(0, 150) rotate(-1,0,0) scale(0.8) zPosition(50) zPositionIfMatched(100)" + imageCell.imageView.image = ImageLibrary.thumbnail(index:indexPath.item) + imageCell.imageView.heroID = "image_\(indexPath.item)" + imageCell.imageView.heroModifiers = [.zPosition(100)] + imageCell.heroModifiers = [.fade, .scale(0.8), .zPosition(50)] return imageCell } } @@ -60,32 +73,26 @@ extension ImageGalleryViewController:UICollectionViewDelegate, UICollectionViewD extension ImageGalleryViewController:HeroViewControllerDelegate{ func heroWillStartAnimatingTo(viewController: UIViewController) { - // Cascade effect when transition to another view controller - // This adds increasing delays for collectionView's subviews - // the first parameter is the delay in between each animation - // the second parameter is the cascade direction - // the third is the initial delay - // the forth is whether or not to delay matched views - // - // NOTE: matched views(views with the same `heroID`) won't have - // the cascading effect. however, you can use the 4th parameter to delay - // the start time until the last cascading animation have started - // by default: the matched views will animate simutanously with the cascading views - if (viewController as? ImageGalleryViewController) != nil || (viewController as? ImageViewController) != nil{ - collectionView.heroModifiers = "cascade(0.015, bottomToTop, 0, true)" + if (viewController as? ImageGalleryViewController) != nil{ + collectionView.heroModifiers = [.cascade(delta:0.015, direction:.bottomToTop, delayMatchedViews:true)] + } else if (viewController as? ImageViewController) != nil{ + let cell = collectionView.cellForItem(at: collectionView.indexPathsForSelectedItems!.first!)! + collectionView.heroModifiers = [.cascade(delta:0.015, direction:.radial(center:cell.center), delayMatchedViews:true)] } else { - collectionView.heroModifiers = "cascade(0.015, topToBottom)" + collectionView.heroModifiers = [.cascade(delta:0.015)] } } func heroWillStartAnimatingFrom(viewController: UIViewController) { if (viewController as? ImageGalleryViewController) != nil{ - collectionView.heroModifiers = "cascade(0.015, topToBottom, 0.25)" + collectionView.heroModifiers = [.cascade(delta:0.015), .delay(0.25)] } else { - collectionView.heroModifiers = "cascade(0.015, topToBottom)" + collectionView.heroModifiers = [.cascade(delta:0.015)] } if let vc = viewController as? ImageViewController, let originalCellIndex = vc.selectedIndex, - let currentCellIndex = vc.collectionView?.indexPathsForVisibleItems[0] { + let currentCellIndex = vc.collectionView?.indexPathsForVisibleItems[0], + let targetAttribute = collectionView.layoutAttributesForItem(at: currentCellIndex) { + collectionView.heroModifiers = [.cascade(delta:0.015, direction:.inverseRadial(center:targetAttribute.frame.center))] if !collectionView.indexPathsForVisibleItems.contains(currentCellIndex){ // make the cell visible collectionView.scrollToItem(at: currentCellIndex, diff --git a/Examples/HeroExamples/Examples/ImageGallery/ImageLibrary.swift b/Examples/HeroExamples/Examples/ImageGallery/ImageLibrary.swift new file mode 100644 index 00000000..154e6659 --- /dev/null +++ b/Examples/HeroExamples/Examples/ImageGallery/ImageLibrary.swift @@ -0,0 +1,20 @@ +// +// ImageLibrary.swift +// HeroExamples +// +// Created by YiLun Zhao on 2017-01-04. +// Copyright © 2017 Luke Zhao. All rights reserved. +// + +import UIKit + + +class ImageLibrary{ + static var count = 100 + static func thumbnail(index:Int) -> UIImage{ + return UIImage(named: "Unsplash\(index % 11)_thumb")! + } + static func image(index:Int) -> UIImage{ + return UIImage(named: "Unsplash\(index % 11)")! + } +} diff --git a/Examples/HeroExamples/Examples/ImageGallery/ImageViewController.swift b/Examples/HeroExamples/Examples/ImageGallery/ImageViewController.swift index 6ae12c06..f4e3d25c 100644 --- a/Examples/HeroExamples/Examples/ImageGallery/ImageViewController.swift +++ b/Examples/HeroExamples/Examples/ImageGallery/ImageViewController.swift @@ -1,10 +1,24 @@ +// The MIT License (MIT) // -// ImageViewController.swift -// HeroExamples +// Copyright (c) 2016 Luke Zhao // -// Created by YiLun Zhao on 2016-12-02. -// Copyright © 2016 Luke Zhao. All rights reserved. +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: // +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. import UIKit import Hero @@ -12,7 +26,6 @@ import Hero class ImageViewController: UICollectionViewController { var selectedIndex:IndexPath? var panGR = UIPanGestureRecognizer() - weak var interactiveContext:HeroInteractiveContext? override func viewDidLoad() { super.viewDidLoad() @@ -48,32 +61,31 @@ class ImageViewController: UICollectionViewController { dismiss(animated: true, completion: nil) } case .changed: - interactiveContext?.update(progress: Double(progress)) + Hero.shared.update(progress: Double(progress)) if let cell = collectionView?.visibleCells[0] as? ScrollingImageCell{ let currentPos = translation + view.center - interactiveContext?.temporarilySet(view: cell.imageView, with: "position(\(currentPos.x), \(currentPos.y))") + Hero.shared.temporarilySet(view: cell.imageView, modifiers: [.position(currentPos)]) } default: if progress + panGR.velocity(in: nil).y / collectionView!.bounds.height > 0.15{ - interactiveContext?.end() + Hero.shared.end() } else { - interactiveContext?.cancel() + Hero.shared.cancel() } - interactiveContext = nil } } } extension ImageViewController{ override func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { - return 50 + return ImageLibrary.count } override func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { let imageCell = collectionView.dequeueReusableCell(withReuseIdentifier: "item", for: indexPath) as! ScrollingImageCell - imageCell.imageView.image = UIImage(named: "Unsplash\(indexPath.item % 10)") + imageCell.image = ImageLibrary.image(index:indexPath.item) imageCell.imageView.heroID = "image_\(indexPath.item)" - imageCell.imageView.heroModifiers = "position(\(view.bounds.width/2), \(view.bounds.height+view.bounds.width/2)) scale(0.6) fade zPositionIfMatched(100)" + imageCell.imageView.heroModifiers = [.position(CGPoint(x:view.bounds.width/2, y:view.bounds.height+view.bounds.width/2)), .scale(x:0.6, y:0.6), .fade, .zPositionIfMatched(100)] imageCell.topInset = topLayoutGuide.length return imageCell } @@ -97,9 +109,8 @@ extension ImageViewController:UIGestureRecognizerDelegate{ } extension ImageViewController:HeroViewControllerDelegate{ - func wantInteractiveHeroTransition(context: HeroInteractiveContext) -> Bool { - if !context.presenting && panGR.state == .began{ - interactiveContext = context + func wantInteractiveHeroTransition() -> Bool { + if !Hero.shared.presenting && panGR.state == .began{ return true } return false diff --git a/Examples/HeroExamples/Examples/LabelTransform/LabelTransformViewController.swift b/Examples/HeroExamples/Examples/LabelTransform/LabelTransformViewController.swift index 42e4bceb..e0a45528 100644 --- a/Examples/HeroExamples/Examples/LabelTransform/LabelTransformViewController.swift +++ b/Examples/HeroExamples/Examples/LabelTransform/LabelTransformViewController.swift @@ -1,17 +1,34 @@ +// The MIT License (MIT) // -// AdvanceLabelViewController.swift -// HeroExamples +// Copyright (c) 2016 Luke Zhao // -// Created by Luke Zhao on 2016-12-11. -// Copyright © 2016 Luke Zhao. All rights reserved. +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: // +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. import UIKit import Hero import ZCAnimatedLabel class LabelTransformViewController: UIViewController { + @IBOutlet weak var label1: UILabel! + @IBOutlet weak var label2: UILabel! @IBOutlet weak var pluginSwitch: UISwitch! + @IBAction func togglePlugin(_ sender: UISwitch) { LabelMorphPlugin.isEnabled = sender.isOn } @@ -19,23 +36,69 @@ class LabelTransformViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() pluginSwitch.isOn = LabelMorphPlugin.isEnabled + label1.heroModifiers = [.zcLabelMorph(type:.fall)] + label2.heroModifiers = [.zcLabelMorph(type:.flyin)] + } +} + +extension HeroModifier{ + public static func zcLabelMorph(type:LabelMorphPlugin.LabelMorphType) -> HeroModifier { + return HeroModifier { targetState in + targetState["zcLabelMorph"] = type + } } } -class LabelMorphPlugin:HeroPlugin{ +public class LabelMorphPlugin:HeroPlugin{ var morphingLabels:[ZCAnimatedLabel]! + public enum LabelMorphType{ + case normal + case fall + case duang + case flyin + case focus + case shapeshift + case reveal + case thrown + case transparency + case spin + case dash + } - override func canAnimate(context:HeroContext, view:UIView, appearing:Bool) -> Bool { - // Here we are animating all UILabels that are not paired. - // For a real plugin, it should check for whether or not a modifier exist - // for the view by: - // return context[view, "labelMorph"] != nil - return (view as? UILabel != nil) && context.pairedView(for: view) == nil + public override func canAnimate(context:HeroContext, view:UIView, appearing:Bool) -> Bool { + return (context[view]?["zcLabelMorph"] as? LabelMorphType) != nil } func createMorphingLabel(context:HeroContext, label:UILabel, appearing:Bool) { let frame = context.container.convert(label.bounds, from: label) - let morphingLabel = ZCShapeshiftLabel(frame: frame) + + let morphingLabel:ZCAnimatedLabel + switch (context[label]!["zcLabelMorph"] as! LabelMorphType){ + case .normal: + morphingLabel = ZCAnimatedLabel() + case .fall: + morphingLabel = ZCFallLabel() + case .duang: + morphingLabel = ZCDuangLabel() + case .flyin: + morphingLabel = ZCFlyinLabel() + case .focus: + morphingLabel = ZCFocusLabel() + case .shapeshift: + morphingLabel = ZCShapeshiftLabel() + case .reveal: + morphingLabel = ZCRevealLabel() + case .thrown: + morphingLabel = ZCThrownLabel() + case .transparency: + morphingLabel = ZCTransparencyLabel() + case .spin: + morphingLabel = ZCSpinLabel() + case .dash: + morphingLabel = ZCDashLabel() + } + morphingLabel.frame = frame + morphingLabel.font = label.font morphingLabel.textColor = label.textColor @@ -54,7 +117,7 @@ class LabelMorphPlugin:HeroPlugin{ } } - override func animate(context:HeroContext, fromViews:[UIView], toViews:[UIView]) -> TimeInterval { + public override func animate(context:HeroContext, fromViews:[UIView], toViews:[UIView]) -> TimeInterval { morphingLabels = [] var maxDuration:TimeInterval = 0 @@ -72,7 +135,7 @@ class LabelMorphPlugin:HeroPlugin{ return maxDuration } - override func clean(){ + public override func clean(){ for label in morphingLabels{ label.stopAnimation() label.removeFromSuperview() diff --git a/Examples/HeroExamples/Examples/ListToGrid/GridCollectionViewController.swift b/Examples/HeroExamples/Examples/ListToGrid/GridCollectionViewController.swift index 9902a275..7e9deb8f 100644 --- a/Examples/HeroExamples/Examples/ListToGrid/GridCollectionViewController.swift +++ b/Examples/HeroExamples/Examples/ListToGrid/GridCollectionViewController.swift @@ -1,10 +1,24 @@ +// The MIT License (MIT) // -// GridCollectionViewController.swift -// HeroExamples +// Copyright (c) 2016 Luke Zhao // -// Created by Luke Zhao on 2016-12-08. -// Copyright © 2016 Luke Zhao. All rights reserved. +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: // +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. import UIKit import Hero @@ -17,48 +31,42 @@ class GridImageCell:UICollectionViewCell{ } class GridCollectionViewController: UICollectionViewController, UICollectionViewDelegateFlowLayout { - - override func viewDidLoad() { - super.viewDidLoad() + @IBAction func toList(_ sender: Any) { + let next = UIStoryboard(name: "ListToGrid", bundle: nil).instantiateViewController(withIdentifier: "list") as! ListTableViewController + next.tableView.contentOffset.y = collectionView!.contentOffset.y + collectionView!.contentInset.top + heroReplaceViewController(with: next) } - override func prepare(for segue: UIStoryboardSegue, sender: Any?) { - if let currentCell = sender as? GridImageCell, - let vc = segue.destination as? ImageViewController, - let currentCellIndex = collectionView!.indexPath(for: currentCell){ - vc.selectedIndex = currentCellIndex - vc.view.backgroundColor = UIColor.white - vc.collectionView!.backgroundColor = UIColor.white - } + override func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { + return ImageLibrary.count } - override func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { - return 50 + func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize { + return CGSize(width: view.frame.width / 3, height: 52*3) } override func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "item", for: indexPath) as! GridImageCell - - let image = UIImage(named: "Unsplash\(indexPath.item % 10)")! - cell.heroModifiers = "fade translate(0, 20)" + + cell.imageView?.heroID = "image_\(indexPath.item)" + let image = ImageLibrary.thumbnail(index:indexPath.item) + cell.heroModifiers = [.fade, .translate(y:20)] cell.imageView?.image = image cell.imageView?.heroID = "image_\(indexPath.item)" - cell.imageView?.heroModifiers = "arc" + cell.imageView?.heroModifiers = [.arc, .zPosition(10)] cell.textLabel?.text = "Item \(indexPath.item)" cell.detailTextLabel?.text = "Description \(indexPath.item)" cell.backgroundColor = UIColor(averageColorFrom: image) - + return cell } - - @IBAction func toList(_ sender: Any) { - let next = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "list") as! ListTableViewController - next.tableView.contentOffset.y = collectionView!.contentOffset.y + collectionView!.contentInset.top - heroReplaceViewController(with: next) - } - func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize { - return CGSize(width: view.frame.width / 3, height: 52*3) + override func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { + let vc = viewController(forStoryboardName: "ImageViewer") as! ImageViewController + vc.selectedIndex = indexPath + vc.view.backgroundColor = UIColor.white + vc.collectionView!.backgroundColor = UIColor.white + navigationController!.pushViewController(vc, animated: true) } } @@ -68,9 +76,9 @@ extension GridCollectionViewController:HeroViewControllerDelegate{ let index = collectionView!.indexPathsForSelectedItems?[0], let cell = collectionView!.cellForItem(at: index) as? GridImageCell{ let cellPos = view.convert(cell.imageView.center, from: cell) - collectionView!.heroModifiers = "scale(\(3)) translate(\(view.center.x - cellPos.x),\(view.center.y + collectionView!.contentInset.top/2/3 - cellPos.y)) clearSubviewModifiers fade" + collectionView!.heroModifiers = [.scale(3), .translate(x:view.center.x - cellPos.x, y:view.center.y + collectionView!.contentInset.top/2/3 - cellPos.y), .ignoreSubviewModifiers, .fade] } else { - collectionView!.heroModifiers = "cascade(0.02, topToBottom)" + collectionView!.heroModifiers = [.cascade] } } @@ -78,7 +86,7 @@ extension GridCollectionViewController:HeroViewControllerDelegate{ if let vc = viewController as? ImageViewController, let originalCellIndex = vc.selectedIndex, let currentCellIndex = vc.collectionView?.indexPathsForVisibleItems[0] { - collectionView!.heroModifiers = "cascade(0.02, topToBottom)" + collectionView!.heroModifiers = [.cascade] if !collectionView!.indexPathsForVisibleItems.contains(currentCellIndex){ // make the cell visible collectionView!.scrollToItem(at: currentCellIndex, @@ -86,7 +94,7 @@ extension GridCollectionViewController:HeroViewControllerDelegate{ animated: false) } } else { - collectionView!.heroModifiers = "cascade(0.02, topToBottom, 0.2)" + collectionView!.heroModifiers = [.cascade, .delay(0.2)] } } } diff --git a/Examples/HeroExamples/Examples/ListToGrid/ListTableViewController.swift b/Examples/HeroExamples/Examples/ListToGrid/ListTableViewController.swift index b575ac91..9aebbf13 100644 --- a/Examples/HeroExamples/Examples/ListToGrid/ListTableViewController.swift +++ b/Examples/HeroExamples/Examples/ListToGrid/ListTableViewController.swift @@ -1,10 +1,24 @@ +// The MIT License (MIT) // -// ListTableViewController.swift -// HeroExamples +// Copyright (c) 2016 Luke Zhao // -// Created by Luke Zhao on 2016-12-08. -// Copyright © 2016 Luke Zhao. All rights reserved. +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: // +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. import UIKit import Hero @@ -13,8 +27,9 @@ class ListTableViewCell:UITableViewCell{ override func layoutSubviews() { super.layoutSubviews() imageView?.frame.origin.x = 0 - textLabel?.frame.origin.x -= 15 - detailTextLabel?.frame.origin.x -= 15 + imageView?.frame.size = CGSize(width: bounds.height, height: bounds.height) + textLabel?.frame.origin.x = bounds.height + 10 + detailTextLabel?.frame.origin.x = bounds.height + 10 } } @@ -25,16 +40,16 @@ class ListTableViewController: UITableViewController { } override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { - return 50 + return ImageLibrary.count } override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let cell = tableView.dequeueReusableCell(withIdentifier: "item", for: indexPath) - cell.heroModifiers = "fade translate(-100, 0)" + cell.heroModifiers = [.fade, .translate(x:-100)] cell.imageView?.heroID = "image_\(indexPath.item)" - cell.imageView?.heroModifiers = "arc" - cell.imageView?.image = UIImage(named: "Unsplash\(indexPath.item % 10)") + cell.imageView?.heroModifiers = [.arc, .zPosition(10)] + cell.imageView?.image = ImageLibrary.thumbnail(index:indexPath.item) cell.textLabel?.text = "Item \(indexPath.item)" cell.detailTextLabel?.text = "Description \(indexPath.item)" @@ -46,35 +61,33 @@ class ListTableViewController: UITableViewController { } @IBAction func toGrid(_ sender: Any) { - let next = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "grid") as! GridCollectionViewController + let next = UIStoryboard(name: "ListToGrid", bundle: nil).instantiateViewController(withIdentifier: "grid") as! GridCollectionViewController next.collectionView?.contentOffset.y = tableView.contentOffset.y + tableView.contentInset.top heroReplaceViewController(with: next) } - override func prepare(for segue: UIStoryboardSegue, sender: Any?) { - if let currentCell = sender as? ListTableViewCell, - let vc = segue.destination as? ImageViewController, - let currentCellIndex = tableView.indexPath(for: currentCell){ - vc.selectedIndex = currentCellIndex - vc.view.backgroundColor = UIColor.white - vc.collectionView!.backgroundColor = UIColor.white - } + override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { + let vc = viewController(forStoryboardName: "ImageViewer") as! ImageViewController + vc.selectedIndex = indexPath + vc.view.backgroundColor = UIColor.white + vc.collectionView!.backgroundColor = UIColor.white + navigationController!.pushViewController(vc, animated: true) } } extension ListTableViewController:HeroViewControllerDelegate{ func heroWillStartAnimatingTo(viewController: UIViewController) { if let _ = viewController as? GridCollectionViewController{ - tableView.heroModifiers = "clearSubviewModifiers" + tableView.heroModifiers = [.ignoreSubviewModifiers] } else { - tableView.heroModifiers = "cascade(0.02)" + tableView.heroModifiers = [.cascade] } } func heroWillStartAnimatingFrom(viewController: UIViewController) { if let _ = viewController as? GridCollectionViewController{ - tableView.heroModifiers = "clearSubviewModifiers" + tableView.heroModifiers = [.ignoreSubviewModifiers] } else { - tableView.heroModifiers = "cascade(0.02)" + tableView.heroModifiers = [.cascade] } if let vc = viewController as? ImageViewController, let originalCellIndex = vc.selectedIndex, diff --git a/Examples/HeroExamples/Examples/LiveInjection/LiveInjection1ViewController.swift b/Examples/HeroExamples/Examples/LiveInjection/LiveInjection1ViewController.swift new file mode 100644 index 00000000..6f75c6ca --- /dev/null +++ b/Examples/HeroExamples/Examples/LiveInjection/LiveInjection1ViewController.swift @@ -0,0 +1,25 @@ +// +// LiveInjection1ViewController.swift +// HeroExamples +// +// Created by YiLun Zhao on 2017-01-04. +// Copyright © 2017 Luke Zhao. All rights reserved. +// + +import UIKit +import Hero + +class LiveInjection1ViewController: UIViewController { + + @IBOutlet weak var textLabel: UILabel! + @IBOutlet weak var blueView: UIView! + +} + +extension LiveInjection1ViewController:HeroViewControllerDelegate{ + func heroWillStartTransition() { + textLabel.heroModifiers = [.translate(x:500)] + blueView.heroID = "blue" + blueView.heroModifiers = [.zPosition(5)] + } +} diff --git a/Examples/HeroExamples/Examples/LiveInjection/LiveInjection2ViewControllers.swift b/Examples/HeroExamples/Examples/LiveInjection/LiveInjection2ViewControllers.swift new file mode 100644 index 00000000..acc9db88 --- /dev/null +++ b/Examples/HeroExamples/Examples/LiveInjection/LiveInjection2ViewControllers.swift @@ -0,0 +1,31 @@ +// +// LiveInjection2ViewController.swift +// HeroExamples +// +// Created by YiLun Zhao on 2017-01-04. +// Copyright © 2017 Luke Zhao. All rights reserved. +// + +import UIKit +import Hero + +class LiveInjection2ViewController: UIViewController { + + @IBOutlet weak var orangeView: UIView! + @IBOutlet weak var greenView: UIView! + @IBOutlet weak var blueView: UIView! + +} + +extension LiveInjection2ViewController:HeroViewControllerDelegate{ + + func heroWillStartTransition() { + orangeView.heroID = "orange" + orangeView.heroModifiers = [.scale(x:0.5, y:0.5)] + greenView.heroID = "green" + greenView.heroModifiers = [.scale(x:0.5, y:0.5)] + blueView.heroID = "blue" + blueView.heroModifiers = [.zPosition(5)] + } + +} diff --git a/Examples/HeroExamples/InitialViewController.swift b/Examples/HeroExamples/InitialViewController.swift new file mode 100644 index 00000000..69172c66 --- /dev/null +++ b/Examples/HeroExamples/InitialViewController.swift @@ -0,0 +1,27 @@ +// +// InitialViewController.swift +// HeroExamples +// +// Created by YiLun Zhao on 2017-01-01. +// Copyright © 2017 Luke Zhao. All rights reserved. +// + +import UIKit + +class InitialViewController: UITableViewController { + + var storyboards:[[String]] = [ + [], + ["Basic", "MusicPlayer", "Menu"], + ["CityGuide", "ImageViewer", "ListToGrid", "ImageGallery"], + ["LiveInjection", "Debug", "LabelTransform"] + ] + + override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { + if indexPath.item < storyboards[indexPath.section].count{ + let storyboardName = storyboards[indexPath.section][indexPath.item] + let vc = viewController(forStoryboardName: storyboardName) + present(vc, animated: true, completion: nil) + } + } +} diff --git a/Examples/HeroExamples/UIKit+HeroExamples.swift b/Examples/HeroExamples/UIKit+HeroExamples.swift index afbfac39..ed91ef17 100644 --- a/Examples/HeroExamples/UIKit+HeroExamples.swift +++ b/Examples/HeroExamples/UIKit+HeroExamples.swift @@ -1,10 +1,24 @@ +// The MIT License (MIT) // -// UIKit+HeroTransitionExample.swift -// HeroTransitionExample +// Copyright (c) 2016 Luke Zhao // -// Created by Luke Zhao on 2016-11-23. -// Copyright © 2016 lkzhao. All rights reserved. +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: // +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. import UIKit @@ -63,27 +77,8 @@ public extension UIView{ layer.zPosition = newValue } } - @IBInspectable public var anchorPoint: CGPoint { - get { - return layer.anchorPoint - } - - set { - var newPoint = CGPoint(x:bounds.size.width * anchorPoint.x, y:bounds.size.height * anchorPoint.y) - var oldPoint = CGPoint(x:bounds.size.width * layer.anchorPoint.x, y:bounds.size.height * layer.anchorPoint.y) - - newPoint = newValue.applying(transform) - oldPoint = anchorPoint.applying(transform) - - var position = layer.position - position.x -= oldPoint.x - position.x += newPoint.x - - position.y -= oldPoint.y - position.y += newPoint.y - - layer.position = position - layer.anchorPoint = anchorPoint - } - } +} + +func viewController(forStoryboardName:String) -> UIViewController{ + return UIStoryboard(name: forStoryboardName, bundle: nil).instantiateInitialViewController()! } diff --git a/Examples/Podfile b/Examples/Podfile index fe36a1ba..d7b5e96e 100644 --- a/Examples/Podfile +++ b/Examples/Podfile @@ -2,7 +2,6 @@ platform :ios, '9.0' target 'HeroExamples' do use_frameworks! - pod "Hero", :path=>".." pod "ZCAnimatedLabel" pod 'ChameleonFramework/Swift', :git => 'https://github.com/ViccAlexander/Chameleon.git' end diff --git a/Examples/Podfile.lock b/Examples/Podfile.lock index db106b83..c408938a 100644 --- a/Examples/Podfile.lock +++ b/Examples/Podfile.lock @@ -2,19 +2,15 @@ PODS: - ChameleonFramework/Default (2.1.0) - ChameleonFramework/Swift (2.1.0): - ChameleonFramework/Default - - Hero (0.0.1) - ZCAnimatedLabel (0.0.4) DEPENDENCIES: - ChameleonFramework/Swift (from `https://github.com/ViccAlexander/Chameleon.git`) - - Hero (from `..`) - ZCAnimatedLabel EXTERNAL SOURCES: ChameleonFramework: :git: https://github.com/ViccAlexander/Chameleon.git - Hero: - :path: ".." CHECKOUT OPTIONS: ChameleonFramework: @@ -23,9 +19,8 @@ CHECKOUT OPTIONS: SPEC CHECKSUMS: ChameleonFramework: d21a3cc247abfe5e37609a283a8238b03575cf64 - Hero: c8f6ee8e43aa5dfdf4e0dab8c90c4820d032a665 ZCAnimatedLabel: 519b688bef4403fd356bc785f9b61cdfd8e6472d -PODFILE CHECKSUM: 19514ab9478505fb40da42d51cd280bd1c693fc3 +PODFILE CHECKSUM: 613342ef5c877a23fce065b29fa8f40bbc61c008 COCOAPODS: 1.1.1 diff --git a/Examples/Pods/Manifest.lock b/Examples/Pods/Manifest.lock index db106b83..c408938a 100644 --- a/Examples/Pods/Manifest.lock +++ b/Examples/Pods/Manifest.lock @@ -2,19 +2,15 @@ PODS: - ChameleonFramework/Default (2.1.0) - ChameleonFramework/Swift (2.1.0): - ChameleonFramework/Default - - Hero (0.0.1) - ZCAnimatedLabel (0.0.4) DEPENDENCIES: - ChameleonFramework/Swift (from `https://github.com/ViccAlexander/Chameleon.git`) - - Hero (from `..`) - ZCAnimatedLabel EXTERNAL SOURCES: ChameleonFramework: :git: https://github.com/ViccAlexander/Chameleon.git - Hero: - :path: ".." CHECKOUT OPTIONS: ChameleonFramework: @@ -23,9 +19,8 @@ CHECKOUT OPTIONS: SPEC CHECKSUMS: ChameleonFramework: d21a3cc247abfe5e37609a283a8238b03575cf64 - Hero: c8f6ee8e43aa5dfdf4e0dab8c90c4820d032a665 ZCAnimatedLabel: 519b688bef4403fd356bc785f9b61cdfd8e6472d -PODFILE CHECKSUM: 19514ab9478505fb40da42d51cd280bd1c693fc3 +PODFILE CHECKSUM: 613342ef5c877a23fce065b29fa8f40bbc61c008 COCOAPODS: 1.1.1 diff --git a/Examples/Pods/Pods.xcodeproj/project.pbxproj b/Examples/Pods/Pods.xcodeproj/project.pbxproj index 2d12eca6..0f50b690 100644 --- a/Examples/Pods/Pods.xcodeproj/project.pbxproj +++ b/Examples/Pods/Pods.xcodeproj/project.pbxproj @@ -8,127 +8,98 @@ /* Begin PBXBuildFile section */ 03DCD393DF69EE6DE4AD424B1192DD02 /* UIViewController+Chameleon.h in Headers */ = {isa = PBXBuildFile; fileRef = 303FC65376AD824AF269B17A715AB4D0 /* UIViewController+Chameleon.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 04118D1B8FDD7E7173670C8B07711589 /* ZCAnimatedLabel-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E36AE8CE3D808B3D2BBB747744D39E5 /* ZCAnimatedLabel-dummy.m */; }; - 07FBEEA9B5A846CA380A56E0C4871E70 /* ZCThrownLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = 5B9D36B2F41D2F7FDA079D725D8A9EF5 /* ZCThrownLabel.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; + 0B60DAA4D34F3C74E1142883A12A8CC2 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 30A48DB1C8052F1B842C0010D6FE3264 /* Foundation.framework */; }; 0D7F425CFB628271BFB6FCFF8201BF4F /* UIButton+Chameleon.h in Headers */ = {isa = PBXBuildFile; fileRef = 3A092FCC9003B561AE8D5B50EE5A0AFC /* UIButton+Chameleon.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 10786E27C0CE4E3885C4F18686CF6300 /* ZCShapeshiftLabel.h in Headers */ = {isa = PBXBuildFile; fileRef = 466CFD0F91016EAA8F1AC59F4CB3C975 /* ZCShapeshiftLabel.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 0FAA11918BC2377E39A877BC142D1EEF /* CoreText.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 755FAE73277FCB766461DDF0A4841EC5 /* CoreText.framework */; }; 139A9CEDE5163F58CBB1A3A135DAD6A3 /* UIImage+ChameleonPrivate.m in Sources */ = {isa = PBXBuildFile; fileRef = E3000841A63E13E2E2DA9D1C4294C820 /* UIImage+ChameleonPrivate.m */; }; - 192A0E280366B70ECE34DF53AB848141 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 30A48DB1C8052F1B842C0010D6FE3264 /* Foundation.framework */; }; 1B704F3C816C4532F9B7FDFE0625732E /* ChameleonFramework-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = F421C1312F9063105A65D64D8C5BE410 /* ChameleonFramework-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 1BF55DFD1990F68F268B96985726FD34 /* Pods-HeroExamples-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = D4AF34292621395D6290871F5FB22E18 /* Pods-HeroExamples-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 1EFA7FF8FA2BF549B4CA3B7056C8A31F /* CG+Hero.swift in Sources */ = {isa = PBXBuildFile; fileRef = F9DF90DEF699C530738BF36F7EC08F4A /* CG+Hero.swift */; }; + 1E162B130F202BB758F70ABF7A79FA55 /* ZCAnimatedLabel-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 4AE5CC8638DDC6FA930E5F3F2249945F /* ZCAnimatedLabel-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 24BE4A3CB29223B7DCC5150F5C08A307 /* ZCSpinLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = 9C580D132560EC3A7BBD0CBD16755E73 /* ZCSpinLabel.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; + 25CCFF1662CCA3724B76988DD5E6C7DA /* Pods-HeroExamples-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = AC559FE89B18815721B5D20117D33F86 /* Pods-HeroExamples-dummy.m */; }; 29F74E8A334254C68C6720E3B247CE32 /* NSArray+Chameleon.h in Headers */ = {isa = PBXBuildFile; fileRef = 2E05326F7CD25B55ABD6DD7695EB6391 /* NSArray+Chameleon.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 2D10805A1729B26DCB2CAD52F2049BAF /* ZCShapeshiftLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = A0B3C6ED9393F5E55D698B677D8CC5F4 /* ZCShapeshiftLabel.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; 2DDDE2C06FB4DCC639CFD100F224D6FD /* UIColor+Chameleon.m in Sources */ = {isa = PBXBuildFile; fileRef = 684B3BBEA8FE40B07E0734FFA0F1E808 /* UIColor+Chameleon.m */; }; - 31355E6EC81B820199C659E233B4E9E8 /* ZCSpinLabel.h in Headers */ = {isa = PBXBuildFile; fileRef = 7FE69F7F97686AC4F7635939FA46FD4E /* ZCSpinLabel.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 36F23BEB8D59F2D7E929B65837955928 /* DispatchQueue+Hero.swift in Sources */ = {isa = PBXBuildFile; fileRef = 53F7BF54988B62579662B3EBF1570192 /* DispatchQueue+Hero.swift */; }; - 3A2A6EF6E339DA1B12A50A2B0CC24B13 /* CoreText.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 755FAE73277FCB766461DDF0A4841EC5 /* CoreText.framework */; }; - 3B7E296D2722377B0EB6FD076A716081 /* SourceIDPreprocessor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 32920F1C14AABE3E6324EB718DB4F22A /* SourceIDPreprocessor.swift */; }; + 2F7F43A4296932FB55CBA489E4D0508C /* ZCDuangLabel.h in Headers */ = {isa = PBXBuildFile; fileRef = 149058506A3D7F88DBFFA52312D9CF87 /* ZCDuangLabel.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 3B373CC3F8D9135D5422F0E1092CC6C9 /* ZCFlyinLabel.h in Headers */ = {isa = PBXBuildFile; fileRef = B306F35D55098B8275E41406708680C3 /* ZCFlyinLabel.h */; settings = {ATTRIBUTES = (Public, ); }; }; 3D08C4F4E2E65D192D317AED0A8237B3 /* UIColor+ChameleonPrivate.m in Sources */ = {isa = PBXBuildFile; fileRef = 4AFCDC269C1B04B7950F108514B9A002 /* UIColor+ChameleonPrivate.m */; }; - 3FF66D2B989569989DA1ECEF022D0911 /* ClearPreprocessor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7DDFB6D7D1D131792D16BCA568C70E07 /* ClearPreprocessor.swift */; }; - 40E1F04D4C2801329BB14841B24C005A /* ZCRevealLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = 8C1E8493C19D7AB4A77A873BC29D979F /* ZCRevealLabel.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; + 40183767C9BA63FB5F28CFD448568CF7 /* ZCAnimatedLabel.h in Headers */ = {isa = PBXBuildFile; fileRef = 945885D650D2539467D95A8A5338C137 /* ZCAnimatedLabel.h */; settings = {ATTRIBUTES = (Public, ); }; }; 44117424757A5E62D87B8BF4B41A4207 /* UIColor+ChameleonPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 56565CE08ADACD79CEA130925F0CDE8F /* UIColor+ChameleonPrivate.h */; settings = {ATTRIBUTES = (Public, ); }; }; 459048ECD9FAA42B77566EC56ECAD793 /* UINavigationController+Chameleon.m in Sources */ = {isa = PBXBuildFile; fileRef = F1C22F078BD061D6FC9619141BDA695E /* UINavigationController+Chameleon.m */; }; 4A7F6945FC35DB43E7C78876DD95CB2F /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 85FDCAA1EADCFD367E1698CDE25DE0DF /* UIKit.framework */; }; - 56989A7BF080012B0F0637436E6EABB0 /* ZCDashLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = A32E96E330F1BE794E0ACA67C394BA33 /* ZCDashLabel.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; - 598E88F95330D05C0D644897CEF4B469 /* ZCTransparencyLabel.h in Headers */ = {isa = PBXBuildFile; fileRef = BACBC4D8BC433BCFBAE3E48B295C5936 /* ZCTransparencyLabel.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 5BCC9986918F1504E617CF4EB6650D46 /* Hero-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = A95F120A3DF8F7A911658AE7298E614B /* Hero-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 4CC5AE1E0D4700767EC56DF7B8E2AE4D /* ZCFallLabel.h in Headers */ = {isa = PBXBuildFile; fileRef = 1B291C4D1C35D63E1383F43604CC8C2F /* ZCFallLabel.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 4F588C05B1BD6255AC3A7E1759D015B4 /* ZCFlyinLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = 10C119B874C2B68D6B332014EFA18131 /* ZCFlyinLabel.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; 5EA9F0ED011B06DEFA8542EEE72508C3 /* UIViewController+Chameleon.m in Sources */ = {isa = PBXBuildFile; fileRef = B3B9625BB8675FB84F57FAEC62E860DF /* UIViewController+Chameleon.m */; }; - 5FBDE142FFC1B2E3A8590427B8F1CBA9 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 85FDCAA1EADCFD367E1698CDE25DE0DF /* UIKit.framework */; }; 604286A8F8A2ACB063BDF97B09D4987C /* UILabel+Chameleon.h in Headers */ = {isa = PBXBuildFile; fileRef = 199950B620AFA6023EECBB662A39C21C /* UILabel+Chameleon.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 61288CA5CDDA4889540D904296FC9BF1 /* ZCEasingUtil.h in Headers */ = {isa = PBXBuildFile; fileRef = E4F249051A59B13F862BA33EFFEB0367 /* ZCEasingUtil.h */; settings = {ATTRIBUTES = (Public, ); }; }; 6712100A2CCB9B987281A02F6778473C /* NSArray+Chameleon.m in Sources */ = {isa = PBXBuildFile; fileRef = 841CB32EB317DF862FADB4C24E3C165D /* NSArray+Chameleon.m */; }; - 6F18AC21D391B19865742F811EC20202 /* ZCTransparencyLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = 2912F6D7A7878B823E4E2C679EBED4BE /* ZCTransparencyLabel.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; - 704C71A8D826D94BE3F463A1E39DDE08 /* HeroTypes.swift in Sources */ = {isa = PBXBuildFile; fileRef = 90410D05047B40B99B553954960BF82B /* HeroTypes.swift */; }; - 75B4A80CFC3A9C0B7D74139C31F980F1 /* ZCFocusLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = AFA3B00CC9CD7B05A1FCFA3B76888F46 /* ZCFocusLabel.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; + 6AA9E69CCB146EC7728EAF46A3A713AC /* ZCSpinLabel.h in Headers */ = {isa = PBXBuildFile; fileRef = 7FE69F7F97686AC4F7635939FA46FD4E /* ZCSpinLabel.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 6FE3836B8D9901EB160349215E388DA0 /* ZCFocusLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = AFA3B00CC9CD7B05A1FCFA3B76888F46 /* ZCFocusLabel.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; + 71F6B456484AFD3E66941D85EBC63AB4 /* ZCEasingUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = 806DCB81FA89BA89C35578AC443BC5FC /* ZCEasingUtil.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; + 7339345D8DDEF37E9F9F3BE9BAD6307B /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 30A48DB1C8052F1B842C0010D6FE3264 /* Foundation.framework */; }; + 75B759DB544D317A6FC88F4FD62AB5E2 /* ZCFocusLabel.h in Headers */ = {isa = PBXBuildFile; fileRef = BD543212607D8A21C5EEB4811E15E12B /* ZCFocusLabel.h */; settings = {ATTRIBUTES = (Public, ); }; }; 78281D8673FC507089FCFDC439DEDC16 /* Chameleon_.h in Headers */ = {isa = PBXBuildFile; fileRef = DFB89971EBD65901AAF884B6966F55F4 /* Chameleon_.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 7AE94C0C7BFD8A9C9530AED794BD0D8E /* ZCDuangLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = 09B6FDEB03B25BF401BC87859B831B3E /* ZCDuangLabel.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; - 7EC18B2353DEF54BB916A4DCCA03F524 /* ZCCoreTextLayout.h in Headers */ = {isa = PBXBuildFile; fileRef = 12E6564229CDFA3EDECF821FC24BC2FB /* ZCCoreTextLayout.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 7FBF3BEEC3253A81E1E145C76C89B83A /* ZCThrownLabel.h in Headers */ = {isa = PBXBuildFile; fileRef = DF7172E1472CD5DF0E3B9AA1D3A86108 /* ZCThrownLabel.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 784D05978A3F371754437833B6E3B223 /* ZCThrownLabel.h in Headers */ = {isa = PBXBuildFile; fileRef = DF7172E1472CD5DF0E3B9AA1D3A86108 /* ZCThrownLabel.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 7CA7C05EB721D0F876A6DAE12821675C /* ZCCoreTextLayout.h in Headers */ = {isa = PBXBuildFile; fileRef = 12E6564229CDFA3EDECF821FC24BC2FB /* ZCCoreTextLayout.h */; settings = {ATTRIBUTES = (Public, ); }; }; 833F15A28A0D562548517BCA8EAF23B6 /* ChameleonShorthand.swift in Sources */ = {isa = PBXBuildFile; fileRef = 29ED22738A029D4CFD71910614E10500 /* ChameleonShorthand.swift */; }; 83CFC8F573AD5B75191E162E64C7D039 /* UIButton+Chameleon.m in Sources */ = {isa = PBXBuildFile; fileRef = E730B04E8BAA5CA99E146F2D4FB86682 /* UIButton+Chameleon.m */; }; - 84C802C36B8B0B0B7914F21C63BFA45E /* ZCAnimatedLabel.h in Headers */ = {isa = PBXBuildFile; fileRef = 945885D650D2539467D95A8A5338C137 /* ZCAnimatedLabel.h */; settings = {ATTRIBUTES = (Public, ); }; }; 86F7D970F220974A0E26C3B632C5C74F /* UIImage+ChameleonPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 98A7FA881BD2F0AAE87C7A1383923B1E /* UIImage+ChameleonPrivate.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 87180A87859AD4B9B5656F52A3E64013 /* HeroContext.swift in Sources */ = {isa = PBXBuildFile; fileRef = 68F0DA52F9FD4863B90F36540967E1AC /* HeroContext.swift */; }; - 8888D8CD2B70C41CCD55AAEEA4FD25AC /* ZCEasingUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = 806DCB81FA89BA89C35578AC443BC5FC /* ZCEasingUtil.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; - 8E0CEB2CEE49A5BEE264A8EE54714EA7 /* ZCAnimatedLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = 3A315AB85F1FD18E70BB9A101498D6E9 /* ZCAnimatedLabel.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; 8ECF929AC5E737EBEB542283886D5E07 /* UIView+ChameleonPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = E11899316E3471F26E15C340B386EE8D /* UIView+ChameleonPrivate.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 8FDC07FBCD8EF555111482A3698ED4F7 /* ZCDuangLabel.h in Headers */ = {isa = PBXBuildFile; fileRef = 149058506A3D7F88DBFFA52312D9CF87 /* ZCDuangLabel.h */; settings = {ATTRIBUTES = (Public, ); }; }; 923369708790774BB768672AA79DCAD4 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 30A48DB1C8052F1B842C0010D6FE3264 /* Foundation.framework */; }; - 94F7E046C2602C8C4D634FF684B227F8 /* ZCFallLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = 6D2A3D8C3021B3B3CC33CC0E925CD1ED /* ZCFallLabel.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; + 9405A75288E8E96DACC18A6EEC420432 /* ZCTransparencyLabel.h in Headers */ = {isa = PBXBuildFile; fileRef = BACBC4D8BC433BCFBAE3E48B295C5936 /* ZCTransparencyLabel.h */; settings = {ATTRIBUTES = (Public, ); }; }; 95E542740750F827BE2EBE3DE6F62D0E /* ChameleonFramework-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D0FBC58AD637F7B0A7A1E4E5DF090DB /* ChameleonFramework-dummy.m */; }; - 96ADBD9B612F8A5B2A417A3BCED08B78 /* HeroDebugView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9ABC44921DBAFE81EDBF72413F25CA66 /* HeroDebugView.swift */; }; - 96E2D91886535313CCBDF853FEB03868 /* ZCShapeshiftLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = A0B3C6ED9393F5E55D698B677D8CC5F4 /* ZCShapeshiftLabel.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; + 960CCAF77BEB2BADB3EDF2B1D4F163ED /* ZCDashLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = A32E96E330F1BE794E0ACA67C394BA33 /* ZCDashLabel.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; + 9624DC1CBD9DA4A784590FFC193673FA /* Pods-HeroExamples-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = D4AF34292621395D6290871F5FB22E18 /* Pods-HeroExamples-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; 9A3EAF15D3C58FD56A552FD703A9154C /* ChameleonConstants.h in Headers */ = {isa = PBXBuildFile; fileRef = 6BA841517A854B30F7AC8B896BE29F62 /* ChameleonConstants.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 9ADBC3165E0411E5DFAAFE05C96EDC2D /* UIKit+HeroModifier.swift in Sources */ = {isa = PBXBuildFile; fileRef = BA962E8A0090A3F508472C2A41382DB4 /* UIKit+HeroModifier.swift */; }; 9B6AD39C81FAF37861FC0FEC41022146 /* UIAppearance+Swift.h in Headers */ = {isa = PBXBuildFile; fileRef = 8912F16BF2FEA16A2CE0D547636D8650 /* UIAppearance+Swift.h */; settings = {ATTRIBUTES = (Public, ); }; }; + A012023B35FBAC0F3BF4A79AB56F5BF8 /* ZCDuangLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = 09B6FDEB03B25BF401BC87859B831B3E /* ZCDuangLabel.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; A664D0A12D5F3DBD08A7E8DFE3AE83E2 /* UIView+ChameleonPrivate.m in Sources */ = {isa = PBXBuildFile; fileRef = AC11BE14A0EC12C71F91EE5621D4D7FB /* UIView+ChameleonPrivate.m */; }; - A6AC4C9DCE32429CE5D6CF2EAA3C52DE /* UIKit+Hero.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EA92FDB8DCF56BE10918981146E71D9 /* UIKit+Hero.swift */; }; - A6DA81627CEB670BBFBBAC365EEFBAF8 /* CascadePreprocessor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8A91722A49C98F39B7953A0624D18A0D /* CascadePreprocessor.swift */; }; - A918B9CE3AFC7CFE22502D0EDF36E827 /* ZCFallLabel.h in Headers */ = {isa = PBXBuildFile; fileRef = 1B291C4D1C35D63E1383F43604CC8C2F /* ZCFallLabel.h */; settings = {ATTRIBUTES = (Public, ); }; }; - AB80F4B71FE40B7325FE19FE7920BE1A /* ZCFlyinLabel.h in Headers */ = {isa = PBXBuildFile; fileRef = B306F35D55098B8275E41406708680C3 /* ZCFlyinLabel.h */; settings = {ATTRIBUTES = (Public, ); }; }; - ACF084933B3CBF65307BBC8484191FA0 /* ZCDashLabel.h in Headers */ = {isa = PBXBuildFile; fileRef = E61802497B0C82082771903678DD88F1 /* ZCDashLabel.h */; settings = {ATTRIBUTES = (Public, ); }; }; - B091706205DBEA2827284B7060E64096 /* ZCCoreTextLayout.m in Sources */ = {isa = PBXBuildFile; fileRef = 42395ED6C338D1F0111188ECCAC326C9 /* ZCCoreTextLayout.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; - B124B4A71E088BA9000F1DF2 /* CAMediaTimingFunction+Hero.swift in Sources */ = {isa = PBXBuildFile; fileRef = B124B4A61E088BA9000F1DF2 /* CAMediaTimingFunction+Hero.swift */; }; + AB38B3EC8E11AAC3E79CCA2055C602DA /* ZCAnimatedLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = 3A315AB85F1FD18E70BB9A101498D6E9 /* ZCAnimatedLabel.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; B26038F91C7C4CC322D7F25C5D16FE9E /* ChameleonConstants.m in Sources */ = {isa = PBXBuildFile; fileRef = 0164C4141F6109C4519447CEFDCDA6FB /* ChameleonConstants.m */; }; B4EA53699AA19822E674188743266B2B /* ChameleonMacros.h in Headers */ = {isa = PBXBuildFile; fileRef = 25530C1B2B3BCE67679DE2C38D8C8C3F /* ChameleonMacros.h */; settings = {ATTRIBUTES = (Public, ); }; }; - B9A618F6A32F37FCCB911669072ADAD1 /* HeroDefaultAnimator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 009813FF767BFAE2357DA856652EEEE7 /* HeroDefaultAnimator.swift */; }; - BAFF28FB3D799010C983A03EE434F262 /* HeroPlugin.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9D2EF3BAF433FDE6F713EC6723EF776C /* HeroPlugin.swift */; }; - BBACBB79A5CCE24F3BF31BEFDADD80DA /* ViewToViewPreprocessor.swift in Sources */ = {isa = PBXBuildFile; fileRef = EAF1CB44B1532BE35326641A01B38EA5 /* ViewToViewPreprocessor.swift */; }; + B6634AF86577EB63DA3CBEFE68A13573 /* ZCCoreTextLayout.m in Sources */ = {isa = PBXBuildFile; fileRef = 42395ED6C338D1F0111188ECCAC326C9 /* ZCCoreTextLayout.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; + BA46D138629B5BEEF5C8CA4F5DA78B6D /* ZCRevealLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = 8C1E8493C19D7AB4A77A873BC29D979F /* ZCRevealLabel.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; BFA97401155C4E14893D9AA1E0D1EC80 /* UINavigationController+Chameleon.h in Headers */ = {isa = PBXBuildFile; fileRef = 853F453005035573EC726155007906F9 /* UINavigationController+Chameleon.h */; settings = {ATTRIBUTES = (Public, ); }; }; C3C8BB46937DD0BBC7FBE25E298052F8 /* UIAppearance+Swift.m in Sources */ = {isa = PBXBuildFile; fileRef = 309488F2CA6890AD49370D9E0EA62F8B /* UIAppearance+Swift.m */; }; C78AC9DF55C43B62D6851B2F30ADFE0F /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A9584A1F2D6F127A85944AD33BEA278D /* QuartzCore.framework */; }; - CA19F7D3C407140A4858D71B94EDC523 /* Hero.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8ACA52D8C3BB32DE76F65BE7A770A52F /* Hero.swift */; }; - D195064586817A705F5068D1D98BB120 /* ZCFlyinLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = 10C119B874C2B68D6B332014EFA18131 /* ZCFlyinLabel.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; - D5E5ADEB4403273789A474E1C63E3B40 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 30A48DB1C8052F1B842C0010D6FE3264 /* Foundation.framework */; }; + D108846C0C9F02A453FF05BFE72C4FB9 /* ZCEasingUtil.h in Headers */ = {isa = PBXBuildFile; fileRef = E4F249051A59B13F862BA33EFFEB0367 /* ZCEasingUtil.h */; settings = {ATTRIBUTES = (Public, ); }; }; D5FAFC3C89B922BB4FFB6C0516EAF3D2 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 29AA6E4C10206C3EE9ADFA1D694F1143 /* CoreGraphics.framework */; }; + D8FB33073243D5B9EABA87B6CAF63577 /* ZCDashLabel.h in Headers */ = {isa = PBXBuildFile; fileRef = E61802497B0C82082771903678DD88F1 /* ZCDashLabel.h */; settings = {ATTRIBUTES = (Public, ); }; }; DB5FB611FB6EBF2F2BA7B78FE0CED535 /* UIColor+Chameleon.h in Headers */ = {isa = PBXBuildFile; fileRef = 9CBEE5386B8B380653B94BEEC01149D8 /* UIColor+Chameleon.h */; settings = {ATTRIBUTES = (Public, ); }; }; - E1022C5C4A3C042F96C462A4B3E8EA21 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 30A48DB1C8052F1B842C0010D6FE3264 /* Foundation.framework */; }; - E20A79E671B33606667295F34A119208 /* ZCRevealLabel.h in Headers */ = {isa = PBXBuildFile; fileRef = A342FA1E8FD5F3163DC753B8A3400FAF /* ZCRevealLabel.h */; settings = {ATTRIBUTES = (Public, ); }; }; + DBACA9BDB5867F71DBA6D4B76672E14B /* ZCThrownLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = 5B9D36B2F41D2F7FDA079D725D8A9EF5 /* ZCThrownLabel.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; + E4CE7C740C5F7853AF4A1BD5A538809A /* ZCTransparencyLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = 2912F6D7A7878B823E4E2C679EBED4BE /* ZCTransparencyLabel.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; E7FA38FEAF957D69E92153FBAFB3DB40 /* Chameleon_.m in Sources */ = {isa = PBXBuildFile; fileRef = FEEBB0283FFCA5CD75F9CC2C7C125F5B /* Chameleon_.m */; }; - E98CB055BAE498D0F4FF48EC17BD49BD /* ZCFocusLabel.h in Headers */ = {isa = PBXBuildFile; fileRef = BD543212607D8A21C5EEB4811E15E12B /* ZCFocusLabel.h */; settings = {ATTRIBUTES = (Public, ); }; }; - EB192542076198CC9C636DDFCCF28D64 /* Hero-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = AAB5D7770B86F43276F1BBFAE8E0B8E7 /* Hero-dummy.m */; }; + EA8ED001B68683130409A4E5F037CB41 /* ZCRevealLabel.h in Headers */ = {isa = PBXBuildFile; fileRef = A342FA1E8FD5F3163DC753B8A3400FAF /* ZCRevealLabel.h */; settings = {ATTRIBUTES = (Public, ); }; }; EC786817C5CEBCD51A4C9EC9B883ED6F /* ChameleonEnums.h in Headers */ = {isa = PBXBuildFile; fileRef = F61DEE17DAC8E639AEAA3D2E97C85C8F /* ChameleonEnums.h */; settings = {ATTRIBUTES = (Public, ); }; }; ED4DBD1E13182AA813DC1237FA6E3A42 /* Chameleon.h in Headers */ = {isa = PBXBuildFile; fileRef = ACC1D3350CBFB86A70E6108AA2C11DBD /* Chameleon.h */; settings = {ATTRIBUTES = (Public, ); }; }; - EE4A11526BB34938AF78ACAC8287EED6 /* ZCSpinLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = 9C580D132560EC3A7BBD0CBD16755E73 /* ZCSpinLabel.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; - F34ADE4638ABE9E687A005E1B4CCD2A0 /* HeroDebugPlugin.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7260E6E6BC54C60E14338D44CDBA0DD9 /* HeroDebugPlugin.swift */; }; - F7F904D5F0888B42AC9D326693754CE0 /* Pods-HeroExamples-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = AC559FE89B18815721B5D20117D33F86 /* Pods-HeroExamples-dummy.m */; }; - F8B85EC3663D1642EDB609E95E8D6581 /* ZCAnimatedLabel-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 4AE5CC8638DDC6FA930E5F3F2249945F /* ZCAnimatedLabel-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; + F19137375616A184266131B0D97BE794 /* ZCFallLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = 6D2A3D8C3021B3B3CC33CC0E925CD1ED /* ZCFallLabel.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; + F4E466CB3B33261D3255B35C06C8DC95 /* ZCShapeshiftLabel.h in Headers */ = {isa = PBXBuildFile; fileRef = 466CFD0F91016EAA8F1AC59F4CB3C975 /* ZCShapeshiftLabel.h */; settings = {ATTRIBUTES = (Public, ); }; }; + F6D9178D7BBB6675E4DDDAE9DD87D325 /* ZCAnimatedLabel-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E36AE8CE3D808B3D2BBB747744D39E5 /* ZCAnimatedLabel-dummy.m */; }; FB82C1293D7DDE0D3E2E6D68CDD5852C /* UILabel+Chameleon.m in Sources */ = {isa = PBXBuildFile; fileRef = 502E8EB2D178C4E9DB21BDFAFADB9130 /* UILabel+Chameleon.m */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ - 245352CA6AFF23A62ECC1E35BB9694B8 /* PBXContainerItemProxy */ = { + 09A396E97BB7A660275B043DDC407900 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; proxyType = 1; - remoteGlobalIDString = 76BD4592010354D6C23D6ECCA20D83A8; - remoteInfo = ChameleonFramework; - }; - 7F4216B15DEB10177912225474EB288A /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; - proxyType = 1; - remoteGlobalIDString = B436B44CA163743182E74F03DB0B4F59; + remoteGlobalIDString = 490E5E24AF399729C67683ABA7BCA188; remoteInfo = ZCAnimatedLabel; }; - DE1EA60457BEF29998CDCB4A2EF25F52 /* PBXContainerItemProxy */ = { + 77ABD4CB4FB134B9A8C14A7B7F0C50CF /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; proxyType = 1; - remoteGlobalIDString = 34CAC580BFE6FB5B89353906FD6A8BDB; - remoteInfo = Hero; + remoteGlobalIDString = 76BD4592010354D6C23D6ECCA20D83A8; + remoteInfo = ChameleonFramework; }; /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ - 000FFED8AE29139132224FB47C7369A3 /* ChameleonFramework.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = ChameleonFramework.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 009813FF767BFAE2357DA856652EEEE7 /* HeroDefaultAnimator.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = HeroDefaultAnimator.swift; sourceTree = ""; }; 0164C4141F6109C4519447CEFDCDA6FB /* ChameleonConstants.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = ChameleonConstants.m; path = "Pod/Classes/Objective-C/ChameleonConstants.m"; sourceTree = ""; }; - 04B4B451E46FE346E8A820607BBA2324 /* Hero.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Hero.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 05D5FC5FA136B6E87C98475AFD6BA61F /* ZCAnimatedLabel.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = ZCAnimatedLabel.framework; path = ZCAnimatedLabel.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 09B6FDEB03B25BF401BC87859B831B3E /* ZCDuangLabel.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = ZCDuangLabel.m; path = ZCAnimatedLabel/ZCAnimatedLabel/ZCDuangLabel.m; sourceTree = ""; }; 10C119B874C2B68D6B332014EFA18131 /* ZCFlyinLabel.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = ZCFlyinLabel.m; path = ZCAnimatedLabel/ZCAnimatedLabel/ZCFlyinLabel.m; sourceTree = ""; }; 12E6564229CDFA3EDECF821FC24BC2FB /* ZCCoreTextLayout.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = ZCCoreTextLayout.h; path = ZCAnimatedLabel/ZCAnimatedLabel/ZCCoreTextLayout.h; sourceTree = ""; }; - 13B1997AE73788E0828CFE4A1981F4D2 /* ChameleonFramework.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "sourcecode.module-map"; path = ChameleonFramework.modulemap; sourceTree = ""; }; + 13B1997AE73788E0828CFE4A1981F4D2 /* ChameleonFramework.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; path = ChameleonFramework.modulemap; sourceTree = ""; }; 149058506A3D7F88DBFFA52312D9CF87 /* ZCDuangLabel.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = ZCDuangLabel.h; path = ZCAnimatedLabel/ZCAnimatedLabel/ZCDuangLabel.h; sourceTree = ""; }; 199950B620AFA6023EECBB662A39C21C /* UILabel+Chameleon.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UILabel+Chameleon.h"; path = "Pod/Classes/Objective-C/UILabel+Chameleon.h"; sourceTree = ""; }; 1B291C4D1C35D63E1383F43604CC8C2F /* ZCFallLabel.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = ZCFallLabel.h; path = ZCAnimatedLabel/ZCAnimatedLabel/ZCFallLabel.h; sourceTree = ""; }; @@ -136,82 +107,63 @@ 249396FDAC8EA68585107165DBA9CB04 /* Pods-HeroExamples-resources.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-HeroExamples-resources.sh"; sourceTree = ""; }; 25530C1B2B3BCE67679DE2C38D8C8C3F /* ChameleonMacros.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = ChameleonMacros.h; path = "Pod/Classes/Objective-C/ChameleonMacros.h"; sourceTree = ""; }; 25E1EDDCE040959CC53590068A28370F /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 25E81D1F1DA468EA8BCC84BFA1C7AFE8 /* Hero.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = Hero.xcconfig; sourceTree = ""; }; 2912F6D7A7878B823E4E2C679EBED4BE /* ZCTransparencyLabel.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = ZCTransparencyLabel.m; path = ZCAnimatedLabel/ZCAnimatedLabel/ZCTransparencyLabel.m; sourceTree = ""; }; 29AA6E4C10206C3EE9ADFA1D694F1143 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.0.sdk/System/Library/Frameworks/CoreGraphics.framework; sourceTree = DEVELOPER_DIR; }; 29ED22738A029D4CFD71910614E10500 /* ChameleonShorthand.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ChameleonShorthand.swift; path = Pod/Classes/Swift/ChameleonShorthand.swift; sourceTree = ""; }; - 2AC1EA5EC1766240ED7A07183EE68CDC /* Hero-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Hero-prefix.pch"; sourceTree = ""; }; 2D08E6EF907DC1A59FDCEF6049D41EBB /* Pods-HeroExamples-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-HeroExamples-acknowledgements.plist"; sourceTree = ""; }; 2E05326F7CD25B55ABD6DD7695EB6391 /* NSArray+Chameleon.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "NSArray+Chameleon.h"; path = "Pod/Classes/Objective-C/NSArray+Chameleon.h"; sourceTree = ""; }; 303FC65376AD824AF269B17A715AB4D0 /* UIViewController+Chameleon.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIViewController+Chameleon.h"; path = "Pod/Classes/Objective-C/UIViewController+Chameleon.h"; sourceTree = ""; }; 309488F2CA6890AD49370D9E0EA62F8B /* UIAppearance+Swift.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIAppearance+Swift.m"; path = "Pod/Classes/Objective-C/UIAppearance+Swift.m"; sourceTree = ""; }; 30A48DB1C8052F1B842C0010D6FE3264 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.0.sdk/System/Library/Frameworks/Foundation.framework; sourceTree = DEVELOPER_DIR; }; - 32920F1C14AABE3E6324EB718DB4F22A /* SourceIDPreprocessor.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = SourceIDPreprocessor.swift; sourceTree = ""; }; 3896DF0A366E247168F1BD9BF0FF7C43 /* ChameleonFramework-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "ChameleonFramework-prefix.pch"; sourceTree = ""; }; 3A092FCC9003B561AE8D5B50EE5A0AFC /* UIButton+Chameleon.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIButton+Chameleon.h"; path = "Pod/Classes/Objective-C/UIButton+Chameleon.h"; sourceTree = ""; }; 3A315AB85F1FD18E70BB9A101498D6E9 /* ZCAnimatedLabel.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = ZCAnimatedLabel.m; path = ZCAnimatedLabel/ZCAnimatedLabel/ZCAnimatedLabel.m; sourceTree = ""; }; 42395ED6C338D1F0111188ECCAC326C9 /* ZCCoreTextLayout.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = ZCCoreTextLayout.m; path = ZCAnimatedLabel/ZCAnimatedLabel/ZCCoreTextLayout.m; sourceTree = ""; }; - 42B1EBC88025BDEAEE57374191E3343F /* Pods_HeroExamples.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_HeroExamples.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 466CFD0F91016EAA8F1AC59F4CB3C975 /* ZCShapeshiftLabel.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = ZCShapeshiftLabel.h; path = ZCAnimatedLabel/ZCAnimatedLabel/ZCShapeshiftLabel.h; sourceTree = ""; }; 4AE5CC8638DDC6FA930E5F3F2249945F /* ZCAnimatedLabel-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "ZCAnimatedLabel-umbrella.h"; sourceTree = ""; }; 4AFCDC269C1B04B7950F108514B9A002 /* UIColor+ChameleonPrivate.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIColor+ChameleonPrivate.m"; path = "Pod/Classes/Objective-C/UIColor+ChameleonPrivate.m"; sourceTree = ""; }; 4E36AE8CE3D808B3D2BBB747744D39E5 /* ZCAnimatedLabel-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "ZCAnimatedLabel-dummy.m"; sourceTree = ""; }; - 4EA92FDB8DCF56BE10918981146E71D9 /* UIKit+Hero.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = "UIKit+Hero.swift"; sourceTree = ""; }; 502E8EB2D178C4E9DB21BDFAFADB9130 /* UILabel+Chameleon.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UILabel+Chameleon.m"; path = "Pod/Classes/Objective-C/UILabel+Chameleon.m"; sourceTree = ""; }; 517F35FE8BE6A3CBA4B88B1520C74C06 /* Pods-HeroExamples.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-HeroExamples.debug.xcconfig"; sourceTree = ""; }; - 53F7BF54988B62579662B3EBF1570192 /* DispatchQueue+Hero.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = "DispatchQueue+Hero.swift"; sourceTree = ""; }; + 55CBDB5ADC53AD92DC1BD1FA43BDD7F1 /* ChameleonFramework.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = ChameleonFramework.framework; path = ChameleonFramework.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 56565CE08ADACD79CEA130925F0CDE8F /* UIColor+ChameleonPrivate.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIColor+ChameleonPrivate.h"; path = "Pod/Classes/Objective-C/UIColor+ChameleonPrivate.h"; sourceTree = ""; }; 5B9D36B2F41D2F7FDA079D725D8A9EF5 /* ZCThrownLabel.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = ZCThrownLabel.m; path = ZCAnimatedLabel/ZCAnimatedLabel/ZCThrownLabel.m; sourceTree = ""; }; 684B3BBEA8FE40B07E0734FFA0F1E808 /* UIColor+Chameleon.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIColor+Chameleon.m"; path = "Pod/Classes/Objective-C/UIColor+Chameleon.m"; sourceTree = ""; }; - 68F0DA52F9FD4863B90F36540967E1AC /* HeroContext.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = HeroContext.swift; sourceTree = ""; }; 6BA841517A854B30F7AC8B896BE29F62 /* ChameleonConstants.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = ChameleonConstants.h; path = "Pod/Classes/Objective-C/ChameleonConstants.h"; sourceTree = ""; }; 6D2A3D8C3021B3B3CC33CC0E925CD1ED /* ZCFallLabel.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = ZCFallLabel.m; path = ZCAnimatedLabel/ZCAnimatedLabel/ZCFallLabel.m; sourceTree = ""; }; 6FB43588D8877F1F909F697476508F4F /* Pods-HeroExamples.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-HeroExamples.release.xcconfig"; sourceTree = ""; }; - 7260E6E6BC54C60E14338D44CDBA0DD9 /* HeroDebugPlugin.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = HeroDebugPlugin.swift; sourceTree = ""; }; 755FAE73277FCB766461DDF0A4841EC5 /* CoreText.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreText.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.0.sdk/System/Library/Frameworks/CoreText.framework; sourceTree = DEVELOPER_DIR; }; 7D0FBC58AD637F7B0A7A1E4E5DF090DB /* ChameleonFramework-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "ChameleonFramework-dummy.m"; sourceTree = ""; }; - 7DDFB6D7D1D131792D16BCA568C70E07 /* ClearPreprocessor.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ClearPreprocessor.swift; sourceTree = ""; }; 7FE69F7F97686AC4F7635939FA46FD4E /* ZCSpinLabel.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = ZCSpinLabel.h; path = ZCAnimatedLabel/ZCAnimatedLabel/ZCSpinLabel.h; sourceTree = ""; }; 806DCB81FA89BA89C35578AC443BC5FC /* ZCEasingUtil.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = ZCEasingUtil.m; path = ZCAnimatedLabel/ZCAnimatedLabel/ZCEasingUtil.m; sourceTree = ""; }; 841CB32EB317DF862FADB4C24E3C165D /* NSArray+Chameleon.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "NSArray+Chameleon.m"; path = "Pod/Classes/Objective-C/NSArray+Chameleon.m"; sourceTree = ""; }; 853F453005035573EC726155007906F9 /* UINavigationController+Chameleon.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UINavigationController+Chameleon.h"; path = "Pod/Classes/Objective-C/UINavigationController+Chameleon.h"; sourceTree = ""; }; 85FDCAA1EADCFD367E1698CDE25DE0DF /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.0.sdk/System/Library/Frameworks/UIKit.framework; sourceTree = DEVELOPER_DIR; }; 8912F16BF2FEA16A2CE0D547636D8650 /* UIAppearance+Swift.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIAppearance+Swift.h"; path = "Pod/Classes/Objective-C/UIAppearance+Swift.h"; sourceTree = ""; }; - 8A91722A49C98F39B7953A0624D18A0D /* CascadePreprocessor.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = CascadePreprocessor.swift; sourceTree = ""; }; - 8ACA52D8C3BB32DE76F65BE7A770A52F /* Hero.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Hero.swift; sourceTree = ""; }; 8C1E8493C19D7AB4A77A873BC29D979F /* ZCRevealLabel.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = ZCRevealLabel.m; path = ZCAnimatedLabel/ZCAnimatedLabel/ZCRevealLabel.m; sourceTree = ""; }; - 90410D05047B40B99B553954960BF82B /* HeroTypes.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = HeroTypes.swift; sourceTree = ""; }; - 93A4A3777CF96A4AAC1D13BA6DCCEA73 /* Podfile */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; name = Podfile; path = ../Podfile; sourceTree = SOURCE_ROOT; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; + 93A4A3777CF96A4AAC1D13BA6DCCEA73 /* Podfile */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; lastKnownFileType = text; name = Podfile; path = ../Podfile; sourceTree = SOURCE_ROOT; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; 945885D650D2539467D95A8A5338C137 /* ZCAnimatedLabel.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = ZCAnimatedLabel.h; path = ZCAnimatedLabel/ZCAnimatedLabel/ZCAnimatedLabel.h; sourceTree = ""; }; - 96F2151CA6ADD851CD6FFD62A544FFBF /* ZCAnimatedLabel.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = ZCAnimatedLabel.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 986CEB14912C0A5CC97835230B574521 /* Hero.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "sourcecode.module-map"; path = Hero.modulemap; sourceTree = ""; }; 98A7FA881BD2F0AAE87C7A1383923B1E /* UIImage+ChameleonPrivate.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIImage+ChameleonPrivate.h"; path = "Pod/Classes/Objective-C/UIImage+ChameleonPrivate.h"; sourceTree = ""; }; - 9ABC44921DBAFE81EDBF72413F25CA66 /* HeroDebugView.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = HeroDebugView.swift; sourceTree = ""; }; 9C580D132560EC3A7BBD0CBD16755E73 /* ZCSpinLabel.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = ZCSpinLabel.m; path = ZCAnimatedLabel/ZCAnimatedLabel/ZCSpinLabel.m; sourceTree = ""; }; 9CBEE5386B8B380653B94BEEC01149D8 /* UIColor+Chameleon.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIColor+Chameleon.h"; path = "Pod/Classes/Objective-C/UIColor+Chameleon.h"; sourceTree = ""; }; - 9D2EF3BAF433FDE6F713EC6723EF776C /* HeroPlugin.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = HeroPlugin.swift; sourceTree = ""; }; A0B3C6ED9393F5E55D698B677D8CC5F4 /* ZCShapeshiftLabel.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = ZCShapeshiftLabel.m; path = ZCAnimatedLabel/ZCAnimatedLabel/ZCShapeshiftLabel.m; sourceTree = ""; }; A32E96E330F1BE794E0ACA67C394BA33 /* ZCDashLabel.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = ZCDashLabel.m; path = ZCAnimatedLabel/ZCAnimatedLabel/ZCDashLabel.m; sourceTree = ""; }; A342FA1E8FD5F3163DC753B8A3400FAF /* ZCRevealLabel.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = ZCRevealLabel.h; path = ZCAnimatedLabel/ZCAnimatedLabel/ZCRevealLabel.h; sourceTree = ""; }; A5484756A421B1C208D66F6701E1925E /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; A860B4A3090B5CB38F4D6EE2285600A1 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; A9584A1F2D6F127A85944AD33BEA278D /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.0.sdk/System/Library/Frameworks/QuartzCore.framework; sourceTree = DEVELOPER_DIR; }; - A95F120A3DF8F7A911658AE7298E614B /* Hero-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Hero-umbrella.h"; sourceTree = ""; }; - AAB5D7770B86F43276F1BBFAE8E0B8E7 /* Hero-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Hero-dummy.m"; sourceTree = ""; }; AC11BE14A0EC12C71F91EE5621D4D7FB /* UIView+ChameleonPrivate.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIView+ChameleonPrivate.m"; path = "Pod/Classes/Objective-C/UIView+ChameleonPrivate.m"; sourceTree = ""; }; AC559FE89B18815721B5D20117D33F86 /* Pods-HeroExamples-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-HeroExamples-dummy.m"; sourceTree = ""; }; ACC1D3350CBFB86A70E6108AA2C11DBD /* Chameleon.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = Chameleon.h; path = "Pod/Classes/Objective-C/Chameleon.h"; sourceTree = ""; }; + AF5C12431F9BD2452D57C998BC489B87 /* Pods_HeroExamples.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = Pods_HeroExamples.framework; path = "Pods-HeroExamples.framework"; sourceTree = BUILT_PRODUCTS_DIR; }; AFA3B00CC9CD7B05A1FCFA3B76888F46 /* ZCFocusLabel.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = ZCFocusLabel.m; path = ZCAnimatedLabel/ZCAnimatedLabel/ZCFocusLabel.m; sourceTree = ""; }; - B124B4A61E088BA9000F1DF2 /* CAMediaTimingFunction+Hero.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "CAMediaTimingFunction+Hero.swift"; sourceTree = ""; }; B306F35D55098B8275E41406708680C3 /* ZCFlyinLabel.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = ZCFlyinLabel.h; path = ZCAnimatedLabel/ZCAnimatedLabel/ZCFlyinLabel.h; sourceTree = ""; }; B3B9625BB8675FB84F57FAEC62E860DF /* UIViewController+Chameleon.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIViewController+Chameleon.m"; path = "Pod/Classes/Objective-C/UIViewController+Chameleon.m"; sourceTree = ""; }; B7845278D818AA0933253B32BF79AB28 /* ZCAnimatedLabel.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = ZCAnimatedLabel.xcconfig; sourceTree = ""; }; BA76828CEBD20FDAA51A6DEB482396DF /* ZCAnimatedLabel-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "ZCAnimatedLabel-prefix.pch"; sourceTree = ""; }; - BA962E8A0090A3F508472C2A41382DB4 /* UIKit+HeroModifier.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = "UIKit+HeroModifier.swift"; sourceTree = ""; }; BACBC4D8BC433BCFBAE3E48B295C5936 /* ZCTransparencyLabel.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = ZCTransparencyLabel.h; path = ZCAnimatedLabel/ZCAnimatedLabel/ZCTransparencyLabel.h; sourceTree = ""; }; BD543212607D8A21C5EEB4811E15E12B /* ZCFocusLabel.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = ZCFocusLabel.h; path = ZCAnimatedLabel/ZCAnimatedLabel/ZCFocusLabel.h; sourceTree = ""; }; CC2CFD70B28BCDBE2960C9BB229C1063 /* Pods-HeroExamples-frameworks.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-HeroExamples-frameworks.sh"; sourceTree = ""; }; - CE24B0464741DFDE4ADE1C4012D723D6 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; D163A5D38971FE50288730B3F9E7853E /* Pods-HeroExamples-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-HeroExamples-acknowledgements.markdown"; sourceTree = ""; }; D4AF34292621395D6290871F5FB22E18 /* Pods-HeroExamples-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-HeroExamples-umbrella.h"; sourceTree = ""; }; DF7172E1472CD5DF0E3B9AA1D3A86108 /* ZCThrownLabel.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = ZCThrownLabel.h; path = ZCAnimatedLabel/ZCAnimatedLabel/ZCThrownLabel.h; sourceTree = ""; }; @@ -221,40 +173,29 @@ E4F249051A59B13F862BA33EFFEB0367 /* ZCEasingUtil.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = ZCEasingUtil.h; path = ZCAnimatedLabel/ZCAnimatedLabel/ZCEasingUtil.h; sourceTree = ""; }; E61802497B0C82082771903678DD88F1 /* ZCDashLabel.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = ZCDashLabel.h; path = ZCAnimatedLabel/ZCAnimatedLabel/ZCDashLabel.h; sourceTree = ""; }; E730B04E8BAA5CA99E146F2D4FB86682 /* UIButton+Chameleon.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIButton+Chameleon.m"; path = "Pod/Classes/Objective-C/UIButton+Chameleon.m"; sourceTree = ""; }; - EAF1CB44B1532BE35326641A01B38EA5 /* ViewToViewPreprocessor.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ViewToViewPreprocessor.swift; sourceTree = ""; }; - EC8209DC44A71100F992B0E93FC1DCED /* Pods-HeroExamples.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "sourcecode.module-map"; path = "Pods-HeroExamples.modulemap"; sourceTree = ""; }; - EE32F908C4EAEBC2AC2FBE19CE93A06F /* ZCAnimatedLabel.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "sourcecode.module-map"; path = ZCAnimatedLabel.modulemap; sourceTree = ""; }; + EC8209DC44A71100F992B0E93FC1DCED /* Pods-HeroExamples.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; path = "Pods-HeroExamples.modulemap"; sourceTree = ""; }; + EE32F908C4EAEBC2AC2FBE19CE93A06F /* ZCAnimatedLabel.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; path = ZCAnimatedLabel.modulemap; sourceTree = ""; }; F1C22F078BD061D6FC9619141BDA695E /* UINavigationController+Chameleon.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UINavigationController+Chameleon.m"; path = "Pod/Classes/Objective-C/UINavigationController+Chameleon.m"; sourceTree = ""; }; F421C1312F9063105A65D64D8C5BE410 /* ChameleonFramework-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "ChameleonFramework-umbrella.h"; sourceTree = ""; }; F61DEE17DAC8E639AEAA3D2E97C85C8F /* ChameleonEnums.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = ChameleonEnums.h; path = "Pod/Classes/Objective-C/ChameleonEnums.h"; sourceTree = ""; }; - F9DF90DEF699C530738BF36F7EC08F4A /* CG+Hero.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = "CG+Hero.swift"; sourceTree = ""; }; FEEBB0283FFCA5CD75F9CC2C7C125F5B /* Chameleon_.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = Chameleon_.m; path = "Pod/Classes/Objective-C/Chameleon_.m"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ - 6166ADA80389AD66671E542588B0200F /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 192A0E280366B70ECE34DF53AB848141 /* Foundation.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 7D3CA10DC6DF3B63540C238462F12A0A /* Frameworks */ = { + 56918A26D3EDEB26C2F9B122E03E4A9A /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 3A2A6EF6E339DA1B12A50A2B0CC24B13 /* CoreText.framework in Frameworks */, - D5E5ADEB4403273789A474E1C63E3B40 /* Foundation.framework in Frameworks */, + 0FAA11918BC2377E39A877BC142D1EEF /* CoreText.framework in Frameworks */, + 7339345D8DDEF37E9F9F3BE9BAD6307B /* Foundation.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; - 820E8595182530888B7482019009B2E3 /* Frameworks */ = { + 6C53D9EC51356AF2D5EF37FD114A9C08 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - E1022C5C4A3C042F96C462A4B3E8EA21 /* Foundation.framework in Frameworks */, - 5FBDE142FFC1B2E3A8590427B8F1CBA9 /* UIKit.framework in Frameworks */, + 0B60DAA4D34F3C74E1142883A12A8CC2 /* Foundation.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -289,6 +230,16 @@ name = Frameworks; sourceTree = ""; }; + 23024C222F96A4C7A30040F108850DAB /* Products */ = { + isa = PBXGroup; + children = ( + 55CBDB5ADC53AD92DC1BD1FA43BDD7F1 /* ChameleonFramework.framework */, + AF5C12431F9BD2452D57C998BC489B87 /* Pods_HeroExamples.framework */, + 05D5FC5FA136B6E87C98475AFD6BA61F /* ZCAnimatedLabel.framework */, + ); + name = Products; + sourceTree = ""; + }; 26D4D8D146F8FF003C9F396BE371507C /* Support Files */ = { isa = PBXGroup; children = ( @@ -303,16 +254,6 @@ path = "../Target Support Files/ZCAnimatedLabel"; sourceTree = ""; }; - 3148AE0190732B0ED0D4A96EC91E2B71 /* Hero */ = { - isa = PBXGroup; - children = ( - B80688D35CCC8E586B9252714D22B0F5 /* Hero */, - A36711A225638A61BA6B6D13C26773F8 /* Support Files */, - ); - name = Hero; - path = ../..; - sourceTree = ""; - }; 5A368960F16AE172AEBEFA66355F1949 /* ZCAnimatedLabel */ = { isa = PBXGroup; children = ( @@ -344,28 +285,17 @@ 2912F6D7A7878B823E4E2C679EBED4BE /* ZCTransparencyLabel.m */, 26D4D8D146F8FF003C9F396BE371507C /* Support Files */, ); + name = ZCAnimatedLabel; path = ZCAnimatedLabel; sourceTree = ""; }; - 7BADC0D894845F24A1D8CEB9B900AF72 /* Products */ = { - isa = PBXGroup; - children = ( - 000FFED8AE29139132224FB47C7369A3 /* ChameleonFramework.framework */, - 04B4B451E46FE346E8A820607BBA2324 /* Hero.framework */, - 42B1EBC88025BDEAEE57374191E3343F /* Pods_HeroExamples.framework */, - 96F2151CA6ADD851CD6FFD62A544FFBF /* ZCAnimatedLabel.framework */, - ); - name = Products; - sourceTree = ""; - }; 7DB346D0F39D3F0E887471402A8071AB = { isa = PBXGroup; children = ( 93A4A3777CF96A4AAC1D13BA6DCCEA73 /* Podfile */, - 96986CABABC609D6641C2A096D230EBB /* Development Pods */, 20B56609144CE204DFA8221F742B2D76 /* Frameworks */, 015645E6E1E42B85671CCD2A977F63CA /* Pods */, - 7BADC0D894845F24A1D8CEB9B900AF72 /* Products */, + 23024C222F96A4C7A30040F108850DAB /* Products */, FEEC84FF8B3525185BE4BC0AC296A884 /* Targets Support Files */, ); sourceTree = ""; @@ -404,60 +334,6 @@ name = Default; sourceTree = ""; }; - 96986CABABC609D6641C2A096D230EBB /* Development Pods */ = { - isa = PBXGroup; - children = ( - 3148AE0190732B0ED0D4A96EC91E2B71 /* Hero */, - ); - name = "Development Pods"; - sourceTree = ""; - }; - A36711A225638A61BA6B6D13C26773F8 /* Support Files */ = { - isa = PBXGroup; - children = ( - 986CEB14912C0A5CC97835230B574521 /* Hero.modulemap */, - 25E81D1F1DA468EA8BCC84BFA1C7AFE8 /* Hero.xcconfig */, - AAB5D7770B86F43276F1BBFAE8E0B8E7 /* Hero-dummy.m */, - 2AC1EA5EC1766240ED7A07183EE68CDC /* Hero-prefix.pch */, - A95F120A3DF8F7A911658AE7298E614B /* Hero-umbrella.h */, - CE24B0464741DFDE4ADE1C4012D723D6 /* Info.plist */, - ); - name = "Support Files"; - path = "Examples/Pods/Target Support Files/Hero"; - sourceTree = ""; - }; - A378508E1E083BC6002854A8 /* Preprocessors */ = { - isa = PBXGroup; - children = ( - 8A91722A49C98F39B7953A0624D18A0D /* CascadePreprocessor.swift */, - 7DDFB6D7D1D131792D16BCA568C70E07 /* ClearPreprocessor.swift */, - 32920F1C14AABE3E6324EB718DB4F22A /* SourceIDPreprocessor.swift */, - EAF1CB44B1532BE35326641A01B38EA5 /* ViewToViewPreprocessor.swift */, - ); - name = Preprocessors; - sourceTree = ""; - }; - A378508F1E083BD3002854A8 /* Extensions */ = { - isa = PBXGroup; - children = ( - F9DF90DEF699C530738BF36F7EC08F4A /* CG+Hero.swift */, - B124B4A61E088BA9000F1DF2 /* CAMediaTimingFunction+Hero.swift */, - 53F7BF54988B62579662B3EBF1570192 /* DispatchQueue+Hero.swift */, - 4EA92FDB8DCF56BE10918981146E71D9 /* UIKit+Hero.swift */, - BA962E8A0090A3F508472C2A41382DB4 /* UIKit+HeroModifier.swift */, - ); - name = Extensions; - sourceTree = ""; - }; - A37850901E083BDB002854A8 /* DebugPlugin */ = { - isa = PBXGroup; - children = ( - 7260E6E6BC54C60E14338D44CDBA0DD9 /* HeroDebugPlugin.swift */, - 9ABC44921DBAFE81EDBF72413F25CA66 /* HeroDebugView.swift */, - ); - name = DebugPlugin; - sourceTree = ""; - }; A59C55F6013CB7643F4B4030B09B2D1E /* Swift */ = { isa = PBXGroup; children = ( @@ -480,21 +356,6 @@ path = "../Target Support Files/ChameleonFramework"; sourceTree = ""; }; - B80688D35CCC8E586B9252714D22B0F5 /* Hero */ = { - isa = PBXGroup; - children = ( - 8ACA52D8C3BB32DE76F65BE7A770A52F /* Hero.swift */, - 68F0DA52F9FD4863B90F36540967E1AC /* HeroContext.swift */, - 009813FF767BFAE2357DA856652EEEE7 /* HeroDefaultAnimator.swift */, - 9D2EF3BAF433FDE6F713EC6723EF776C /* HeroPlugin.swift */, - 90410D05047B40B99B553954960BF82B /* HeroTypes.swift */, - A378508E1E083BC6002854A8 /* Preprocessors */, - A37850901E083BDB002854A8 /* DebugPlugin */, - A378508F1E083BD3002854A8 /* Extensions */, - ); - path = Hero; - sourceTree = ""; - }; CFBD93DDE9A559F9CCDAA6802C5A361F /* ChameleonFramework */ = { isa = PBXGroup; children = ( @@ -502,6 +363,7 @@ B1A39966BD25CFF84C973E5EFF673694 /* Support Files */, A59C55F6013CB7643F4B4030B09B2D1E /* Swift */, ); + name = ChameleonFramework; path = ChameleonFramework; sourceTree = ""; }; @@ -546,19 +408,11 @@ /* End PBXGroup section */ /* Begin PBXHeadersBuildPhase section */ - 442643DF5DCE8AD74B0A77071213873D /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - 1BF55DFD1990F68F268B96985726FD34 /* Pods-HeroExamples-umbrella.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 70740454BE247787CF85332D5BB4EC09 /* Headers */ = { + 2B7A31EF26BDDE58C8F275653AE7F5DE /* Headers */ = { isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( - 5BCC9986918F1504E617CF4EB6650D46 /* Hero-umbrella.h in Headers */, + 9624DC1CBD9DA4A784590FFC193673FA /* Pods-HeroExamples-umbrella.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -585,65 +439,45 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - B69ECC60F9FDF01B3D03B7E968E029FE /* Headers */ = { + CEBB4DB1B1AAD575520A7EA37BA03085 /* Headers */ = { isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( - F8B85EC3663D1642EDB609E95E8D6581 /* ZCAnimatedLabel-umbrella.h in Headers */, - 84C802C36B8B0B0B7914F21C63BFA45E /* ZCAnimatedLabel.h in Headers */, - 7EC18B2353DEF54BB916A4DCCA03F524 /* ZCCoreTextLayout.h in Headers */, - ACF084933B3CBF65307BBC8484191FA0 /* ZCDashLabel.h in Headers */, - 8FDC07FBCD8EF555111482A3698ED4F7 /* ZCDuangLabel.h in Headers */, - 61288CA5CDDA4889540D904296FC9BF1 /* ZCEasingUtil.h in Headers */, - A918B9CE3AFC7CFE22502D0EDF36E827 /* ZCFallLabel.h in Headers */, - AB80F4B71FE40B7325FE19FE7920BE1A /* ZCFlyinLabel.h in Headers */, - E98CB055BAE498D0F4FF48EC17BD49BD /* ZCFocusLabel.h in Headers */, - E20A79E671B33606667295F34A119208 /* ZCRevealLabel.h in Headers */, - 10786E27C0CE4E3885C4F18686CF6300 /* ZCShapeshiftLabel.h in Headers */, - 31355E6EC81B820199C659E233B4E9E8 /* ZCSpinLabel.h in Headers */, - 7FBF3BEEC3253A81E1E145C76C89B83A /* ZCThrownLabel.h in Headers */, - 598E88F95330D05C0D644897CEF4B469 /* ZCTransparencyLabel.h in Headers */, + 1E162B130F202BB758F70ABF7A79FA55 /* ZCAnimatedLabel-umbrella.h in Headers */, + 40183767C9BA63FB5F28CFD448568CF7 /* ZCAnimatedLabel.h in Headers */, + 7CA7C05EB721D0F876A6DAE12821675C /* ZCCoreTextLayout.h in Headers */, + D8FB33073243D5B9EABA87B6CAF63577 /* ZCDashLabel.h in Headers */, + 2F7F43A4296932FB55CBA489E4D0508C /* ZCDuangLabel.h in Headers */, + D108846C0C9F02A453FF05BFE72C4FB9 /* ZCEasingUtil.h in Headers */, + 4CC5AE1E0D4700767EC56DF7B8E2AE4D /* ZCFallLabel.h in Headers */, + 3B373CC3F8D9135D5422F0E1092CC6C9 /* ZCFlyinLabel.h in Headers */, + 75B759DB544D317A6FC88F4FD62AB5E2 /* ZCFocusLabel.h in Headers */, + EA8ED001B68683130409A4E5F037CB41 /* ZCRevealLabel.h in Headers */, + F4E466CB3B33261D3255B35C06C8DC95 /* ZCShapeshiftLabel.h in Headers */, + 6AA9E69CCB146EC7728EAF46A3A713AC /* ZCSpinLabel.h in Headers */, + 784D05978A3F371754437833B6E3B223 /* ZCThrownLabel.h in Headers */, + 9405A75288E8E96DACC18A6EEC420432 /* ZCTransparencyLabel.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXHeadersBuildPhase section */ /* Begin PBXNativeTarget section */ - 34CAC580BFE6FB5B89353906FD6A8BDB /* Hero */ = { - isa = PBXNativeTarget; - buildConfigurationList = 102BC29D729DCF1BBE09F7B77976A8DD /* Build configuration list for PBXNativeTarget "Hero" */; - buildPhases = ( - 6271C35C5330F1342A0AAABCAEEDC003 /* Sources */, - 820E8595182530888B7482019009B2E3 /* Frameworks */, - 70740454BE247787CF85332D5BB4EC09 /* Headers */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = Hero; - productName = Hero; - productReference = 04B4B451E46FE346E8A820607BBA2324 /* Hero.framework */; - productType = "com.apple.product-type.framework"; - }; - 73DBEE8B40A64A4E3B091748C42DD4F7 /* Pods-HeroExamples */ = { + 490E5E24AF399729C67683ABA7BCA188 /* ZCAnimatedLabel */ = { isa = PBXNativeTarget; - buildConfigurationList = 937EE204DDEDB24B8E417B1629347495 /* Build configuration list for PBXNativeTarget "Pods-HeroExamples" */; + buildConfigurationList = 8D934E445C26631D39ED954D1595D699 /* Build configuration list for PBXNativeTarget "ZCAnimatedLabel" */; buildPhases = ( - 548AB60370927E20C25102D9FD05845F /* Sources */, - 6166ADA80389AD66671E542588B0200F /* Frameworks */, - 442643DF5DCE8AD74B0A77071213873D /* Headers */, + E01509A7080DEB56AB53EBE5D3C115B4 /* Sources */, + 56918A26D3EDEB26C2F9B122E03E4A9A /* Frameworks */, + CEBB4DB1B1AAD575520A7EA37BA03085 /* Headers */, ); buildRules = ( ); dependencies = ( - DE3B1B4D9EF473934BBB19396693E09C /* PBXTargetDependency */, - 2EABA1CF962E9506BCD6B12C4067C724 /* PBXTargetDependency */, - FBA54CBC45C0F0CD56172B44E55D7319 /* PBXTargetDependency */, ); - name = "Pods-HeroExamples"; - productName = "Pods-HeroExamples"; - productReference = 42B1EBC88025BDEAEE57374191E3343F /* Pods_HeroExamples.framework */; + name = ZCAnimatedLabel; + productName = ZCAnimatedLabel; + productReference = 05D5FC5FA136B6E87C98475AFD6BA61F /* ZCAnimatedLabel.framework */; productType = "com.apple.product-type.framework"; }; 76BD4592010354D6C23D6ECCA20D83A8 /* ChameleonFramework */ = { @@ -660,24 +494,26 @@ ); name = ChameleonFramework; productName = ChameleonFramework; - productReference = 000FFED8AE29139132224FB47C7369A3 /* ChameleonFramework.framework */; + productReference = 55CBDB5ADC53AD92DC1BD1FA43BDD7F1 /* ChameleonFramework.framework */; productType = "com.apple.product-type.framework"; }; - B436B44CA163743182E74F03DB0B4F59 /* ZCAnimatedLabel */ = { + 7BE367E8CC6B63FE94C2292EBF18B4D9 /* Pods-HeroExamples */ = { isa = PBXNativeTarget; - buildConfigurationList = AC6491958430F1070A2A30EDFC33FEDD /* Build configuration list for PBXNativeTarget "ZCAnimatedLabel" */; + buildConfigurationList = 86E278FFB0C25A792DBD0B3BD9B1F7AB /* Build configuration list for PBXNativeTarget "Pods-HeroExamples" */; buildPhases = ( - 5B618D295F2EF5EBCA49DB555E8C57B7 /* Sources */, - 7D3CA10DC6DF3B63540C238462F12A0A /* Frameworks */, - B69ECC60F9FDF01B3D03B7E968E029FE /* Headers */, + 2C8DA10629A6E8A5ACDB8F3FF6724704 /* Sources */, + 6C53D9EC51356AF2D5EF37FD114A9C08 /* Frameworks */, + 2B7A31EF26BDDE58C8F275653AE7F5DE /* Headers */, ); buildRules = ( ); dependencies = ( + F723CE06F852D2E359BB6B2964BA8679 /* PBXTargetDependency */, + 5F11CE395EB251087A84A872542D41CB /* PBXTargetDependency */, ); - name = ZCAnimatedLabel; - productName = ZCAnimatedLabel; - productReference = 96F2151CA6ADD851CD6FFD62A544FFBF /* ZCAnimatedLabel.framework */; + name = "Pods-HeroExamples"; + productName = "Pods-HeroExamples"; + productReference = AF5C12431F9BD2452D57C998BC489B87 /* Pods_HeroExamples.framework */; productType = "com.apple.product-type.framework"; }; /* End PBXNativeTarget section */ @@ -697,69 +533,44 @@ en, ); mainGroup = 7DB346D0F39D3F0E887471402A8071AB; - productRefGroup = 7BADC0D894845F24A1D8CEB9B900AF72 /* Products */; + productRefGroup = 23024C222F96A4C7A30040F108850DAB /* Products */; projectDirPath = ""; projectRoot = ""; targets = ( 76BD4592010354D6C23D6ECCA20D83A8 /* ChameleonFramework */, - 34CAC580BFE6FB5B89353906FD6A8BDB /* Hero */, - 73DBEE8B40A64A4E3B091748C42DD4F7 /* Pods-HeroExamples */, - B436B44CA163743182E74F03DB0B4F59 /* ZCAnimatedLabel */, + 7BE367E8CC6B63FE94C2292EBF18B4D9 /* Pods-HeroExamples */, + 490E5E24AF399729C67683ABA7BCA188 /* ZCAnimatedLabel */, ); }; /* End PBXProject section */ /* Begin PBXSourcesBuildPhase section */ - 548AB60370927E20C25102D9FD05845F /* Sources */ = { + 2C8DA10629A6E8A5ACDB8F3FF6724704 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - F7F904D5F0888B42AC9D326693754CE0 /* Pods-HeroExamples-dummy.m in Sources */, + 25CCFF1662CCA3724B76988DD5E6C7DA /* Pods-HeroExamples-dummy.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; - 5B618D295F2EF5EBCA49DB555E8C57B7 /* Sources */ = { + E01509A7080DEB56AB53EBE5D3C115B4 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 04118D1B8FDD7E7173670C8B07711589 /* ZCAnimatedLabel-dummy.m in Sources */, - 8E0CEB2CEE49A5BEE264A8EE54714EA7 /* ZCAnimatedLabel.m in Sources */, - B091706205DBEA2827284B7060E64096 /* ZCCoreTextLayout.m in Sources */, - 56989A7BF080012B0F0637436E6EABB0 /* ZCDashLabel.m in Sources */, - 7AE94C0C7BFD8A9C9530AED794BD0D8E /* ZCDuangLabel.m in Sources */, - 8888D8CD2B70C41CCD55AAEEA4FD25AC /* ZCEasingUtil.m in Sources */, - 94F7E046C2602C8C4D634FF684B227F8 /* ZCFallLabel.m in Sources */, - D195064586817A705F5068D1D98BB120 /* ZCFlyinLabel.m in Sources */, - 75B4A80CFC3A9C0B7D74139C31F980F1 /* ZCFocusLabel.m in Sources */, - 40E1F04D4C2801329BB14841B24C005A /* ZCRevealLabel.m in Sources */, - 96E2D91886535313CCBDF853FEB03868 /* ZCShapeshiftLabel.m in Sources */, - EE4A11526BB34938AF78ACAC8287EED6 /* ZCSpinLabel.m in Sources */, - 07FBEEA9B5A846CA380A56E0C4871E70 /* ZCThrownLabel.m in Sources */, - 6F18AC21D391B19865742F811EC20202 /* ZCTransparencyLabel.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 6271C35C5330F1342A0AAABCAEEDC003 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - A6DA81627CEB670BBFBBAC365EEFBAF8 /* CascadePreprocessor.swift in Sources */, - 1EFA7FF8FA2BF549B4CA3B7056C8A31F /* CG+Hero.swift in Sources */, - 3FF66D2B989569989DA1ECEF022D0911 /* ClearPreprocessor.swift in Sources */, - 36F23BEB8D59F2D7E929B65837955928 /* DispatchQueue+Hero.swift in Sources */, - EB192542076198CC9C636DDFCCF28D64 /* Hero-dummy.m in Sources */, - CA19F7D3C407140A4858D71B94EDC523 /* Hero.swift in Sources */, - 87180A87859AD4B9B5656F52A3E64013 /* HeroContext.swift in Sources */, - F34ADE4638ABE9E687A005E1B4CCD2A0 /* HeroDebugPlugin.swift in Sources */, - 96ADBD9B612F8A5B2A417A3BCED08B78 /* HeroDebugView.swift in Sources */, - B9A618F6A32F37FCCB911669072ADAD1 /* HeroDefaultAnimator.swift in Sources */, - BAFF28FB3D799010C983A03EE434F262 /* HeroPlugin.swift in Sources */, - 704C71A8D826D94BE3F463A1E39DDE08 /* HeroTypes.swift in Sources */, - B124B4A71E088BA9000F1DF2 /* CAMediaTimingFunction+Hero.swift in Sources */, - 3B7E296D2722377B0EB6FD076A716081 /* SourceIDPreprocessor.swift in Sources */, - A6AC4C9DCE32429CE5D6CF2EAA3C52DE /* UIKit+Hero.swift in Sources */, - 9ADBC3165E0411E5DFAAFE05C96EDC2D /* UIKit+HeroModifier.swift in Sources */, - BBACBB79A5CCE24F3BF31BEFDADD80DA /* ViewToViewPreprocessor.swift in Sources */, + F6D9178D7BBB6675E4DDDAE9DD87D325 /* ZCAnimatedLabel-dummy.m in Sources */, + AB38B3EC8E11AAC3E79CCA2055C602DA /* ZCAnimatedLabel.m in Sources */, + B6634AF86577EB63DA3CBEFE68A13573 /* ZCCoreTextLayout.m in Sources */, + 960CCAF77BEB2BADB3EDF2B1D4F163ED /* ZCDashLabel.m in Sources */, + A012023B35FBAC0F3BF4A79AB56F5BF8 /* ZCDuangLabel.m in Sources */, + 71F6B456484AFD3E66941D85EBC63AB4 /* ZCEasingUtil.m in Sources */, + F19137375616A184266131B0D97BE794 /* ZCFallLabel.m in Sources */, + 4F588C05B1BD6255AC3A7E1759D015B4 /* ZCFlyinLabel.m in Sources */, + 6FE3836B8D9901EB160349215E388DA0 /* ZCFocusLabel.m in Sources */, + BA46D138629B5BEEF5C8CA4F5DA78B6D /* ZCRevealLabel.m in Sources */, + 2D10805A1729B26DCB2CAD52F2049BAF /* ZCShapeshiftLabel.m in Sources */, + 24BE4A3CB29223B7DCC5150F5C08A307 /* ZCSpinLabel.m in Sources */, + DBACA9BDB5867F71DBA6D4B76672E14B /* ZCThrownLabel.m in Sources */, + E4CE7C740C5F7853AF4A1BD5A538809A /* ZCTransparencyLabel.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -787,91 +598,21 @@ /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ - 2EABA1CF962E9506BCD6B12C4067C724 /* PBXTargetDependency */ = { + 5F11CE395EB251087A84A872542D41CB /* PBXTargetDependency */ = { isa = PBXTargetDependency; - name = Hero; - target = 34CAC580BFE6FB5B89353906FD6A8BDB /* Hero */; - targetProxy = DE1EA60457BEF29998CDCB4A2EF25F52 /* PBXContainerItemProxy */; + name = ZCAnimatedLabel; + target = 490E5E24AF399729C67683ABA7BCA188 /* ZCAnimatedLabel */; + targetProxy = 09A396E97BB7A660275B043DDC407900 /* PBXContainerItemProxy */; }; - DE3B1B4D9EF473934BBB19396693E09C /* PBXTargetDependency */ = { + F723CE06F852D2E359BB6B2964BA8679 /* PBXTargetDependency */ = { isa = PBXTargetDependency; name = ChameleonFramework; target = 76BD4592010354D6C23D6ECCA20D83A8 /* ChameleonFramework */; - targetProxy = 245352CA6AFF23A62ECC1E35BB9694B8 /* PBXContainerItemProxy */; - }; - FBA54CBC45C0F0CD56172B44E55D7319 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = ZCAnimatedLabel; - target = B436B44CA163743182E74F03DB0B4F59 /* ZCAnimatedLabel */; - targetProxy = 7F4216B15DEB10177912225474EB288A /* PBXContainerItemProxy */; + targetProxy = 77ABD4CB4FB134B9A8C14A7B7F0C50CF /* PBXContainerItemProxy */; }; /* End PBXTargetDependency section */ /* Begin XCBuildConfiguration section */ - 1B87D5BDC7F40D6A656E70058A80457B /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 25E81D1F1DA468EA8BCC84BFA1C7AFE8 /* Hero.xcconfig */; - buildSettings = { - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - CURRENT_PROJECT_VERSION = 1; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_NO_COMMON_BLOCKS = YES; - GCC_PREFIX_HEADER = "Target Support Files/Hero/Hero-prefix.pch"; - INFOPLIST_FILE = "Target Support Files/Hero/Info.plist"; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MODULEMAP_FILE = "Target Support Files/Hero/Hero.modulemap"; - MTL_ENABLE_DEBUG_INFO = NO; - PRODUCT_NAME = Hero; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - SWIFT_VERSION = 3.0; - TARGETED_DEVICE_FAMILY = "1,2"; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Release; - }; - 3B253C0A051B9727DBB1D1D947A215BE /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = B7845278D818AA0933253B32BF79AB28 /* ZCAnimatedLabel.xcconfig */; - buildSettings = { - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - CURRENT_PROJECT_VERSION = 1; - DEBUG_INFORMATION_FORMAT = dwarf; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_NO_COMMON_BLOCKS = YES; - GCC_PREFIX_HEADER = "Target Support Files/ZCAnimatedLabel/ZCAnimatedLabel-prefix.pch"; - INFOPLIST_FILE = "Target Support Files/ZCAnimatedLabel/Info.plist"; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MODULEMAP_FILE = "Target Support Files/ZCAnimatedLabel/ZCAnimatedLabel.modulemap"; - MTL_ENABLE_DEBUG_INFO = YES; - PRODUCT_NAME = ZCAnimatedLabel; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - SWIFT_VERSION = 3.0; - TARGETED_DEVICE_FAMILY = "1,2"; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Debug; - }; 3E09A745CF2882E71BFC1132C8D8AE7D /* Release */ = { isa = XCBuildConfiguration; baseConfigurationReference = 1F2E13984F6F5D4A7DD3E870630E454E /* ChameleonFramework.xcconfig */; @@ -904,9 +645,9 @@ }; name = Release; }; - 412DAB257A76F5E015BD6D241990C9D6 /* Debug */ = { + 5307121EE04301CCF222308A830C6660 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 25E81D1F1DA468EA8BCC84BFA1C7AFE8 /* Hero.xcconfig */; + baseConfigurationReference = B7845278D818AA0933253B32BF79AB28 /* ZCAnimatedLabel.xcconfig */; buildSettings = { "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; @@ -919,17 +660,16 @@ DYLIB_INSTALL_NAME_BASE = "@rpath"; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_NO_COMMON_BLOCKS = YES; - GCC_PREFIX_HEADER = "Target Support Files/Hero/Hero-prefix.pch"; - INFOPLIST_FILE = "Target Support Files/Hero/Info.plist"; + GCC_PREFIX_HEADER = "Target Support Files/ZCAnimatedLabel/ZCAnimatedLabel-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/ZCAnimatedLabel/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MODULEMAP_FILE = "Target Support Files/Hero/Hero.modulemap"; + MODULEMAP_FILE = "Target Support Files/ZCAnimatedLabel/ZCAnimatedLabel.modulemap"; MTL_ENABLE_DEBUG_INFO = YES; - PRODUCT_NAME = Hero; + PRODUCT_NAME = ZCAnimatedLabel; SDKROOT = iphoneos; SKIP_INSTALL = YES; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 3.0; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; @@ -937,42 +677,6 @@ }; name = Debug; }; - 55806264DAD3E2F9C583D0CA2F43E7C5 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 517F35FE8BE6A3CBA4B88B1520C74C06 /* Pods-HeroExamples.debug.xcconfig */; - buildSettings = { - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - CURRENT_PROJECT_VERSION = 1; - DEBUG_INFORMATION_FORMAT = dwarf; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_NO_COMMON_BLOCKS = YES; - INFOPLIST_FILE = "Target Support Files/Pods-HeroExamples/Info.plist"; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MACH_O_TYPE = staticlib; - MODULEMAP_FILE = "Target Support Files/Pods-HeroExamples/Pods-HeroExamples.modulemap"; - MTL_ENABLE_DEBUG_INFO = YES; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PODS_ROOT = "$(SRCROOT)"; - PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; - PRODUCT_NAME = Pods_HeroExamples; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - TARGETED_DEVICE_FAMILY = "1,2"; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Debug; - }; 59B042A655B7C20CBAB90E385BF4E4C7 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { @@ -1017,41 +721,45 @@ }; name = Debug; }; - 671E841DBAAA02983FB2540A85D2F11A /* Release */ = { + 64628373662DD9ADDD0FBA68D2C83A5C /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = B7845278D818AA0933253B32BF79AB28 /* ZCAnimatedLabel.xcconfig */; + baseConfigurationReference = 517F35FE8BE6A3CBA4B88B1520C74C06 /* Pods-HeroExamples.debug.xcconfig */; buildSettings = { "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; CURRENT_PROJECT_VERSION = 1; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEBUG_INFORMATION_FORMAT = dwarf; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_NO_COMMON_BLOCKS = YES; - GCC_PREFIX_HEADER = "Target Support Files/ZCAnimatedLabel/ZCAnimatedLabel-prefix.pch"; - INFOPLIST_FILE = "Target Support Files/ZCAnimatedLabel/Info.plist"; + INFOPLIST_FILE = "Target Support Files/Pods-HeroExamples/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MODULEMAP_FILE = "Target Support Files/ZCAnimatedLabel/ZCAnimatedLabel.modulemap"; - MTL_ENABLE_DEBUG_INFO = NO; - PRODUCT_NAME = ZCAnimatedLabel; + MACH_O_TYPE = staticlib; + MODULEMAP_FILE = "Target Support Files/Pods-HeroExamples/Pods-HeroExamples.modulemap"; + MTL_ENABLE_DEBUG_INFO = YES; + OTHER_LDFLAGS = ""; + OTHER_LIBTOOLFLAGS = ""; + PODS_ROOT = "$(SRCROOT)"; + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; + PRODUCT_NAME = Pods_HeroExamples; SDKROOT = iphoneos; SKIP_INSTALL = YES; - SWIFT_VERSION = 3.0; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; - name = Release; + name = Debug; }; - 6CC8020A764FED9A0EF88A7088C3280A /* Release */ = { + 9387CF5D0FE86B7A6026CFAFCDE9A50C /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 6FB43588D8877F1F909F697476508F4F /* Pods-HeroExamples.release.xcconfig */; + baseConfigurationReference = B7845278D818AA0933253B32BF79AB28 /* ZCAnimatedLabel.xcconfig */; buildSettings = { "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; @@ -1064,20 +772,17 @@ DYLIB_INSTALL_NAME_BASE = "@rpath"; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_NO_COMMON_BLOCKS = YES; - INFOPLIST_FILE = "Target Support Files/Pods-HeroExamples/Info.plist"; + GCC_PREFIX_HEADER = "Target Support Files/ZCAnimatedLabel/ZCAnimatedLabel-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/ZCAnimatedLabel/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MACH_O_TYPE = staticlib; - MODULEMAP_FILE = "Target Support Files/Pods-HeroExamples/Pods-HeroExamples.modulemap"; + MODULEMAP_FILE = "Target Support Files/ZCAnimatedLabel/ZCAnimatedLabel.modulemap"; MTL_ENABLE_DEBUG_INFO = NO; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PODS_ROOT = "$(SRCROOT)"; - PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; - PRODUCT_NAME = Pods_HeroExamples; + PRODUCT_NAME = ZCAnimatedLabel; SDKROOT = iphoneos; SKIP_INSTALL = YES; + SWIFT_VERSION = 3.0; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; @@ -1124,6 +829,41 @@ }; name = Release; }; + E19B98C170398FBF1DDCA5CDDB48B541 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 6FB43588D8877F1F909F697476508F4F /* Pods-HeroExamples.release.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_NO_COMMON_BLOCKS = YES; + INFOPLIST_FILE = "Target Support Files/Pods-HeroExamples/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MACH_O_TYPE = staticlib; + MODULEMAP_FILE = "Target Support Files/Pods-HeroExamples/Pods-HeroExamples.modulemap"; + MTL_ENABLE_DEBUG_INFO = NO; + OTHER_LDFLAGS = ""; + OTHER_LIBTOOLFLAGS = ""; + PODS_ROOT = "$(SRCROOT)"; + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; + PRODUCT_NAME = Pods_HeroExamples; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; E3923CE70A641398913B8A3AA0FDBB30 /* Debug */ = { isa = XCBuildConfiguration; baseConfigurationReference = 1F2E13984F6F5D4A7DD3E870630E454E /* ChameleonFramework.xcconfig */; @@ -1169,15 +909,6 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 102BC29D729DCF1BBE09F7B77976A8DD /* Build configuration list for PBXNativeTarget "Hero" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 412DAB257A76F5E015BD6D241990C9D6 /* Debug */, - 1B87D5BDC7F40D6A656E70058A80457B /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; 2D8E8EC45A3A1A1D94AE762CB5028504 /* Build configuration list for PBXProject "Pods" */ = { isa = XCConfigurationList; buildConfigurations = ( @@ -1187,20 +918,20 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 937EE204DDEDB24B8E417B1629347495 /* Build configuration list for PBXNativeTarget "Pods-HeroExamples" */ = { + 86E278FFB0C25A792DBD0B3BD9B1F7AB /* Build configuration list for PBXNativeTarget "Pods-HeroExamples" */ = { isa = XCConfigurationList; buildConfigurations = ( - 55806264DAD3E2F9C583D0CA2F43E7C5 /* Debug */, - 6CC8020A764FED9A0EF88A7088C3280A /* Release */, + 64628373662DD9ADDD0FBA68D2C83A5C /* Debug */, + E19B98C170398FBF1DDCA5CDDB48B541 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - AC6491958430F1070A2A30EDFC33FEDD /* Build configuration list for PBXNativeTarget "ZCAnimatedLabel" */ = { + 8D934E445C26631D39ED954D1595D699 /* Build configuration list for PBXNativeTarget "ZCAnimatedLabel" */ = { isa = XCConfigurationList; buildConfigurations = ( - 3B253C0A051B9727DBB1D1D947A215BE /* Debug */, - 671E841DBAAA02983FB2540A85D2F11A /* Release */, + 5307121EE04301CCF222308A830C6660 /* Debug */, + 9387CF5D0FE86B7A6026CFAFCDE9A50C /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; diff --git a/Examples/Pods/Target Support Files/Hero/Hero-dummy.m b/Examples/Pods/Target Support Files/Hero/Hero-dummy.m deleted file mode 100644 index 22ddcbc1..00000000 --- a/Examples/Pods/Target Support Files/Hero/Hero-dummy.m +++ /dev/null @@ -1,5 +0,0 @@ -#import -@interface PodsDummy_Hero : NSObject -@end -@implementation PodsDummy_Hero -@end diff --git a/Examples/Pods/Target Support Files/Hero/Hero-prefix.pch b/Examples/Pods/Target Support Files/Hero/Hero-prefix.pch deleted file mode 100644 index aa992a4a..00000000 --- a/Examples/Pods/Target Support Files/Hero/Hero-prefix.pch +++ /dev/null @@ -1,4 +0,0 @@ -#ifdef __OBJC__ -#import -#endif - diff --git a/Examples/Pods/Target Support Files/Hero/Hero-umbrella.h b/Examples/Pods/Target Support Files/Hero/Hero-umbrella.h deleted file mode 100644 index 23173351..00000000 --- a/Examples/Pods/Target Support Files/Hero/Hero-umbrella.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifdef __OBJC__ -#import -#endif - - -FOUNDATION_EXPORT double HeroVersionNumber; -FOUNDATION_EXPORT const unsigned char HeroVersionString[]; - diff --git a/Examples/Pods/Target Support Files/Hero/Hero.modulemap b/Examples/Pods/Target Support Files/Hero/Hero.modulemap deleted file mode 100644 index 1376fbb8..00000000 --- a/Examples/Pods/Target Support Files/Hero/Hero.modulemap +++ /dev/null @@ -1,6 +0,0 @@ -framework module Hero { - umbrella header "Hero-umbrella.h" - - export * - module * { export * } -} diff --git a/Examples/Pods/Target Support Files/Hero/Hero.xcconfig b/Examples/Pods/Target Support Files/Hero/Hero.xcconfig deleted file mode 100644 index 6d398f22..00000000 --- a/Examples/Pods/Target Support Files/Hero/Hero.xcconfig +++ /dev/null @@ -1,10 +0,0 @@ -CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/Hero -GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 -HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public" -OTHER_LDFLAGS = -framework "Foundation" -framework "UIKit" -OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" -PODS_BUILD_DIR = $BUILD_DIR -PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) -PODS_ROOT = ${SRCROOT} -PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} -SKIP_INSTALL = YES diff --git a/Examples/Pods/Target Support Files/Hero/Info.plist b/Examples/Pods/Target Support Files/Hero/Info.plist deleted file mode 100644 index cba25855..00000000 --- a/Examples/Pods/Target Support Files/Hero/Info.plist +++ /dev/null @@ -1,26 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - ${EXECUTABLE_NAME} - CFBundleIdentifier - ${PRODUCT_BUNDLE_IDENTIFIER} - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - ${PRODUCT_NAME} - CFBundlePackageType - FMWK - CFBundleShortVersionString - 0.0.1 - CFBundleSignature - ???? - CFBundleVersion - ${CURRENT_PROJECT_VERSION} - NSPrincipalClass - - - diff --git a/Examples/Pods/Target Support Files/Pods-HeroExamples/Pods-HeroExamples-acknowledgements.markdown b/Examples/Pods/Target Support Files/Pods-HeroExamples/Pods-HeroExamples-acknowledgements.markdown index 5e236720..e62035c8 100644 --- a/Examples/Pods/Target Support Files/Pods-HeroExamples/Pods-HeroExamples-acknowledgements.markdown +++ b/Examples/Pods/Target Support Files/Pods-HeroExamples/Pods-HeroExamples-acknowledgements.markdown @@ -26,31 +26,6 @@ This application makes use of the following third party libraries: > SOFTWARE. -## Hero - -The MIT License (MIT) - -Copyright (c) 2015 Luke Zhao - -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. - - ## ZCAnimatedLabel The MIT License (MIT) diff --git a/Examples/Pods/Target Support Files/Pods-HeroExamples/Pods-HeroExamples-acknowledgements.plist b/Examples/Pods/Target Support Files/Pods-HeroExamples/Pods-HeroExamples-acknowledgements.plist index b5260b1c..54211f52 100644 --- a/Examples/Pods/Target Support Files/Pods-HeroExamples/Pods-HeroExamples-acknowledgements.plist +++ b/Examples/Pods/Target Support Files/Pods-HeroExamples/Pods-HeroExamples-acknowledgements.plist @@ -47,37 +47,6 @@ FooterText The MIT License (MIT) -Copyright (c) 2015 Luke Zhao <me@lkzhao.com> - -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. - - License - MIT - Title - Hero - Type - PSGroupSpecifier - - - FooterText - The MIT License (MIT) - Copyright (c) 2015 Chen Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/Examples/Pods/Target Support Files/Pods-HeroExamples/Pods-HeroExamples-frameworks.sh b/Examples/Pods/Target Support Files/Pods-HeroExamples/Pods-HeroExamples-frameworks.sh index e62f5cf4..45436ba0 100755 --- a/Examples/Pods/Target Support Files/Pods-HeroExamples/Pods-HeroExamples-frameworks.sh +++ b/Examples/Pods/Target Support Files/Pods-HeroExamples/Pods-HeroExamples-frameworks.sh @@ -85,11 +85,9 @@ strip_invalid_archs() { if [[ "$CONFIGURATION" == "Debug" ]]; then install_framework "$BUILT_PRODUCTS_DIR/ChameleonFramework/ChameleonFramework.framework" - install_framework "$BUILT_PRODUCTS_DIR/Hero/Hero.framework" install_framework "$BUILT_PRODUCTS_DIR/ZCAnimatedLabel/ZCAnimatedLabel.framework" fi if [[ "$CONFIGURATION" == "Release" ]]; then install_framework "$BUILT_PRODUCTS_DIR/ChameleonFramework/ChameleonFramework.framework" - install_framework "$BUILT_PRODUCTS_DIR/Hero/Hero.framework" install_framework "$BUILT_PRODUCTS_DIR/ZCAnimatedLabel/ZCAnimatedLabel.framework" fi diff --git a/Examples/Pods/Target Support Files/Pods-HeroExamples/Pods-HeroExamples.debug.xcconfig b/Examples/Pods/Target Support Files/Pods-HeroExamples/Pods-HeroExamples.debug.xcconfig index 020d589e..f851f1e1 100644 --- a/Examples/Pods/Target Support Files/Pods-HeroExamples/Pods-HeroExamples.debug.xcconfig +++ b/Examples/Pods/Target Support Files/Pods-HeroExamples/Pods-HeroExamples.debug.xcconfig @@ -1,10 +1,10 @@ ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES EMBEDDED_CONTENT_CONTAINS_SWIFT = YES -FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/ChameleonFramework" "$PODS_CONFIGURATION_BUILD_DIR/Hero" "$PODS_CONFIGURATION_BUILD_DIR/ZCAnimatedLabel" +FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/ChameleonFramework" "$PODS_CONFIGURATION_BUILD_DIR/ZCAnimatedLabel" GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' -OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/ChameleonFramework/ChameleonFramework.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/Hero/Hero.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/ZCAnimatedLabel/ZCAnimatedLabel.framework/Headers" -OTHER_LDFLAGS = $(inherited) -framework "ChameleonFramework" -framework "Hero" -framework "ZCAnimatedLabel" +OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/ChameleonFramework/ChameleonFramework.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/ZCAnimatedLabel/ZCAnimatedLabel.framework/Headers" +OTHER_LDFLAGS = $(inherited) -framework "ChameleonFramework" -framework "ZCAnimatedLabel" OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" PODS_BUILD_DIR = $BUILD_DIR PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) diff --git a/Examples/Pods/Target Support Files/Pods-HeroExamples/Pods-HeroExamples.release.xcconfig b/Examples/Pods/Target Support Files/Pods-HeroExamples/Pods-HeroExamples.release.xcconfig index 020d589e..f851f1e1 100644 --- a/Examples/Pods/Target Support Files/Pods-HeroExamples/Pods-HeroExamples.release.xcconfig +++ b/Examples/Pods/Target Support Files/Pods-HeroExamples/Pods-HeroExamples.release.xcconfig @@ -1,10 +1,10 @@ ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES EMBEDDED_CONTENT_CONTAINS_SWIFT = YES -FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/ChameleonFramework" "$PODS_CONFIGURATION_BUILD_DIR/Hero" "$PODS_CONFIGURATION_BUILD_DIR/ZCAnimatedLabel" +FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/ChameleonFramework" "$PODS_CONFIGURATION_BUILD_DIR/ZCAnimatedLabel" GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' -OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/ChameleonFramework/ChameleonFramework.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/Hero/Hero.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/ZCAnimatedLabel/ZCAnimatedLabel.framework/Headers" -OTHER_LDFLAGS = $(inherited) -framework "ChameleonFramework" -framework "Hero" -framework "ZCAnimatedLabel" +OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/ChameleonFramework/ChameleonFramework.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/ZCAnimatedLabel/ZCAnimatedLabel.framework/Headers" +OTHER_LDFLAGS = $(inherited) -framework "ChameleonFramework" -framework "ZCAnimatedLabel" OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" PODS_BUILD_DIR = $BUILD_DIR PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) diff --git a/Hero.podspec b/Hero.podspec index 57c66b7f..a1710c0e 100644 --- a/Hero.podspec +++ b/Hero.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "Hero" - s.version = "0.0.2" + s.version = "0.1.0" s.summary = "Supercharged transition engine for iOS." s.description = <<-DESC @@ -8,7 +8,7 @@ Pod::Spec.new do |s| DESC s.homepage = "https://github.com/lkzhao/Hero" - s.screenshots = "https://github.com/lkzhao/Hero/blob/master/Resources/HeroLogo@4x.png?raw=true" + s.screenshots = "https://github.com/lkzhao/Hero/blob/master/Resources/HeroLogo@2x.png?raw=true" s.license = 'MIT' s.author = { "Luke" => "lzhaoyilun@gmail.com" } s.source = { :git => "https://github.com/lkzhao/Hero.git", :tag => s.version.to_s } diff --git a/Hero/Array+HeroModifier.swift b/Hero/Array+HeroModifier.swift new file mode 100644 index 00000000..964adab2 --- /dev/null +++ b/Hero/Array+HeroModifier.swift @@ -0,0 +1,69 @@ +// The MIT License (MIT) +// +// Copyright (c) 2016 Luke Zhao +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +import UIKit + +internal extension Array{ + func get(_ index:Int) -> Element?{ + if index < count{ + return self[index] + } + return nil + } + func getCGFloat(_ index:Int) -> CGFloat?{ + if index < count, let s = self[index] as? String, let f = Float(s){ + return CGFloat(f) + } + return nil + } + func getDouble(_ index:Int) -> Double?{ + if index < count, let s = self[index] as? String, let f = Double(s){ + return f + } + return nil + } + func getFloat(_ index:Int) -> Float?{ + if index < count, let s = self[index] as? String, let f = Float(s){ + return f + } + return nil + } + func getBool(_ index:Int) -> Bool?{ + if index < count, let s = self[index] as? String, let f = Bool(s){ + return f + } + return nil + } + + mutating func filterInPlace(_ comparator:(Element)->Bool) -> Array{ + var array2:Array = [] + self = self.filter { (element) -> Bool in + if comparator(element) { + return true + } else{ + array2.append(element) + return false + } + } + return array2 + } +} diff --git a/Hero/ClearPreprocessor.swift b/Hero/CALayer+Hero.swift similarity index 70% rename from Hero/ClearPreprocessor.swift rename to Hero/CALayer+Hero.swift index ec4bd7b8..585e4320 100644 --- a/Hero/ClearPreprocessor.swift +++ b/Hero/CALayer+Hero.swift @@ -22,17 +22,13 @@ import UIKit -public class ClearModifierPreprocessor:HeroPreprocessor { - public func process(context:HeroContext, fromViews:[UIView], toViews:[UIView]) { - for view in fromViews + toViews{ - guard context[view, "clearSubviewModifiers"] != nil else { continue } - var parentView = view - if let _ = view as? UITableView, let wrapperView = view.subviews.get(0) { - parentView = wrapperView - } - for subview in parentView.subviews{ - context[subview] = nil - } +internal extension CALayer{ + // return all animations running by this layer. + // the returned value is mutable + var animations:[(String, CAAnimation)]{ + if let keys = animationKeys(){ + return keys.map{ return ($0, self.animation(forKey: $0)!.copy() as! CAAnimation) } } + return [] } } diff --git a/Hero/CG+Hero.swift b/Hero/CG+Hero.swift index 8b10fd93..c58b58cd 100644 --- a/Hero/CG+Hero.swift +++ b/Hero/CG+Hero.swift @@ -37,6 +37,21 @@ internal struct KeySet{ } } +internal extension CGSize{ + internal var center:CGPoint{ + return CGPoint(x: width / 2, y: height / 2) + } + internal var point:CGPoint{ + return CGPoint(x: width, y: height) + } + internal func transform(_ t:CGAffineTransform) -> CGSize{ + return self.applying(t) + } + internal func transform(_ t:CATransform3D) -> CGSize{ + return self.applying(CATransform3DGetAffineTransform(t)) + } +} + internal extension CGRect{ internal var center:CGPoint{ return CGPoint(x: origin.x + size.width/2, y: origin.y + size.height/2) @@ -63,6 +78,10 @@ extension CGPoint{ return self.applying(t) } + internal func transform(_ t:CATransform3D) -> CGPoint{ + return self.applying(CATransform3DGetAffineTransform(t)) + } + internal func distance(_ b:CGPoint)->CGFloat{ return sqrt(pow(self.x-b.x,2)+pow(self.y-b.y,2)); } @@ -91,3 +110,12 @@ internal prefix func -(point:CGPoint) -> CGPoint { internal func abs(_ p: CGPoint) -> CGPoint { return CGPoint(x: abs(p.x), y: abs(p.y)) } + + + +internal func *(left: CGSize, right: CGFloat) -> CGSize { + return CGSize(width: left.width*right, height: left.height*right) +} +internal func /(left: CGSize, right: CGSize) -> CGSize { + return CGSize(width: left.width/right.width, height: left.height/right.height) +} diff --git a/Hero/CascadePreprocessor.swift b/Hero/CascadePreprocessor.swift index c9128b88..5ef3c079 100644 --- a/Hero/CascadePreprocessor.swift +++ b/Hero/CascadePreprocessor.swift @@ -31,6 +31,8 @@ public class CascadePreprocessor:HeroPreprocessor { case bottomToTop; case leftToRight; case rightToLeft; + case radial(center:CGPoint); + case inverseRadial(center:CGPoint); var comparator:(UIView, UIView) -> Bool{ switch self { case .topToBottom: @@ -41,8 +43,13 @@ public class CascadePreprocessor:HeroPreprocessor { return { return $0.frame.minX < $1.frame.minX } case .rightToLeft: return { return $0.frame.maxX > $1.frame.maxX } + case .radial(let center): + return { return $0.center.distance(center) < $1.center.distance(center) } + case .inverseRadial(let center): + return { return $0.center.distance(center) > $1.center.distance(center) } } } + init?(_ string:String) { switch string { case "bottomToTop": @@ -60,34 +67,39 @@ public class CascadePreprocessor:HeroPreprocessor { } public func process(context:HeroContext, fromViews:[UIView], toViews:[UIView]) { - for fv in fromViews + toViews{ - guard let options = context[fv, "cascade"], - let deltaTime = options.getCGFloat(0) - else { continue } + process(context:context, views:fromViews) + process(context:context, views:toViews) + } + + private func process(context:HeroContext, views:[UIView]){ + for (viewIndex, fv) in views.enumerated() { + guard let (deltaTime, direction, delayMatchedViews) = context[fv]?.cascade else { continue } - let directionString = options.get(1) - let direction = CascadeDirection(directionString ?? "") ?? .topToBottom var parentView = fv if let _ = fv as? UITableView, let wrapperView = fv.subviews.get(0) { parentView = wrapperView } let sortedSubviews = parentView.subviews.filter{ - return context[$0, "matchedHeroID"] == nil - }.sorted(by: direction.comparator) + return context.pairedView(for: $0) == nil + }.sorted(by: direction.comparator) - let initialDelay = options.getCGFloat(2) ?? 0 + let initialDelay = context[fv]!.delay for (i, v) in sortedSubviews.enumerated(){ - let cDelay = CGFloat(i) * deltaTime + initialDelay - context[v, "delay"] = ["\(cDelay)"] + let delay = TimeInterval(i) * deltaTime + initialDelay + context[v]?.delay = delay } - if let str = options.get(3), let shouldDelayMatchedChild = Bool(str), shouldDelayMatchedChild{ - for v in parentView.subviews{ - if context[v, "matchedHeroID"] != nil, let pairedView = context.pairedView(for: v){ - let cDelay = CGFloat(sortedSubviews.count) * deltaTime + initialDelay - context[v, "delay"] = ["\(cDelay)"] - context[pairedView, "delay"] = ["\(cDelay)"] + if delayMatchedViews { + for i in (viewIndex+1).. Void)? + public var presenting = true + fileprivate var completionCallback: (() -> Void)? - fileprivate var maxDurationNeeded:TimeInterval = 0.5 + fileprivate var maxDurationNeeded: TimeInterval = 0.0 fileprivate var inContainerController = false - fileprivate weak var transitionContext:UIViewControllerContextTransitioning? + fileprivate weak var transitionContext: UIViewControllerContextTransitioning? - fileprivate var toView:UIView { return toViewController!.view } - fileprivate var fromView:UIView { return fromViewController!.view } + fileprivate var toView: UIView { return toViewController!.view } + fileprivate var fromView: UIView { return fromViewController!.view } - fileprivate var context:HeroContext! - fileprivate var animatingViewContainer:UIView! + fileprivate var context: HeroContext! + fileprivate var animatingViewContainer: UIView! - fileprivate var processors:[HeroPreprocessor]! - fileprivate var animators:[HeroAnimator]! - fileprivate var plugins:[HeroPlugin]! + fileprivate var processors: [HeroPreprocessor]! + fileprivate var animators: [HeroAnimator]! + fileprivate var plugins: [HeroPlugin]! - fileprivate static let builtInProcessors:[HeroPreprocessor] = [ - ClearModifierPreprocessor(), - ViewToViewPreprocessor(), - SourceIDPreprocessor(), + fileprivate static let builtInProcessors: [HeroPreprocessor] = [ + IgnoreSubviewModifiersPreprocessor(), + MatchPreprocessor(), + SourcePreprocessor(), CascadePreprocessor() ] @@ -61,55 +62,66 @@ internal class Hero:NSObject { HeroDefaultAnimator() ] - fileprivate static var enabledPlugins:[HeroPlugin.Type] = [] + fileprivate static var enabledPlugins: [HeroPlugin.Type] = [] var lastProgress:Double = 0 - fileprivate var animatorViews:[([UIView],[UIView])]! + + fileprivate override init(){} } internal extension Hero { - static func isEnabled(plugin:HeroPlugin.Type) -> Bool{ + static func isEnabled(plugin: HeroPlugin.Type) -> Bool { return enabledPlugins.index(where: { return $0 == plugin}) != nil } - static func enable(plugin:HeroPlugin.Type){ + static func enable(plugin: HeroPlugin.Type) { disable(plugin: plugin) enabledPlugins.append(plugin) } - static func disable(plugin:HeroPlugin.Type){ - if let index = enabledPlugins.index(where: { return $0 == plugin}){ + static func disable(plugin: HeroPlugin.Type) { + if let index = enabledPlugins.index(where: { return $0 == plugin}) { enabledPlugins.remove(at: index) } } } +fileprivate extension Hero { + func closureProcessForHeroDelegate(vc: T, closure: (HeroViewControllerDelegate)->()) { + if let delegate = vc as? HeroViewControllerDelegate { + closure(delegate) + } + + if let navigationController = vc as? UINavigationController, + let delegate = navigationController.topViewController as? HeroViewControllerDelegate { + closure(delegate) + } + } +} + internal extension Hero { - func start(){ - if plugins == nil{ + func start() { + if plugins == nil { plugins = Hero.enabledPlugins.map({ return $0.init() }) } processors = Hero.builtInProcessors animators = Hero.builtInAnimator // swift 3 bug. no idea why it wont let me to use append(contentsOf:) or + operator - for p in plugins{ - processors.append(p) - animators.append(p) + for plugin in plugins { + processors.append(plugin) + animators.append(plugin) } - if let delegate = fromViewController as? HeroViewControllerDelegate{ - delegate.heroWillStartAnimatingTo?(viewController: toViewController!) - } - if let navigationController = fromViewController as? UINavigationController, - let delegate = navigationController.topViewController as? HeroViewControllerDelegate{ - delegate.heroWillStartAnimatingTo?(viewController: toViewController!) - } - if let delegate = toViewController as? HeroViewControllerDelegate{ - delegate.heroWillStartAnimatingFrom?(viewController: fromViewController!) - } - if let navigationController = toViewController as? UINavigationController, - let delegate = navigationController.topViewController as? HeroViewControllerDelegate{ - delegate.heroWillStartAnimatingFrom?(viewController: fromViewController!) + if let fvc = fromViewController, let tvc = toViewController { + closureProcessForHeroDelegate(vc: fvc) { + $0.heroWillStartTransition?() + $0.heroWillStartAnimatingTo?(viewController: tvc) + } + + closureProcessForHeroDelegate(vc: tvc) { + $0.heroWillStartTransition?() + $0.heroWillStartAnimatingFrom?(viewController: fvc) + } } transitionContainer.isUserInteractionEnabled = false @@ -126,7 +138,6 @@ internal extension Hero { animatingViewContainer.insertSubview(toView, belowSubview: fromView) animatingViewContainer.backgroundColor = toView.backgroundColor - toView.frame = transitionContainer.bounds toView.updateConstraints() toView.setNeedsLayout() toView.layoutIfNeeded() @@ -134,53 +145,57 @@ internal extension Hero { context = HeroContext(container:animatingViewContainer, fromView: fromView, toView:toView) // ask each preprocessor to process - for p in processors{ - p.process(context:context, fromViews: context.fromViews, toViews: context.toViews) + + for processor in processors { + processor.process(context:context, fromViews: context.fromViews, toViews: context.toViews) } - animatorViews = [] - var fromViews = context.fromViews - var toViews = context.toViews - for a in self.animators.reversed(){ - let currentFromViews = fromViews.filterInPlace{ [context] (view:UIView) -> Bool in - return !a.canAnimate(context: context!, view: view, appearing: false) + + var skipDefaultAnimation = false + var animatingViews = [([UIView],[UIView])]() + for animator in animators { + let currentFromViews = context.fromViews.filter{ [context] (view:UIView) -> Bool in + return animator.canAnimate(context: context!, view: view, appearing: false) } - let currentToViews = toViews.filterInPlace{ [context] (view:UIView) -> Bool in - return !a.canAnimate(context: context!, view: view, appearing: true) + let currentToViews = context.toViews.filter{ [context] (view:UIView) -> Bool in + return animator.canAnimate(context: context!, view: view, appearing: true) } - animatorViews.insert((currentFromViews, currentToViews), at: 0) + if currentFromViews.first == fromView || currentToViews.first == toView{ + skipDefaultAnimation = true + } + animatingViews.append((currentFromViews, currentToViews)) } - if fromViews.first == fromView && toViews.first == toView { + if !skipDefaultAnimation { // if no animator can animate toView & fromView, set the effect to fade // i.e. default effect - context[toView, "fade"] = [] - animatorViews[0].1.insert(toView, at: 0) + context[toView] = [.fade] + animatingViews[0].1.insert(toView, at: 0) } // wait for a frame if using navigation controller. // a bug with navigation controller. the snapshot is not captured if animating immediately delay(inContainerController && presenting ? 0.02 : 0) { - for (currentFromViews, currentToViews) in self.animatorViews { + for (currentFromViews, currentToViews) in animatingViews { // auto hide all animated views - for v in currentFromViews{ - v.isHidden = true + for view in currentFromViews { + self.context.hide(view: view) } - for v in currentToViews{ - v.isHidden = true + for view in currentToViews { + self.context.hide(view: view) } } - for (i, a) in self.animators.enumerated(){ - let duration = a.animate(context: self.context, - fromViews: self.animatorViews[i].0, - toViews: self.animatorViews[i].1) + for (i, animator) in self.animators.enumerated() { + let duration = animator.animate(context: self.context, + fromViews: animatingViews[i].0, + toViews: animatingViews[i].1) self.maxDurationNeeded = max(self.maxDurationNeeded, duration) } // we are done with setting up, so remove the covering snapshot completeSnapshot.removeFromSuperview() - if self.interactive{ - if self.lastProgress == 0{ + if self.interactive { + if self.lastProgress == 0 { self.update(progress: 0) } } else { @@ -191,7 +206,7 @@ internal extension Hero { } } - internal func transition(from:UIViewController, to:UIViewController, in view:UIView, completion:(() -> Void)? = nil){ + internal func transition(from: UIViewController, to: UIViewController, in view: UIView, completion: (() -> Void)? = nil) { inContainerController = false presenting = true transitionContainer = view @@ -201,29 +216,23 @@ internal extension Hero { start() } - internal func end(finished:Bool){ - guard self.transitionContainer != nil else { return } - for (i, animator) in self.animators.enumerated(){ + internal func end(finished: Bool) { + guard transitionContainer != nil else { return } + for animator in animators{ animator.clean() - for v in self.animatorViews[i].0{ - v.isHidden = false - } - for v in self.animatorViews[i].1{ - v.isHidden = false - } } + context.unhideAll() // move fromView & toView back from animatingViewContainer - self.transitionContainer.addSubview(finished ? self.toView : self.fromView) + transitionContainer.addSubview(finished ? toView : fromView) - if presenting != finished, !inContainerController{ + if presenting != finished, !inContainerController { // bug: http://openradar.appspot.com/radar?id=5320103646199808 UIApplication.shared.keyWindow!.addSubview(toView) } animatingViewContainer.removeFromSuperview() animatingViewContainer = nil - animatorViews = nil processors = nil animators = nil plugins = nil @@ -231,15 +240,13 @@ internal extension Hero { inContainerController = false interactive = false lastProgress = 0 - maxDurationNeeded = 0.5 + maxDurationNeeded = 0 - self.transitionContainer!.isUserInteractionEnabled = true + transitionContainer!.isUserInteractionEnabled = true let transitionContext = self.transitionContext - let fvc = fromViewController! - let tvc = toViewController! let completion = completionCallback - self.transitionContainer = nil + transitionContainer = nil self.transitionContext = nil fromViewController = nil toViewController = nil @@ -248,67 +255,65 @@ internal extension Hero { transitionContext?.completeTransition(finished) completion?() - if let delegate = fvc as? HeroViewControllerDelegate{ - delegate.heroDidEndAnimatingTo?(viewController: tvc) - } - if let nc = fvc as? UINavigationController, - let delegate = nc.topViewController as? HeroViewControllerDelegate{ - delegate.heroDidEndAnimatingTo?(viewController: tvc) - } - if let delegate = tvc as? HeroViewControllerDelegate{ - delegate.heroDidEndAnimatingFrom?(viewController: fvc) - } - if let nc = tvc as? UINavigationController, - let delegate = nc.topViewController as? HeroViewControllerDelegate{ - delegate.heroDidEndAnimatingFrom?(viewController: fvc) + if let fvc = fromViewController, let tvc = toViewController { + closureProcessForHeroDelegate(vc: fvc) { + $0.heroDidEndAnimatingTo?(viewController: tvc) + $0.heroDidEndTransition?() + } + + closureProcessForHeroDelegate(vc: tvc) { + $0.heroDidEndAnimatingFrom?(viewController: fvc) + $0.heroDidEndTransition?() + } } } } -extension Hero:HeroInteractiveContext{ - func update(progress: Double) { +extension Hero { + public func update(progress: Double) { let p = max(0, min(1, progress)) lastProgress = p - for a in animators{ - a.seekTo(progress: p) + for animator in animators { + animator.seekTo(timePassed: p * maxDurationNeeded) } transitionContext?.updateInteractiveTransition(CGFloat(p)) } - func end() { + public func end() { var maxTime:TimeInterval = 0 - for a in animators{ - maxTime = max(maxTime, a.resume(from:lastProgress, reverse: false)) + for animator in animators { + maxTime = max(maxTime, animator.resume(timePassed:lastProgress*maxDurationNeeded, reverse: false)) } transitionContext?.finishInteractiveTransition() - delay(maxTime){ + delay(maxTime) { self.end(finished: true) } } - func cancel() { + public func cancel() { var maxTime:TimeInterval = 0 - for a in animators{ - maxTime = max(maxTime, a.resume(from:lastProgress, reverse: true)) + for animator in animators { + maxTime = max(maxTime, animator.resume(timePassed:lastProgress*maxDurationNeeded, reverse: true)) } transitionContext?.cancelInteractiveTransition() delay(maxTime){ self.end(finished: false) } } - func temporarilySet(view:UIView, with modifiers:String){ - let modifiers = HeroContext.extractModifiers(modifierString: modifiers) + + public func temporarilySet(view:UIView, modifiers:[HeroModifier]){ + let targetState = HeroTargetState(modifiers: modifiers) if let otherView = context.pairedView(for: view){ - for a in animators{ - a.temporarilySet(view: otherView, to: modifiers) + for animator in animators { + animator.temporarilySet(view: otherView, targetState: targetState) } } - for a in animators{ - a.temporarilySet(view: view, to: modifiers) + for animator in animators { + animator.temporarilySet(view: view, targetState: targetState) } } } -extension Hero:UIViewControllerAnimatedTransitioning { - func animateTransition(using context: UIViewControllerContextTransitioning) { +extension Hero: UIViewControllerAnimatedTransitioning { + public func animateTransition(using context: UIViewControllerContextTransitioning) { if transitionContext != nil { return } @@ -319,63 +324,60 @@ extension Hero:UIViewControllerAnimatedTransitioning { start() } - func transitionDuration(using transitionContext: UIViewControllerContextTransitioning?) -> TimeInterval { - return maxDurationNeeded + public func transitionDuration(using transitionContext: UIViewControllerContextTransitioning?) -> TimeInterval { + return 0.375 } } extension Hero:UIViewControllerTransitioningDelegate { - fileprivate var interactiveTransitioning:UIViewControllerInteractiveTransitioning?{ - if let fvc = fromViewController as? HeroViewControllerDelegate{ - interactive = fvc.wantInteractiveHeroTransition?(context: self) ?? false - } - if !interactive, let navigationController = fromViewController as? UINavigationController, - let fvc = navigationController.topViewController as? HeroViewControllerDelegate{ - interactive = fvc.wantInteractiveHeroTransition?(context: self) ?? false + fileprivate var interactiveTransitioning: UIViewControllerInteractiveTransitioning? { + closureProcessForHeroDelegate(vc: fromViewController!) { + interactive = $0.wantInteractiveHeroTransition?() ?? false } - if !interactive{ - plugins = Hero.enabledPlugins.map({ return $0.init() }) - for p in plugins{ - if p.wantInteractiveHeroTransition(context: self){ + + if !interactive { + Hero.enabledPlugins.map { $0.init() }.forEach { + if $0.wantInteractiveHeroTransition() { interactive = true - break + return } } } + return interactive ? self : nil } - func animationController(forPresented presented: UIViewController, presenting: UIViewController, source: UIViewController) -> UIViewControllerAnimatedTransitioning? { + public func animationController(forPresented presented: UIViewController, presenting: UIViewController, source: UIViewController) -> UIViewControllerAnimatedTransitioning? { self.presenting = true self.fromViewController = fromViewController ?? presenting self.toViewController = toViewController ?? presented return self } - func animationController(forDismissed dismissed: UIViewController) -> UIViewControllerAnimatedTransitioning? { + public func animationController(forDismissed dismissed: UIViewController) -> UIViewControllerAnimatedTransitioning? { self.presenting = false self.fromViewController = fromViewController ?? dismissed return self } - func interactionControllerForDismissal(using animator: UIViewControllerAnimatedTransitioning) -> UIViewControllerInteractiveTransitioning? { + public func interactionControllerForDismissal(using animator: UIViewControllerAnimatedTransitioning) -> UIViewControllerInteractiveTransitioning? { return interactiveTransitioning } - func interactionControllerForPresentation(using animator: UIViewControllerAnimatedTransitioning) -> UIViewControllerInteractiveTransitioning? { + public func interactionControllerForPresentation(using animator: UIViewControllerAnimatedTransitioning) -> UIViewControllerInteractiveTransitioning? { return interactiveTransitioning } } -extension Hero:UIViewControllerInteractiveTransitioning{ - func startInteractiveTransition(_ transitionContext: UIViewControllerContextTransitioning) { +extension Hero: UIViewControllerInteractiveTransitioning { + public func startInteractiveTransition(_ transitionContext: UIViewControllerContextTransitioning) { animateTransition(using: transitionContext) } } -extension Hero:UINavigationControllerDelegate { +extension Hero: UINavigationControllerDelegate { - func navigationController(_ navigationController: UINavigationController, animationControllerFor operation: UINavigationControllerOperation, from fromVC: UIViewController, to toVC: UIViewController) -> UIViewControllerAnimatedTransitioning? { + public func navigationController(_ navigationController: UINavigationController, animationControllerFor operation: UINavigationControllerOperation, from fromVC: UIViewController, to toVC: UIViewController) -> UIViewControllerAnimatedTransitioning? { self.presenting = operation == .push self.fromViewController = fromViewController ?? fromVC self.toViewController = toViewController ?? toVC @@ -383,17 +385,17 @@ extension Hero:UINavigationControllerDelegate { return self } - func navigationController(_ navigationController: UINavigationController, interactionControllerFor animationController: UIViewControllerAnimatedTransitioning) -> UIViewControllerInteractiveTransitioning? { + public func navigationController(_ navigationController: UINavigationController, interactionControllerFor animationController: UIViewControllerAnimatedTransitioning) -> UIViewControllerInteractiveTransitioning? { return interactiveTransitioning } } -extension Hero:UITabBarControllerDelegate{ - func tabBarController(_ tabBarController: UITabBarController, interactionControllerFor animationController: UIViewControllerAnimatedTransitioning) -> UIViewControllerInteractiveTransitioning?{ +extension Hero: UITabBarControllerDelegate { + public func tabBarController(_ tabBarController: UITabBarController, interactionControllerFor animationController: UIViewControllerAnimatedTransitioning) -> UIViewControllerInteractiveTransitioning? { return interactiveTransitioning } - func tabBarController(_ tabBarController: UITabBarController, animationControllerForTransitionFrom fromVC: UIViewController, to toVC: UIViewController) -> UIViewControllerAnimatedTransitioning?{ + public func tabBarController(_ tabBarController: UITabBarController, animationControllerForTransitionFrom fromVC: UIViewController, to toVC: UIViewController) -> UIViewControllerAnimatedTransitioning? { self.presenting = true self.fromViewController = fromViewController ?? fromVC self.toViewController = toViewController ?? toVC diff --git a/Hero/HeroContext.swift b/Hero/HeroContext.swift index 63e262d3..8aec8e78 100644 --- a/Hero/HeroContext.swift +++ b/Hero/HeroContext.swift @@ -22,19 +22,16 @@ import UIKit -public typealias HeroModifiers = [(String, [String])] - public class HeroContext { - fileprivate static let parameterRegex = "(?:\\-?\\d+(\\.?\\d+)?)|\\w+" - fileprivate static let modifiersRegex = "(\\w+)(?:\\(([^\\)]*)\\))?" - fileprivate var heroIDToSourceView = [String:UIView]() fileprivate var heroIDToDestinationView = [String:UIView]() - fileprivate var modifiers = [UIView:HeroModifiers]() + fileprivate var snapshotViews = [UIView:UIView]() + fileprivate var viewAlphas = [UIView:CGFloat]() + fileprivate var targetStates = [UIView:HeroTargetState]() internal init(container:UIView, fromView:UIView, toView:UIView){ - fromViews = HeroContext.processViewTree(view: fromView, container: container, idMap: &heroIDToSourceView, modifierMap: &modifiers) - toViews = HeroContext.processViewTree(view: toView, container: container, idMap: &heroIDToDestinationView, modifierMap: &modifiers) + fromViews = HeroContext.processViewTree(view: fromView, container: container, idMap: &heroIDToSourceView, stateMap: &targetStates) + toViews = HeroContext.processViewTree(view: toView, container: container, idMap: &heroIDToDestinationView, stateMap: &targetStates) self.container = container } @@ -86,101 +83,135 @@ extension HeroContext{ } /** - - Returns: a list of all the modifier names for a given view + - Returns: a snapshot view for animation */ - public func modifierNames(for view:UIView) -> [String]?{ - return modifiers[view]?.map{ return $0.0 } - } + public func snapshotView(for view: UIView) -> UIView { + if let snapshot = snapshotViews[view] { + return snapshot + } - /** - - Returns: a list of all the modifiers for a given view - */ - public subscript(view: UIView) -> HeroModifiers? { - get { - return modifiers[view] + unhide(view: view) + + // capture a snapshot without alpha & cornerRadius + let oldCornerRadius = view.layer.cornerRadius + let oldAlpha = view.alpha + view.layer.cornerRadius = 0 + view.alpha = 1 + let snapshot:UIView + if #available(iOS 9.0, *), let stackView = view as? UIStackView{ + snapshot = stackView.slowSnapshotView() + } else if let imageView = view as? UIImageView, view.subviews.count == 0 { + let contentView = UIImageView(image: imageView.image) + contentView.frame = imageView.bounds + contentView.contentMode = imageView.contentMode + contentView.tintColor = imageView.tintColor + contentView.backgroundColor = imageView.backgroundColor + let snapShotView = UIView() + snapShotView.addSubview(contentView) + snapshot = snapShotView + } else if let barView = view as? UINavigationBar { + let newBarView = UINavigationBar(frame: barView.frame) + + newBarView.barStyle = barView.barStyle + newBarView.tintColor = barView.tintColor + newBarView.barTintColor = barView.barTintColor + newBarView.clipsToBounds = false + + // take a snapshot without the background + barView.layer.sublayers![0].opacity = 0 + let realSnapshot = barView.snapshotView(afterScreenUpdates: true)! + barView.layer.sublayers![0].opacity = 1 + + newBarView.addSubview(realSnapshot) + snapshot = newBarView + } else { + snapshot = view.snapshotView(afterScreenUpdates: true)! } - set(newValue) { - modifiers[view] = newValue + view.layer.cornerRadius = oldCornerRadius + view.alpha = oldAlpha + + if (view as? UINavigationBar) == nil { + // the Snapshot's contentView must have hold the cornerRadius value, + // since the snapshot might not have maskToBounds set + let contentView = snapshot.subviews[0] + contentView.layer.cornerRadius = view.layer.cornerRadius + contentView.layer.masksToBounds = true + } + + snapshot.layer.cornerRadius = view.layer.cornerRadius + if let zPosition = self[view]?.zPosition { + snapshot.layer.zPosition = zPosition + } else { + snapshot.layer.zPosition = view.layer.zPosition } + + snapshot.layer.opacity = view.layer.opacity + snapshot.layer.isOpaque = view.layer.isOpaque + snapshot.layer.anchorPoint = view.layer.anchorPoint + snapshot.layer.masksToBounds = view.layer.masksToBounds + snapshot.layer.borderColor = view.layer.borderColor + snapshot.layer.borderWidth = view.layer.borderWidth + snapshot.layer.transform = view.layer.transform + snapshot.layer.shadowRadius = view.layer.shadowRadius + snapshot.layer.shadowOpacity = view.layer.shadowOpacity + snapshot.layer.shadowColor = view.layer.shadowColor + snapshot.layer.shadowOffset = view.layer.shadowOffset + + snapshot.frame = container.convert(view.bounds, from: view) + snapshot.heroID = view.heroID + + hide(view: view) + + container.addSubview(snapshot) + snapshotViews[view] = snapshot + return snapshot } - - /** - - Returns: a list of all the parameters for a given view, and modifierName - */ - public subscript(view: UIView, modifierName:String) -> [String]? { + + public subscript(view: UIView) -> HeroTargetState? { get { - guard modifiers[view] != nil else { return nil } - for o in modifiers[view]!.reversed(){ - if o.0 == modifierName{ - return o.1 - } - } - return nil + return targetStates[view] } set(newValue) { - if let newValue = newValue{ - if self.modifiers[view] == nil{ - self.modifiers[view] = HeroModifiers() - } - for (i, o) in modifiers[view]!.enumerated(){ - if o.0 == modifierName{ - self.modifiers[view]![i] = (modifierName, newValue) - return - } - } - modifiers[view]!.append((modifierName, newValue)) - } else { - guard modifiers[view] != nil else { return } - for (i, o) in modifiers[view]!.enumerated(){ - if o.0 == modifierName{ - modifiers[view]!.remove(at: i) - } - } - } + targetStates[view] = newValue } } } // internal extension HeroContext{ - internal static func extractModifiers(modifierString:String) -> HeroModifiers { - func matches(for regex: String, text:NSString) -> [NSTextCheckingResult] { - do { - let regex = try NSRegularExpression(pattern: regex) - return regex.matches(in: text as String, range: NSRange(location: 0, length: text.length)) - } catch let error { - print("invalid regex: \(error.localizedDescription)") - return [] - } - } - var rtn = HeroModifiers() - let nsString = modifierString as NSString - for r in matches(for: HeroContext.modifiersRegex, text:nsString){ - var rangeStr = [String]() - if r.numberOfRanges > 2, r.rangeAt(2).location < nsString.length{ - let parameterString = nsString.substring(with: r.rangeAt(2)) as NSString - for r in matches(for: HeroContext.parameterRegex, text: parameterString){ - rangeStr.append(parameterString.substring(with: r.range)) - } - } - rtn.append((nsString.substring(with: r.rangeAt(1)), rangeStr)) + internal func hide(view:UIView) { + if viewAlphas[view] == nil{ + viewAlphas[view] = view.alpha + view.alpha = 0 } - return rtn } - - internal static func processViewTree(view:UIView, container:UIView, idMap:inout [String:UIView], modifierMap:inout [UIView:HeroModifiers]) -> [UIView]{ - if let heroID = view.heroID{ - idMap[heroID] = view + internal func unhide(view:UIView){ + if let oldAlpha = viewAlphas[view]{ + view.alpha = oldAlpha + viewAlphas[view] = nil } - if let className = view.heroModifiers{ - modifierMap[view] = extractModifiers(modifierString: className) + } + internal func unhideAll(){ + for (view, oldAlpha) in viewAlphas{ + view.alpha = oldAlpha } - var rtn:[UIView] = [] + viewAlphas.removeAll() + } + internal static func processViewTree(view:UIView, container:UIView, idMap:inout [String:UIView], stateMap:inout [UIView:HeroTargetState]) -> [UIView]{ + var rtn:[UIView] if container.convert(view.bounds, from: view).intersects(container.bounds){ - rtn.append(view) + rtn = [view] + if let heroID = view.heroID{ + idMap[heroID] = view + } + if let modifiers = view.heroModifiers { + stateMap[view] = HeroTargetState(modifiers: modifiers) + } + } else { + rtn = [] } for sv in view.subviews{ - rtn.append(contentsOf: processViewTree(view: sv, container:container, idMap:&idMap, modifierMap:&modifierMap)) + rtn.append(contentsOf: processViewTree(view: sv, container:container, idMap:&idMap, stateMap:&stateMap)) } return rtn } diff --git a/Hero/HeroDebugPlugin.swift b/Hero/HeroDebugPlugin.swift index 2a8f4703..fc535439 100644 --- a/Hero/HeroDebugPlugin.swift +++ b/Hero/HeroDebugPlugin.swift @@ -1,36 +1,46 @@ +// The MIT License (MIT) // -// HeroDebugPlugin.swift -// Pods +// Copyright (c) 2016 Luke Zhao // -// Created by Luke Zhao on 2016-12-13. +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: // +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. // +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. import UIKit public class HeroDebugPlugin: HeroPlugin { - var interactiveContext:HeroInteractiveContext? var debugView:HeroDebugView? var zPositionMap = [UIView:CGFloat]() var addedLayers:[CALayer] = [] - override public func wantInteractiveHeroTransition(context: HeroInteractiveContext) -> Bool { - interactiveContext = context + override public func wantInteractiveHeroTransition() -> Bool { return true } override public func animate(context: HeroContext, fromViews: [UIView], toViews: [UIView]) -> TimeInterval { - guard let interactiveContext = interactiveContext else { return 0 } - var hasArc = false for v in context.fromViews + context.toViews{ - if context[v, "arc"] != nil && context[v, "position"] != nil{ + if context[v]?.arc != nil && context[v]?.position != nil{ hasArc = true break } } - debugView = HeroDebugView(initialProcess: interactiveContext.presenting ? 0.0 : 1.0, showCurveButton:hasArc) - debugView!.frame = interactiveContext.container.bounds + debugView = HeroDebugView(initialProcess: Hero.shared.presenting ? 0.0 : 1.0, showCurveButton:hasArc) + debugView!.frame = Hero.shared.container.bounds debugView!.delegate = self UIApplication.shared.keyWindow!.addSubview(debugView!) @@ -43,8 +53,8 @@ public class HeroDebugPlugin: HeroPlugin { return 0 } - public override func resume(from progress: Double, reverse: Bool) -> TimeInterval { - guard interactiveContext != nil, let debugView = debugView else { return 0.4 } + public override func resume(timePassed: TimeInterval, reverse: Bool) -> TimeInterval { + guard let debugView = debugView else { return 0.4 } debugView.delegate = nil UIView.animate(withDuration: 0.4){ @@ -57,7 +67,6 @@ public class HeroDebugPlugin: HeroPlugin { } public override func clean() { - interactiveContext = nil debugView?.removeFromSuperview() debugView = nil } @@ -65,29 +74,27 @@ public class HeroDebugPlugin: HeroPlugin { extension HeroDebugPlugin:HeroDebugViewDelegate{ public func onDone() { - guard let interactiveContext = interactiveContext, let debugView = debugView else { return } - let seekValue = interactiveContext.presenting ? debugView.progress : 1.0 - debugView.progress + guard let debugView = debugView else { return } + let seekValue = Hero.shared.presenting ? debugView.progress : 1.0 - debugView.progress if seekValue > 0.5 { - interactiveContext.end() + Hero.shared.end() } else { - interactiveContext.cancel() + Hero.shared.cancel() } } public func onProcessSliderChanged(progress:Float){ - guard let interactiveContext = interactiveContext else { return } - let seekValue = interactiveContext.presenting ? progress : 1.0 - progress - interactiveContext.update(progress: Double(seekValue)) + let seekValue = Hero.shared.presenting ? progress : 1.0 - progress + Hero.shared.update(progress: Double(seekValue)) } func onPerspectiveChanged(translation:CGPoint, rotation: CGFloat, scale:CGFloat) { - guard let interactiveContext = interactiveContext else { return } var t = CATransform3DIdentity t.m34 = -1 / 4000 t = CATransform3DTranslate(t, translation.x, translation.y, 0) t = CATransform3DScale(t, scale, scale, 1) t = CATransform3DRotate(t, rotation, 0, 1, 0) - interactiveContext.container.layer.sublayerTransform = t + Hero.shared.container.layer.sublayerTransform = t } func animateZPosition(view:UIView, to:CGFloat){ @@ -101,24 +108,21 @@ extension HeroDebugPlugin:HeroDebugViewDelegate{ } func onDisplayArcCurve(wantsCurve: Bool){ - guard let context = interactiveContext else { return } for layer in addedLayers{ layer.removeFromSuperlayer() addedLayers.removeAll() } if wantsCurve { - for layer in context.container.layer.sublayers!{ - if let groupAnim = layer.animation(forKey: "hero") as? CAAnimationGroup, let anims = groupAnim.animations{ - for anim in anims{ - if let keyframeAnim = anim as? CAKeyframeAnimation, let path = keyframeAnim.path{ - let s = CAShapeLayer() - s.zPosition = layer.zPosition + 10 - s.path = path - s.strokeColor = UIColor.blue.cgColor - s.fillColor = UIColor.clear.cgColor - context.container.layer.addSublayer(s) - addedLayers.append(s) - } + for layer in Hero.shared.container.layer.sublayers!{ + for (_, anim) in layer.animations{ + if let keyframeAnim = anim as? CAKeyframeAnimation, let path = keyframeAnim.path{ + let s = CAShapeLayer() + s.zPosition = layer.zPosition + 10 + s.path = path + s.strokeColor = UIColor.blue.cgColor + s.fillColor = UIColor.clear.cgColor + Hero.shared.container.layer.addSublayer(s) + addedLayers.append(s) } } } @@ -126,18 +130,17 @@ extension HeroDebugPlugin:HeroDebugViewDelegate{ } func on3D(wants3D: Bool) { - guard let interactiveContext = interactiveContext else { return } var t = CATransform3DIdentity if wants3D{ var viewsWithZPosition = Set() - for view in interactiveContext.container.subviews{ + for view in Hero.shared.container.subviews{ if view.layer.zPosition != 0{ viewsWithZPosition.insert(view) zPositionMap[view] = view.layer.zPosition } } - let viewsWithoutZPosition = interactiveContext.container.subviews.filter{ return !viewsWithZPosition.contains($0) } + let viewsWithoutZPosition = Hero.shared.container.subviews.filter{ return !viewsWithZPosition.contains($0) } let viewsWithPositiveZPosition = viewsWithZPosition.filter{ return $0.layer.zPosition > 0 } for (i, v) in viewsWithoutZPosition.enumerated(){ @@ -155,19 +158,19 @@ extension HeroDebugPlugin:HeroDebugViewDelegate{ t = CATransform3DScale(t, debugView!.scale, debugView!.scale, 1) t = CATransform3DRotate(t, debugView!.rotation, 0, 1, 0) } else { - for v in interactiveContext.container.subviews{ + for v in Hero.shared.container.subviews{ animateZPosition(view:v, to:self.zPositionMap[v] ?? 0) } self.zPositionMap.removeAll() } let a = CABasicAnimation(keyPath: "sublayerTransform") - a.fromValue = interactiveContext.container.layer.value(forKeyPath: "sublayerTransform") + a.fromValue = Hero.shared.container.layer.value(forKeyPath: "sublayerTransform") a.toValue = NSValue(caTransform3D: t) a.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut) a.duration = 0.4 - interactiveContext.container.layer.add(a, forKey: "debug") - interactiveContext.container.layer.sublayerTransform = t + Hero.shared.container.layer.add(a, forKey: "debug") + Hero.shared.container.layer.sublayerTransform = t } } diff --git a/Hero/HeroDebugView.swift b/Hero/HeroDebugView.swift index 188b0598..3b0fc9b1 100644 --- a/Hero/HeroDebugView.swift +++ b/Hero/HeroDebugView.swift @@ -1,10 +1,24 @@ +// The MIT License (MIT) // -// HeroDebugView.swift -// Pods +// Copyright (c) 2016 Luke Zhao // -// Created by YiLun Zhao on 2016-12-14. +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: // +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. // +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. import UIKit diff --git a/Hero/HeroDefaultAnimator.swift b/Hero/HeroDefaultAnimator.swift index 2f8d2a00..34b39ad6 100644 --- a/Hero/HeroDefaultAnimator.swift +++ b/Hero/HeroDefaultAnimator.swift @@ -23,178 +23,46 @@ import UIKit public class HeroDefaultAnimator:HeroAnimator{ - var snapshots:[UIView:UIView] = [:] - - // TODO: calculate duration based on distance travelled - // https://material.io/guidelines/motion/duration-easing.html - var duration:TimeInterval = HeroDefaultAnimator.defaultAnimationDuration - static let defaultAnimationDuration:TimeInterval = 0.375 - var context:HeroContext! - var animationGroups:[CALayer:(TimeInterval, CAAnimationGroup)] = [:] - let animatableOptions:Set = ["fade", "opacity", "position", "bounds", "anchorPoint", "cornerRadius", "transform", "scale", "translate", "rotate", "forceAnimate"] - var removedAnimations:[(CALayer, CAPropertyAnimation)] = [] - var paused = true - - public func seekTo(progress:Double) { - paused = true - for (layer, (delay, anim)) in animationGroups{ - anim.speed = 0 - let timeOffset = progress * duration - delay - anim.timeOffset = max(0, min(anim.duration - 0.01, timeOffset)) - layer.removeAnimation(forKey: "hero") - layer.add(anim, forKey: "hero") + var viewContexts:[UIView: HeroDefaultAnimatorViewContext] = [:] + + public func seekTo(timePassed:TimeInterval) { + for viewContext in viewContexts.values{ + viewContext.seek(timePassed: timePassed) } } - public func resume(from progress:Double, reverse:Bool) -> TimeInterval{ - paused = false - let timePassed = (reverse ? 1 - progress : progress) * duration - - var neededTime:TimeInterval = self.duration - timePassed - for (layer, anim) in removedAnimations{ - anim.fillMode = kCAFillModeBoth - anim.isRemovedOnCompletion = false - if #available(iOS 9.0, *), let anim = anim as? CASpringAnimation{ - anim.speed = 1 - if reverse { - anim.toValue = anim.fromValue - } - anim.fromValue = layer.value(forKeyPath: anim.keyPath!) - neededTime = max(neededTime, anim.settlingDuration) - } else if let anim = anim as? CABasicAnimation{ - anim.speed = reverse ? -1 : 1 - anim.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseOut) - if reverse{ - anim.toValue = layer.value(forKeyPath: anim.keyPath!) - } else { - anim.fromValue = layer.value(forKeyPath: anim.keyPath!) - } - } - } - for (layer, (delay, group)) in animationGroups{ - group.speed = reverse ? -1 : 1 - group.timeOffset = 0 - if reverse{ - let timePassed = (1 - progress) * (delay + group.duration) - group.beginTime = layer.convertTime(CACurrentMediaTime(), from: nil) - timePassed - } else { - group.beginTime = layer.convertTime(CACurrentMediaTime(), from: nil) + delay - timePassed - } - } - for (layer, (_, group)) in animationGroups{ - layer.removeAnimation(forKey: "hero") - layer.add(group, forKey: "hero") + public func resume(timePassed:TimeInterval, reverse:Bool) -> TimeInterval{ + var duration:TimeInterval = 0 + for view in viewContexts.keys{ + viewContexts[view]!.resume(timePassed: timePassed, reverse: reverse) + duration = max(duration, viewContexts[view]!.duration) } - for (layer, anim) in removedAnimations{ - anim.duration = neededTime - layer.add(anim, forKey: "hero_\(anim.keyPath!)") - } - return neededTime + return duration } - public func temporarilySet(view:UIView, to modifiers:HeroModifiers){ - guard let snapshot = snapshots[view] else { + public func temporarilySet(view:UIView, targetState:HeroTargetState){ + guard viewContexts[view] != nil else { print("HERO: unable to temporarily set to \(view). The view must be running at least one animation before it can be interactively changed") return } - let (_, group) = animationGroups[snapshot.layer]! - let state = viewState(for: view, with: modifiers) - for (key, targetValue) in state{ - if let index = group.animations!.index(where:{ return ($0 as! CAPropertyAnimation).keyPath == key }) { - let anim = group.animations!.remove(at: index) - if let anim = anim as? CABasicAnimation{ - removedAnimations.append((snapshot.layer, anim)) - } else if let anim = anim as? CAKeyframeAnimation { - let anim = animation(for:view, key: key, fromValue: anim.values![0], toValue: anim.values![1], ignoreArc: true) - removedAnimations.append((snapshot.layer, anim)) - } - } else if removedAnimations.index(where: { return $0.0 == snapshot.layer && $0.1.keyPath == key }) == nil{ - let originValue = snapshot.layer.value(forKeyPath: key) - let anim = animation(for:view, key: key, fromValue: originValue, toValue: originValue, ignoreArc: true) - removedAnimations.append((snapshot.layer, anim)) - } - snapshot.layer.setValue(targetValue, forKeyPath: key) - if key == "bounds"{ - let contentLayer = snapshot.subviews[0].layer - if removedAnimations.index(where: { return $0.0 == contentLayer }) == nil{ - if let (_, group) = animationGroups[contentLayer]{ - for anim in group.animations!{ - removedAnimations.append((contentLayer, anim as! CAPropertyAnimation)) - } - } else { - let originBounds = contentLayer.value(forKeyPath: "bounds") - removedAnimations.append((contentLayer, animation(for:view, key: "bounds", fromValue: originBounds, toValue: originBounds))) - let originPos = contentLayer.value(forKeyPath: "position") - removedAnimations.append((contentLayer, animation(for:view, key: "position", fromValue: originPos, toValue: originPos))) - } - } - contentLayer.bounds = (targetValue as! NSValue).cgRectValue - contentLayer.position = contentLayer.bounds.center - } - } - snapshot.layer.removeAnimation(forKey: "hero") - snapshot.layer.add(group, forKey: "hero") + viewContexts[view]!.temporarilySet(targetState:targetState) } public func canAnimate(context:HeroContext, view:UIView, appearing:Bool) -> Bool{ - if let modifierNames = context.modifierNames(for: view){ - return self.animatableOptions.intersection(Set(modifierNames)).count > 0 - } - return false + guard let state = context[view] else { return false } + return state.position != nil || + state.size != nil || + state.transform != nil || + state.cornerRadius != nil || + state.opacity != nil } - + public func animate(context:HeroContext, fromViews:[UIView], toViews:[UIView]) -> TimeInterval{ - self.paused = false self.context = context - let container = context.container - - let animatingViews = fromViews + toViews - // take a snapshot view for each animating views - for v in animatingViews { - v.isHidden = false - - // capture a snapshot without cornerRadius - let oldCornerRadius = v.layer.cornerRadius - v.layer.cornerRadius = 0 - let snapshot = v.snapshotView(afterScreenUpdates: true)! - v.layer.cornerRadius = oldCornerRadius - - // the Snapshot's contentView must have hold the cornerRadius value, - // since the snapshot might not have maskToBounds set - let contentView = snapshot.subviews[0] - contentView.layer.cornerRadius = v.layer.cornerRadius - contentView.layer.masksToBounds = true - - snapshot.layer.cornerRadius = v.layer.cornerRadius - if let zPos = context[v, "zPosition"]?.getCGFloat(0){ - snapshot.layer.zPosition = zPos - } else { - snapshot.layer.zPosition = v.layer.zPosition - } - snapshot.layer.opacity = v.layer.opacity - snapshot.layer.isOpaque = v.layer.isOpaque - snapshot.layer.anchorPoint = v.layer.anchorPoint - snapshot.layer.masksToBounds = v.layer.masksToBounds - snapshot.layer.borderColor = v.layer.borderColor - snapshot.layer.borderWidth = v.layer.borderWidth - snapshot.layer.transform = v.layer.transform - snapshot.layer.shadowRadius = v.layer.shadowRadius - snapshot.layer.shadowOpacity = v.layer.shadowOpacity - snapshot.layer.shadowColor = v.layer.shadowColor - snapshot.layer.shadowOffset = v.layer.shadowOffset - - snapshot.frame = container.convert(v.bounds, from: v) - snapshot.heroID = v.heroID + var duration:TimeInterval = 0 - snapshots[v] = snapshot - v.isHidden = true - - // insert below views from other plugins - container.addSubview(snapshot) - } - // animate for v in fromViews{ animate(view: v, appearing: false) @@ -202,212 +70,22 @@ public class HeroDefaultAnimator:HeroAnimator{ for v in toViews{ animate(view: v, appearing: true) } - - return duration - } - - public func clean(){ - for (_, snapshot) in snapshots{ - snapshot.removeFromSuperview() - } - paused = true - context = nil - removedAnimations.removeAll() - animationGroups.removeAll() - snapshots.removeAll() - } -} - - -private extension HeroDefaultAnimator { - func viewState(for view:UIView, with modifiers:HeroModifiers) -> [String:Any]{ - var rtn = [String:Any]() - for (className, option) in modifiers{ - switch className { - case "bounds": - if let rect = CGRect(modifierParameters:option){ - rtn["bounds"] = NSValue(cgRect:rect) - } - case "position": - if let point = CGPoint(modifierParameters:option){ - rtn["position"] = NSValue(cgPoint:point) - } - case "anchorPoint": - if let point = CGPoint(modifierParameters:option){ - rtn["anchorPoint"] = NSValue(cgPoint:point) - } - case "fade": - rtn["opacity"] = NSNumber(value: 0) - case "cornerRadius": - if let cr = option.getFloat(0) { - rtn["cornerRadius"] = NSNumber(value: cr) - } - case "transform": - if let transform = CATransform3D(modifierParameters: option){ - rtn["transform"] = NSValue(caTransform3D:transform) - } - case "perspective", "scale", "translate", "rotate": - var t = (rtn["transform"] as? NSValue)?.caTransform3DValue ?? view.layer.transform - switch className { - case "perspective": - t.m34 = 1.0 / -(option.getCGFloat(0) ?? 500) - case "scale": - if option.count == 1{ - // default scale on both x & y - t = CATransform3DScale(t, - CGFloat(Float(option.get(0) ?? "") ?? 1), - CGFloat(Float(option.get(0) ?? "") ?? 1), - 1) - } else { - t = CATransform3DScale(t, - CGFloat(Float(option.get(0) ?? "") ?? 1), - CGFloat(Float(option.get(1) ?? "") ?? 1), - CGFloat(Float(option.get(2) ?? "") ?? 1)) - } - case "translate": - t = CATransform3DTranslate(t, - option.getCGFloat(0) ?? 0, - option.getCGFloat(1) ?? 0, - option.getCGFloat(2) ?? 0) - case "rotate": - if option.count == 1{ - // default rotate on z axis - t = CATransform3DRotate(t, CGFloat(Float(option.get(0) ?? "") ?? 0), 0, 0, 1) - } else { - t = CATransform3DRotate(t, CGFloat(Float(option.get(0) ?? "") ?? 0), 1, 0, 0) - t = CATransform3DRotate(t, CGFloat(Float(option.get(1) ?? "") ?? 0), 0, 1, 0) - t = CATransform3DRotate(t, CGFloat(Float(option.get(2) ?? "") ?? 0), 0, 0, 1) - } - default: break - } - rtn["transform"] = NSValue(caTransform3D:t) - default: break - } - } - return rtn - } - - func animation(for view:UIView, key:String, fromValue:Any?, toValue:Any?, ignoreArc:Bool = false) -> CAPropertyAnimation { - let anim:CAPropertyAnimation - var timingFunction:CAMediaTimingFunction = .standard - let duration:Double = context[view, "duration"]?.getDouble(0) ?? HeroDefaultAnimator.defaultAnimationDuration - // get the timing function - if let curveOptions = context[view, "curve"]{ - if let c1 = curveOptions.getFloat(0), - let c2 = curveOptions.getFloat(1), - let c3 = curveOptions.getFloat(2), - let c4 = curveOptions.getFloat(3){ - timingFunction = CAMediaTimingFunction(controlPoints: c1, c2, c3, c4) - } else if let ease = curveOptions.get(0), let tf = CAMediaTimingFunction.from(name:ease){ - timingFunction = tf - } - } - - if !ignoreArc, key == "position", let arcOptions = context[view, "arc"], - let fromPos = (fromValue as? NSValue)?.cgPointValue, - let toPos = (toValue as? NSValue)?.cgPointValue { - let arcIntensity = arcOptions.getCGFloat(0) ?? 1 - let kanim = CAKeyframeAnimation(keyPath: key) - - var path = CGMutablePath() - let maxControl = fromPos.y > toPos.y ? CGPoint(x: toPos.x, y: fromPos.y) : CGPoint(x: fromPos.x, y: toPos.y) - let minControl = (toPos - fromPos) / 2 + fromPos - let diff = abs(toPos - fromPos) - let curveRadius = min(diff.x, diff.y) - - path.move(to: fromPos) - path.addQuadCurve(to: toPos, control: minControl + (maxControl - minControl) * arcIntensity) - - kanim.values = [fromValue, toValue] - kanim.path = path - kanim.duration = duration - kanim.timingFunctions = [timingFunction] - anim = kanim - } else if #available(iOS 9.0, *), key != "cornerRadius", context[view, "spring"] != nil { - let sanim = CASpringAnimation(keyPath: key) - sanim.stiffness = (context[view, "spring"]?.getCGFloat(0) ?? 200) - sanim.damping = (context[view, "spring"]?.getCGFloat(1) ?? 25) - sanim.duration = sanim.settlingDuration * 0.9 - sanim.fromValue = fromValue - sanim.toValue = toValue - anim = sanim - } else { - let banim = CABasicAnimation(keyPath: key) - banim.duration = duration - banim.fromValue = fromValue - banim.toValue = toValue - banim.timingFunction = timingFunction - anim = banim - } - - anim.fillMode = kCAFillModeBoth - anim.isRemovedOnCompletion = false - return anim - } - - func applyAnimations(animations:[CAAnimation], to layer:CALayer, delay:TimeInterval, duration:TimeInterval){ - let group = CAAnimationGroup() - if delay > 0{ - group.beginTime = layer.convertTime(CACurrentMediaTime(), from: nil) + delay + for viewContext in viewContexts.values{ + duration = max(duration, viewContext.duration) } - group.duration = duration - group.fillMode = kCAFillModeBoth - group.isRemovedOnCompletion = false - group.animations = animations - layer.add(group, forKey: "hero") - layer.needsDisplayOnBoundsChange = true - self.animationGroups[layer] = (delay, group) + return duration } func animate(view:UIView, appearing:Bool){ - let snapshot = snapshots[view]! - let disappeared = viewState(for: view, with: context[view]!) - - var maxDuration:TimeInterval = HeroDefaultAnimator.defaultAnimationDuration - - var animations:[CAAnimation] = [] - var contentViewAnims:[CAAnimation] = [] - - for (k, disappearedState) in disappeared{ - let appearingState = snapshot.layer.value(forKeyPath: k) - let toValue = appearing ? appearingState : disappearedState - let fromValue = !appearing ? appearingState : disappearedState - let anim = animation(for:view, key: k, fromValue: fromValue, toValue: toValue) - maxDuration = max(maxDuration, anim.duration) - - animations.append(anim) - if k == "cornerRadius"{ - contentViewAnims.append(anim) - } else { - if k == "bounds"{ - let fromBounds = (fromValue as! NSValue).cgRectValue - let toBounds = (toValue as! NSValue).cgRectValue - - // for the snapshotView(UIReplicantView): there is a - // subview(UIReplicantContentView) that is hosting the real snapshot image. - // because we are using CAAnimations and not UIView animations, - // The snapshotView will not layout during animations. - // we have to add two more animations to manually layout the content view. - - let fromPosn = NSValue(cgPoint:fromBounds.center) - let toPosn = NSValue(cgPoint:toBounds.center) - let positionAnim = animation(for: view, key: "position", fromValue: fromPosn, toValue: toPosn, ignoreArc: true) - let boundsAnim = animation(for: view, key: "bounds", fromValue: fromValue, toValue: toValue) - contentViewAnims.append(positionAnim) - contentViewAnims.append(boundsAnim) - } - } - } - - let delay = TimeInterval(context[view, "delay"]?.getFloat(0) ?? 0) - duration = max(duration, maxDuration + delay) - applyAnimations(animations: animations, to: snapshot.layer, delay: delay, duration: maxDuration) - - if contentViewAnims.count > 0{ - let contentLayer = snapshot.subviews[0].layer - applyAnimations(animations: contentViewAnims, to: contentLayer, delay: delay, duration: maxDuration) - } + let snapshot = context.snapshotView(for: view) + let viewContext = HeroDefaultAnimatorViewContext(animator:self, snapshot: snapshot, targetState: context[view]!, appearing: appearing) + viewContexts[view] = viewContext + } + + public func clean(){ + context = nil + viewContexts.removeAll() } } diff --git a/Hero/HeroDefaultAnimatorViewContext.swift b/Hero/HeroDefaultAnimatorViewContext.swift new file mode 100644 index 00000000..2edb5654 --- /dev/null +++ b/Hero/HeroDefaultAnimatorViewContext.swift @@ -0,0 +1,280 @@ +// The MIT License (MIT) +// +// Copyright (c) 2016 Luke Zhao +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +import UIKit + +internal class HeroDefaultAnimatorViewContext { + weak var animator:HeroDefaultAnimator? + var snapshot:UIView + var state = [String:(Any, Any)]() + var duration:TimeInterval = 0 + + var targetState:HeroTargetState + var defaultTiming:(TimeInterval, CAMediaTimingFunction)! + + // computed + var contentLayer:CALayer?{ + return snapshot.layer.sublayers?.get(0) + } + var currentTime:TimeInterval{ + return snapshot.layer.convertTime(CACurrentMediaTime(), from: nil) + } + var container:UIView{ + return animator!.context.container + } + + /* + // return (delay, duration, easing) + func getTiming(key:String, fromValue:Any?, toValue:Any?) -> (TimeInterval, TimeInterval, CAMediaTimingFunction){ + // delay should be for a specific animation. this shouldn't include the baseDelay + + // TODO: dynamic delay and duration for different key + // https://material.io/guidelines/motion/choreography.html#choreography-continuity + + switch key { + case "opacity": + if let value = (toValue as? NSNumber)?.floatValue{ + switch value { + case 0.0: + // disappearing element + return (0, 0.075, .standard) + case 1.0: + // appearing element + return (0.075, defaultTiming.0 - 0.075, .standard) + default: + break + } + } + default: + break + } + return (0.0, defaultTiming.0, defaultTiming.1) + } + */ + + func getAnimation(key:String, beginTime:TimeInterval, fromValue:Any?, toValue:Any?, ignoreArc:Bool = false) -> CAPropertyAnimation { + let anim:CAPropertyAnimation + + let (delay, duration, timingFunction) = (0.0, defaultTiming.0, defaultTiming.1) + // getTiming(key: key, fromValue: fromValue, toValue: toValue) + + if !ignoreArc, key == "position", let arcIntensity = targetState.arc, + let fromPos = (fromValue as? NSValue)?.cgPointValue, + let toPos = (toValue as? NSValue)?.cgPointValue, + abs(fromPos.x - toPos.x) >= 1, abs(fromPos.y - toPos.y) >= 1 { + let kanim = CAKeyframeAnimation(keyPath: key) + + let path = CGMutablePath() + let maxControl = fromPos.y > toPos.y ? CGPoint(x: toPos.x, y: fromPos.y) : CGPoint(x: fromPos.x, y: toPos.y) + let minControl = (toPos - fromPos) / 2 + fromPos + + path.move(to: fromPos) + path.addQuadCurve(to: toPos, control: minControl + (maxControl - minControl) * arcIntensity) + + kanim.values = [fromValue!, toValue!] + kanim.path = path + kanim.duration = duration + kanim.timingFunctions = [timingFunction] + anim = kanim + } else if #available(iOS 9.0, *), key != "cornerRadius", let (stiffness, damping) = targetState.spring { + let sanim = CASpringAnimation(keyPath: key) + sanim.stiffness = stiffness + sanim.damping = damping + sanim.duration = sanim.settlingDuration * 0.9 + sanim.fromValue = fromValue + sanim.toValue = toValue + anim = sanim + } else { + let banim = CABasicAnimation(keyPath: key) + banim.duration = duration + banim.fromValue = fromValue + banim.toValue = toValue + banim.timingFunction = timingFunction + anim = banim + } + + anim.fillMode = kCAFillModeBoth + anim.isRemovedOnCompletion = false + anim.beginTime = beginTime + delay + return anim + } + + // return the completion duration of the animation (duration + initial delay, not counting the beginTime) + @discardableResult func addAnimation(key:String, beginTime:TimeInterval, fromValue:Any?, toValue:Any?) -> TimeInterval{ + let anim = getAnimation(key: key, beginTime:beginTime, fromValue: fromValue, toValue: toValue) + + snapshot.layer.add(anim, forKey: key) + if key == "cornerRadius"{ + contentLayer?.add(anim, forKey: key) + } else if key == "bounds.size"{ + let fromSize = (fromValue as! NSValue).cgSizeValue + let toSize = (toValue as! NSValue).cgSizeValue + + // for the snapshotView(UIReplicantView): there is a + // subview(UIReplicantContentView) that is hosting the real snapshot image. + // because we are using CAAnimations and not UIView animations, + // The snapshotView will not layout during animations. + // we have to add two more animations to manually layout the content view. + let fromPosn = NSValue(cgPoint:fromSize.center) + let toPosn = NSValue(cgPoint:toSize.center) + + let positionAnim = getAnimation(key: "position", beginTime:0, fromValue: fromPosn, toValue: toPosn, ignoreArc: true) + positionAnim.beginTime = anim.beginTime + positionAnim.timingFunction = anim.timingFunction + positionAnim.duration = anim.duration + + contentLayer?.add(positionAnim, forKey: "position") + contentLayer?.add(anim, forKey: key) + } + + return anim.duration + anim.beginTime - beginTime + } + + /** + - Returns: a CALayer [keyPath:value] map for animation + */ + func viewState(targetState:HeroTargetState) -> [String:Any]{ + var rtn = [String:Any]() + + if let size = targetState.size{ + rtn["bounds.size"] = NSValue(cgSize:size) + } + if let position = targetState.position{ + rtn["position"] = NSValue(cgPoint:position) + } + if let opacity = targetState.opacity{ + rtn["opacity"] = NSNumber(value: opacity.native) + } + if let cornerRadius = targetState.cornerRadius{ + rtn["cornerRadius"] = NSNumber(value: cornerRadius.native) + } + if let transform = targetState.transform{ + rtn["transform"] = NSValue(caTransform3D:transform) + } + return rtn + } + + func animate(delay:TimeInterval) { + // calculate timing default + let defaultDuration:TimeInterval + let defaultTimingFunction:CAMediaTimingFunction + + // timing function + let fromPos = (state["position"]?.0 as? NSValue)?.cgPointValue ?? snapshot.layer.position + let toPos = (state["position"]?.1 as? NSValue)?.cgPointValue ?? fromPos + let fromTransform = (state["transform"]?.0 as? NSValue)?.caTransform3DValue ?? CATransform3DIdentity + let toTransform = (state["transform"]?.1 as? NSValue)?.caTransform3DValue ?? CATransform3DIdentity + let realFromPos = CGPoint.zero.transform(fromTransform) + fromPos + let realToPos = CGPoint.zero.transform(toTransform) + toPos + + if let timingFunction = targetState.timingFunction{ + defaultTimingFunction = timingFunction + } else if !container.bounds.contains(realToPos){ + // acceleration if leaving screen + defaultTimingFunction = .acceleration + } else if !container.bounds.contains(realFromPos){ + // deceleration if entering screen + defaultTimingFunction = .deceleration + } else { + defaultTimingFunction = .standard + } + + if let duration = targetState.duration { + defaultDuration = duration + } else { + let fromSize = (state["bounds.size"]?.0 as? NSValue)?.cgSizeValue ?? snapshot.layer.bounds.size + let toSize = (state["bounds.size"]?.1 as? NSValue)?.cgSizeValue ?? fromSize + let realFromSize = fromSize.transform(fromTransform) + let realToSize = toSize.transform(toTransform) + + let movePoints = (realFromPos.distance(realToPos) + realFromSize.point.distance(realToSize.point)) + + // duration is 0.2 @ 0 to 0.375 @ 500 + defaultDuration = 0.208 + Double(movePoints.clamp(0, 500)) / 3000 + } + + defaultTiming = (defaultDuration, defaultTimingFunction) + + duration = 0 + let beginTime = currentTime + delay + for (key, (fromValue, toValue)) in state{ + let neededTime = addAnimation(key: key, beginTime:beginTime, fromValue: fromValue, toValue: toValue) + duration = max(duration, neededTime + delay) + } + } + + func temporarilySet(targetState:HeroTargetState){ + let targetState = viewState(targetState: targetState) + for (key, targetValue) in targetState{ + if state[key] == nil{ + let currentValue = snapshot.layer.value(forKeyPath: key)! + state[key] = (currentValue, currentValue) + } + addAnimation(key: key, beginTime: 0, fromValue: targetValue, toValue: targetValue) + } + } + + func resume(timePassed:TimeInterval, reverse:Bool){ + for (key, (fromValue, toValue)) in state{ + let realToValue = !reverse ? toValue : fromValue + let realFromValue = (snapshot.layer.presentation() ?? snapshot.layer).value(forKeyPath: key)! + state[key] = (realFromValue, realToValue) + } + + let realDelay = max(0, targetState.delay - timePassed) + animate(delay: realDelay) + } + + func seek(layer:CALayer, timePassed:TimeInterval){ + let timeOffset = timePassed - targetState.delay + for (key, anim) in layer.animations { + anim.speed = 0 + anim.timeOffset = max(0, min(anim.duration - 0.01, timeOffset)) + layer.removeAnimation(forKey: key) + layer.add(anim, forKey: key) + } + } + + func seek(timePassed:TimeInterval){ + seek(layer:snapshot.layer, timePassed:timePassed) + if let contentLayer = contentLayer { + seek(layer:contentLayer, timePassed:timePassed) + } + } + + init(animator:HeroDefaultAnimator, snapshot:UIView, targetState:HeroTargetState, appearing:Bool){ + self.animator = animator + self.snapshot = snapshot + self.targetState = targetState + + let disappeared = viewState(targetState: targetState) + + for (key, disappearedState) in disappeared { + let appearingState = snapshot.layer.value(forKeyPath: key)! + let toValue = appearing ? appearingState : disappearedState + let fromValue = !appearing ? appearingState : disappearedState + state[key] = (fromValue, toValue) + } + + animate(delay: targetState.delay) + } +} diff --git a/Hero/HeroModifier.swift b/Hero/HeroModifier.swift new file mode 100644 index 00000000..1f29377a --- /dev/null +++ b/Hero/HeroModifier.swift @@ -0,0 +1,374 @@ +// The MIT License (MIT) +// +// Copyright (c) 2016 Luke Zhao +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +import UIKit + +public class HeroModifier { + internal let apply:(inout HeroTargetState) -> Void + public init(applyFunction:@escaping (inout HeroTargetState) -> Void){ + apply = applyFunction + } +} + + +// basic modifiers +extension HeroModifier { + /** + Fade the view during transition + */ + public static var fade = HeroModifier { targetState in + targetState.opacity = 0 + } + + /** + Set the position for the view to animate from/to. + - Parameters: + - position: position for the view to animate from/to + */ + public static func position(_ position:CGPoint) -> HeroModifier { + return HeroModifier { targetState in + targetState.position = position + } + } + + /** + Set the size for the view to animate from/to. + - Parameters: + - size: size for the view to animate from/to + */ + public static func size(_ size:CGSize) -> HeroModifier { + return HeroModifier { targetState in + targetState.size = size + } + } +} + + +// transform modifiers +extension HeroModifier { + /** + Set the transform for the view to animate from/to. Will override previous perspective, scale, translate, & rotate modifiers + - Parameters: + - t: the CATransform3D object + */ + public static func transform(_ t:CATransform3D) -> HeroModifier { + return HeroModifier { targetState in + targetState.transform = t + } + } + + /** + Set the perspective on the transform. use in combination with the rotate modifier. + - Parameters: + - perspective: set the camera distance of the transform + */ + public static func perspective(_ perspective:CGFloat) -> HeroModifier { + return HeroModifier { targetState in + var transform = targetState.transform ?? CATransform3DIdentity + transform.m34 = 1.0 / -perspective + targetState.transform = transform + } + } + + /** + Scale 3d + - Parameters: + - x: scale factor on x axis, default 1 + - y: scale factor on y axis, default 1 + - z: scale factor on z axis, default 1 + */ + public static func scale(x:CGFloat = 1, y:CGFloat = 1, z:CGFloat = 1) -> HeroModifier { + return HeroModifier { targetState in + targetState.transform = CATransform3DScale(targetState.transform ?? CATransform3DIdentity, x, y, z) + } + } + + /** + Scale in x & y axis + - Parameters: + - xy: scale factor in both x & y axis + */ + public static func scale(_ xy:CGFloat) -> HeroModifier { + return .scale(x: xy, y: xy) + } + + /** + Translate 3d + - Parameters: + - x: translation distance on x axis in display pixel, default 0 + - y: translation distance on y axis in display pixel, default 0 + - z: translation distance on z axis in display pixel, default 0 + */ + public static func translate(x:CGFloat = 0, y:CGFloat = 0, z:CGFloat = 0) -> HeroModifier { + return HeroModifier { targetState in + targetState.transform = CATransform3DTranslate(targetState.transform ?? CATransform3DIdentity, x, y, z) + } + } + + /** + Rotate 3d + - Parameters: + - x: rotation on x axis in radian, default 0 + - y: rotation on y axis in radian, default 0 + - z: rotation on z axis in radian, default 0 + */ + public static func rotate(x:CGFloat = 0, y:CGFloat = 0, z:CGFloat = 0) -> HeroModifier { + return HeroModifier { targetState in + targetState.transform = CATransform3DRotate(targetState.transform ?? CATransform3DIdentity, x, 1, 0, 0) + targetState.transform = CATransform3DRotate(targetState.transform!, y, 0, 1, 0) + targetState.transform = CATransform3DRotate(targetState.transform!, z, 0, 0, 1) + } + } + + /** + Rotate 2d + - Parameters: + - z: rotation in radian + */ + public static func rotate(_ z:CGFloat) -> HeroModifier { + return .rotate(z: z) + } +} + +// timing modifiers +extension HeroModifier { + /** + Sets the duration of the animation for a given view. If not used, Hero will use determine the duration based on the distance and size changes. + - Parameters: + - duration: duration of the animation + */ + public static func duration(_ duration:TimeInterval) -> HeroModifier { + return HeroModifier { targetState in + targetState.duration = duration + } + } + + /** + Sets the delay of the animation for a given view. + - Parameters: + - delay: delay of the animation + */ + public static func delay(_ delay:TimeInterval) -> HeroModifier { + return HeroModifier { targetState in + targetState.delay = delay + } + } + + /** + Sets the timing function of the animation for a given view. If not used, Hero will use determine the timing function based on whether or not the view is entering or exiting the screen. + - Parameters: + - timingFunction: timing function of the animation + */ + public static func timingFunction(_ timingFunction:CAMediaTimingFunction) -> HeroModifier { + return HeroModifier { targetState in + targetState.timingFunction = timingFunction + } + } + + /** + (iOS 9+) Use spring animation with custom stiffness & damping. The duration will be automatically calculated. Will be ignored if arc, timingFunction, or duration is set. + - Parameters: + - stiffness: stiffness of the spring + - damping: stiffness of the spring + */ + @available(iOS 9, *) + public static func spring(stiffness:CGFloat, damping:CGFloat) -> HeroModifier { + return HeroModifier { targetState in + targetState.spring = (stiffness, damping) + } + } +} + + +// other modifiers +extension HeroModifier { + /** + Sets the zPosition during the animation, not animatable. + + During animation, Hero might incorrectly infer the order to draw your views. Use this modifier to adjust + the view draw order. + - Parameters: + - zPosition: zPosition during the animation + */ + public static func zPosition(_ zPosition:CGFloat) -> HeroModifier { + return HeroModifier { targetState in + targetState.zPosition = zPosition + } + } + + /** + Same as zPosition modifier but only effective only when the view is matched. Will override zPosition modifier. + - Parameters: + - zPosition: zPosition during the animation + */ + public static func zPositionIfMatched(_ zPositionIfMatched:CGFloat) -> HeroModifier { + return HeroModifier { targetState in + targetState.zPositionIfMatched = zPositionIfMatched + } + } + + /** + ignore all heroModifiers attributes for a view's direct subviews. + */ + public static var ignoreSubviewModifiers:HeroModifier = .ignoreSubviewModifiers() + + /** + ignore all heroModifiers attributes for a view's subviews. + - Parameters: + - recursive: if false, will only ignore direct subviews' modifiers. default false. + */ + public static func ignoreSubviewModifiers(recursive:Bool = false) -> HeroModifier { + return HeroModifier { targetState in + targetState.ignoreSubviewModifiers = recursive + } + } + + /** + transition from/to the state of the view with matching heroID + - Parameters: + - heroID: the source view's heroId. + */ + public static func source(heroID:String) -> HeroModifier { + return HeroModifier { targetState in + targetState.source = heroID + } + } + + /** + Works in combination with position modifier to apply a natural curve when moving to the destination. + */ + public static var arc:HeroModifier = .arc() + /** + Works in combination with position modifier to apply a natural curve when moving to the destination. + - Parameters: + - intensity: a value of 1 represent a downward natural curve ╰. a value of -1 represent a upward curve ╮. + default is 1. + */ + public static func arc(intensity:CGFloat = 1) -> HeroModifier { + return HeroModifier { targetState in + targetState.arc = intensity + } + } + + + /** + Cascade applys increasing delay modifiers to subviews + */ + public static var cascade:HeroModifier = .cascade() + + /** + Cascade applys increasing delay modifiers to subviews + - Parameters: + - delta: delay in between each animation + - direction: cascade direction + - delayMatchedViews: whether or not to delay matched subviews until all cascading animation have started + */ + public static func cascade(delta:TimeInterval = 0.02, + direction:CascadePreprocessor.CascadeDirection = .topToBottom, + delayMatchedViews:Bool = false) -> HeroModifier { + return HeroModifier { targetState in + targetState.cascade = (delta, direction, delayMatchedViews) + } + } +} + + +// construct HeroModifier from heroModifierString +extension HeroModifier{ + public static func from(name:String, parameters:[String]) -> HeroModifier? { + var modifier:HeroModifier? + switch name { + case "fade": + modifier = .fade + case "position": + modifier = .position(CGPoint(x: parameters.getCGFloat(0) ?? 0, y: parameters.getCGFloat(1) ?? 0)) + case "size": + modifier = .size(CGSize(width: parameters.getCGFloat(0) ?? 0, height: parameters.getCGFloat(1) ?? 0)) + case "scale": + if parameters.count == 1 { + modifier = .scale(parameters.getCGFloat(0) ?? 1) + } else { + modifier = .scale(x: parameters.getCGFloat(0) ?? 1, + y: parameters.getCGFloat(1) ?? 1, + z: parameters.getCGFloat(2) ?? 1) + } + case "rotate": + if parameters.count == 1 { + modifier = .rotate(parameters.getCGFloat(0) ?? 0) + } else { + modifier = .rotate(x: parameters.getCGFloat(0) ?? 0, + y: parameters.getCGFloat(1) ?? 0, + z: parameters.getCGFloat(2) ?? 0) + } + case "translate": + modifier = .translate(x: parameters.getCGFloat(0) ?? 0, + y: parameters.getCGFloat(1) ?? 0, + z: parameters.getCGFloat(2) ?? 0) + case "duration": + if let duration = parameters.getDouble(0){ + modifier = .duration(duration) + } + case "delay": + if let delay = parameters.getDouble(0){ + modifier = .delay(delay) + } + case "spring": + if #available(iOS 9, *) { + modifier = .spring(stiffness: parameters.getCGFloat(0) ?? 250, damping: parameters.getCGFloat(1) ?? 30) + } + case "timingFunction": + if let c1 = parameters.getFloat(0), + let c2 = parameters.getFloat(1), + let c3 = parameters.getFloat(2), + let c4 = parameters.getFloat(3){ + modifier = .timingFunction(CAMediaTimingFunction(controlPoints: c1, c2, c3, c4)) + } else if let name = parameters.get(0), let timingFunction = CAMediaTimingFunction.from(name:name){ + modifier = .timingFunction(timingFunction) + } + case "arc": + modifier = .arc(intensity: parameters.getCGFloat(0) ?? 1) + case "cascade": + var cascadeDirection = CascadePreprocessor.CascadeDirection.topToBottom + if let directionString = parameters.get(1), + let direction = CascadePreprocessor.CascadeDirection(directionString) { + cascadeDirection = direction + } + modifier = .cascade(delta: parameters.getDouble(0) ?? 0.02, direction: cascadeDirection, delayMatchedViews:parameters.getBool(2) ?? false) + case "source": + if let heroID = parameters.get(0){ + modifier = .source(heroID: heroID) + } + case "ignoreSubviewModifiers": + modifier = .ignoreSubviewModifiers(recursive:parameters.getBool(0) ?? false) + case "zPosition": + if let zPosition = parameters.getCGFloat(0){ + modifier = .zPosition(zPosition) + } + case "zPositionIfMatched": + if let zPosition = parameters.getCGFloat(0){ + modifier = .zPositionIfMatched(zPosition) + } + default: break + } + return modifier + } +} diff --git a/Hero/HeroPlugin.swift b/Hero/HeroPlugin.swift index b7d55ba5..a9353b4a 100644 --- a/Hero/HeroPlugin.swift +++ b/Hero/HeroPlugin.swift @@ -1,10 +1,24 @@ +// The MIT License (MIT) // -// HeroPlugin.swift -// Pods +// Copyright (c) 2016 Luke Zhao // -// Created by YiLun Zhao on 2016-12-12. +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: // +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. // +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. import UIKit @@ -70,19 +84,20 @@ open class HeroPlugin: HeroPreprocessor, HeroAnimator{ This method is called when an interactive animation is in place The plugin should pause the animation, and seek to the given progress - Parameters: - - progress: 0 to 1 Double, progress of the animation + - timePassed: time of the animation to seek to. */ - open func seekTo(progress:Double){} + open func seekTo(timePassed:TimeInterval){} /** For supporting interactive animation only. This method is called when an interactive animation is ended - The plugin should pause the animation, and seek to the given progress + The plugin should resume the animation. - Parameters: - - progress: 0 to 1 Double, progress of the animation + - timePassed: will be the same value since last `seekTo` + - reverse: a boolean value indicating whether or not the animation should reverse */ - open func resume(from progress:Double, reverse:Bool) -> TimeInterval { return 0 } + open func resume(timePassed:TimeInterval, reverse:Bool) -> TimeInterval { return 0 } /** For supporting interactive animation only. @@ -91,18 +106,18 @@ open class HeroPlugin: HeroPreprocessor, HeroAnimator{ - Parameters: - view: the view to override - - modifiers: the modifiers user want to override to + - targetState: the target state to override */ - open func temporarilySet(view:UIView, to modifiers:HeroModifiers){} + open func temporarilySet(view:UIView, targetState:HeroTargetState){} /** Plugin which wants to handle the transition interactively should return true. And also keep a reference to the context object to control the transition. - - Returns: true if the plugin wants interacive start. + - Returns: true if the plugin wants interactive start. - Parameters: - context: object which the plugin can use to control the interactive transition */ - open func wantInteractiveHeroTransition(context:HeroInteractiveContext) -> Bool { return false } + open func wantInteractiveHeroTransition() -> Bool { return false } } // methods for enable/disable the current plugin diff --git a/Hero/HeroTargetState.swift b/Hero/HeroTargetState.swift new file mode 100644 index 00000000..97e278bf --- /dev/null +++ b/Hero/HeroTargetState.swift @@ -0,0 +1,74 @@ +// The MIT License (MIT) +// +// Copyright (c) 2016 Luke Zhao +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +import UIKit + +public struct HeroTargetState { + internal var opacity:CGFloat? + internal var cornerRadius:CGFloat? + internal var position:CGPoint? + internal var size:CGSize? + internal var transform:CATransform3D? + internal var spring:(CGFloat, CGFloat)? + internal var delay:TimeInterval = 0 + internal var duration:TimeInterval? + internal var timingFunction:CAMediaTimingFunction? + internal var arc:CGFloat? + internal var zPosition:CGFloat? + internal var zPositionIfMatched:CGFloat? + internal var source:String? + internal var cascade:(TimeInterval, CascadePreprocessor.CascadeDirection, Bool)? + internal var ignoreSubviewModifiers:Bool? + + internal var custom:[String:Any]? + + init(modifiers:[HeroModifier]) { + append(contentsOf: modifiers) + } + + mutating func append(contentsOf modifiers:[HeroModifier]){ + for modifier in modifiers { + modifier.apply(&self) + } + } + + /** + - Returns: custom item for a specific key + */ + public subscript(key: String) -> Any? { + get { + return custom?[key] + } + set(newValue) { + if custom == nil { + custom = [:] + } + custom![key] = newValue + } + } +} + +extension HeroTargetState: ExpressibleByArrayLiteral { + public init(arrayLiteral elements: HeroModifier...) { + append(contentsOf: elements) + } +} diff --git a/Hero/HeroTypes.swift b/Hero/HeroTypes.swift index af6ff6e2..cf948256 100644 --- a/Hero/HeroTypes.swift +++ b/Hero/HeroTypes.swift @@ -22,17 +22,6 @@ import UIKit -@objc public protocol HeroInteractiveContext { - var container:UIView! { get } - var presenting:Bool { get } - - func update(progress:Double) - func end() - func cancel() - func temporarilySet(view:UIView, with modifiers:String) - var toViewController:UIViewController? {get} -} - public protocol HeroPreprocessor { func process(context:HeroContext, fromViews:[UIView], toViews:[UIView]) } @@ -42,17 +31,20 @@ public protocol HeroAnimator { func animate(context:HeroContext, fromViews:[UIView], toViews:[UIView]) -> TimeInterval func clean() - func seekTo(progress:Double) - func resume(from progress:Double, reverse:Bool) -> TimeInterval - func temporarilySet(view:UIView, to modifiers:HeroModifiers) + func seekTo(timePassed:TimeInterval) + func resume(timePassed:TimeInterval, reverse:Bool) -> TimeInterval + func temporarilySet(view:UIView, targetState:HeroTargetState) } @objc public protocol HeroViewControllerDelegate{ - @objc optional func wantInteractiveHeroTransition(context:HeroInteractiveContext) -> Bool + @objc optional func wantInteractiveHeroTransition() -> Bool @objc optional func heroWillStartAnimatingFrom(viewController:UIViewController) @objc optional func heroDidEndAnimatingFrom(viewController:UIViewController) - + + @objc optional func heroWillStartTransition() + @objc optional func heroDidEndTransition() + @objc optional func heroWillStartAnimatingTo(viewController:UIViewController) @objc optional func heroDidEndAnimatingTo(viewController:UIViewController) } diff --git a/Hero/IgnoreSubviewModifiersPreprocessor.swift b/Hero/IgnoreSubviewModifiersPreprocessor.swift new file mode 100644 index 00000000..04b66812 --- /dev/null +++ b/Hero/IgnoreSubviewModifiersPreprocessor.swift @@ -0,0 +1,54 @@ +// The MIT License (MIT) +// +// Copyright (c) 2016 Luke Zhao +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +import UIKit + +public class IgnoreSubviewModifiersPreprocessor:HeroPreprocessor { + public func process(context:HeroContext, fromViews:[UIView], toViews:[UIView]) { + process(context:context, views:fromViews) + process(context:context, views:toViews) + } + + private func process(context:HeroContext, views:[UIView]){ + for (viewIndex, view) in views.enumerated(){ + guard let recursive = context[view]?.ignoreSubviewModifiers else { continue } + var parentView = view + if let _ = view as? UITableView, let wrapperView = view.subviews.get(0) { + parentView = wrapperView + } + + if recursive { + for i in (viewIndex+1).. [NSTextCheckingResult] { + do { + let regex = try NSRegularExpression(pattern: regex) + return regex.matches(in: text as String, range: NSRange(location: 0, length: text.length)) + } catch let error { + print("invalid regex: \(error.localizedDescription)") + return [] + } + } + var modifiers = [HeroModifier]() + for r in matches(for: modifiersRegex, text:modifierString){ + var parameters = [String]() + if r.numberOfRanges > 2, r.rangeAt(2).location < modifierString.length{ + let parameterString = modifierString.substring(with: r.rangeAt(2)) as NSString + for r in matches(for: parameterRegex, text: parameterString){ + parameters.append(parameterString.substring(with: r.range)) + } + } + let name = modifierString.substring(with: r.rangeAt(1)) + if let modifier = HeroModifier.from(name: name, parameters: parameters){ + modifiers.append(modifier) + } + } + heroModifiers = modifiers } } + func slowSnapshotView() -> UIView{ + UIGraphicsBeginImageContextWithOptions(bounds.size, isOpaque, 0) + layer.render(in: UIGraphicsGetCurrentContext()!) +// drawHierarchy(in: bounds, afterScreenUpdates: true) + let image = UIGraphicsGetImageFromCurrentImageContext() + UIGraphicsEndImageContext() + + let imageView = UIImageView(image: image) + imageView.frame = bounds + let snapshotView = UIView(frame:bounds) + snapshotView.addSubview(imageView) + return snapshotView + } +} + +internal extension NSObject{ + func copyWithArchiver() -> Any? { + return NSKeyedUnarchiver.unarchiveObject(with: NSKeyedArchiver.archivedData(withRootObject: self))! + } +} + +public extension UIViewController{ @IBInspectable public var isHeroEnabled: Bool { get { return ((transitioningDelegate as? Hero) != nil) @@ -85,13 +125,12 @@ public extension UIViewController{ set { guard newValue != isHeroEnabled else { return } if newValue{ - hero = Hero() - transitioningDelegate = hero + transitioningDelegate = Hero.shared if let navi = self as? UINavigationController{ - navi.delegate = hero + navi.delegate = Hero.shared } if let tab = self as? UITabBarController{ - tab.delegate = hero + tab.delegate = Hero.shared } } else { if isHeroEnabled { @@ -103,7 +142,6 @@ public extension UIViewController{ if let tab = self as? UITabBarController, let _ = tab.delegate as? Hero{ tab.delegate = nil } - hero = nil } } } @@ -123,20 +161,20 @@ public extension UIViewController{ let container = self.view.superview! let oldTransitionDelegate = next.transitioningDelegate next.isHeroEnabled = true - next.hero!.transition(from: self, to: next, in: container) { + Hero.shared.transition(from: self, to: next, in: container) { if (oldTransitionDelegate as? Hero) == nil{ next.isHeroEnabled = false next.transitioningDelegate = oldTransitionDelegate } UIApplication.shared.keyWindow?.addSubview(next.view) - - self.dismiss(animated: false) { - if let parentVC = parentVC { + + if let parentVC = parentVC { + self.dismiss(animated: false) { parentVC.present(next, animated: false, completion:nil) - } else { - UIApplication.shared.keyWindow?.rootViewController = next } + } else { + UIApplication.shared.keyWindow?.rootViewController = next } } } @@ -154,22 +192,9 @@ internal extension UIImage { } internal func ==(lhs:CATransform3D, rhs:CATransform3D) -> Bool{ - return lhs.m11 == rhs.m11 && - lhs.m12 == rhs.m12 && - lhs.m13 == rhs.m13 && - lhs.m14 == rhs.m14 && - lhs.m21 == rhs.m21 && - lhs.m22 == rhs.m22 && - lhs.m23 == rhs.m23 && - lhs.m24 == rhs.m24 && - lhs.m31 == rhs.m31 && - lhs.m32 == rhs.m32 && - lhs.m33 == rhs.m33 && - lhs.m34 == rhs.m34 && - lhs.m41 == rhs.m41 && - lhs.m42 == rhs.m42 && - lhs.m43 == rhs.m43 && - lhs.m44 == rhs.m44 + var lhs = lhs + var rhs = rhs + return memcmp(&lhs, &rhs, MemoryLayout.size) == 0 } internal func !=(lhs:CATransform3D, rhs:CATransform3D) -> Bool{ diff --git a/Hero/UIKit+HeroModifier.swift b/Hero/UIKit+HeroModifier.swift deleted file mode 100644 index e5753e3c..00000000 --- a/Hero/UIKit+HeroModifier.swift +++ /dev/null @@ -1,147 +0,0 @@ -// The MIT License (MIT) -// -// Copyright (c) 2016 Luke Zhao -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import UIKit - -internal extension Array{ - func get(_ index:Int) -> Element?{ - if index < count{ - return self[index] - } - return nil - } - func getCGFloat(_ index:Int) -> CGFloat?{ - if index < count, let s = self[index] as? String, let f = Float(s){ - return CGFloat(f) - } - return nil - } - func getDouble(_ index:Int) -> Double?{ - if index < count, let s = self[index] as? String, let f = Double(s){ - return f - } - return nil - } - func getFloat(_ index:Int) -> Float?{ - if index < count, let s = self[index] as? String, let f = Float(s){ - return f - } - return nil - } - func getBool(_ index:Int) -> Bool?{ - if index < count, let s = self[index] as? String, let f = Bool(s){ - return f - } - return nil - } - - mutating func filterInPlace(_ comparator:(Element)->Bool) -> Array{ - var array2:Array = [] - self = self.filter { (element) -> Bool in - if comparator(element) { - return true - } else{ - array2.append(element) - return false - } - } - return array2 - } -} - -internal extension CGPoint{ - var modifierParameters:[String]{ - return ["\(x)","\(y)"] - } - init?(modifierParameters:[String]){ - if let x = modifierParameters.getCGFloat(0), - let y = modifierParameters.getCGFloat(1){ - self.x = x - self.y = y - } else { - return nil - } - } -} - -internal extension CGRect{ - var modifierParameters:[String]{ - return ["\(origin.x)","\(origin.y)","\(size.width)","\(size.height)"] - } - init?(modifierParameters:[String]){ - if let x = modifierParameters.getCGFloat(0), - let y = modifierParameters.getCGFloat(1), - let w = modifierParameters.getCGFloat(2), - let h = modifierParameters.getCGFloat(3){ - origin = CGPoint(x: x, y: y) - size = CGSize(width: w, height: h) - } else { - return nil - } - } -} - -internal extension CATransform3D{ - var modifierParameters:[String]{ - return ["\(m11)", "\(m12)", "\(m13)", "\(m14)", - "\(m21)", "\(m22)", "\(m23)", "\(m24)", - "\(m31)", "\(m32)", "\(m33)", "\(m34)", - "\(m41)", "\(m42)", "\(m43)", "\(m44)"] - } - init?(modifierParameters:[String]){ - if let m11 = modifierParameters.getCGFloat(0), - let m12 = modifierParameters.getCGFloat(1), - let m13 = modifierParameters.getCGFloat(2), - let m14 = modifierParameters.getCGFloat(3), - let m21 = modifierParameters.getCGFloat(4), - let m22 = modifierParameters.getCGFloat(5), - let m23 = modifierParameters.getCGFloat(6), - let m24 = modifierParameters.getCGFloat(7), - let m31 = modifierParameters.getCGFloat(8), - let m32 = modifierParameters.getCGFloat(9), - let m33 = modifierParameters.getCGFloat(10), - let m34 = modifierParameters.getCGFloat(11), - let m41 = modifierParameters.getCGFloat(12), - let m42 = modifierParameters.getCGFloat(13), - let m43 = modifierParameters.getCGFloat(14), - let m44 = modifierParameters.getCGFloat(15){ - self.m11 = m11 - self.m12 = m12 - self.m13 = m13 - self.m14 = m14 - self.m21 = m21 - self.m22 = m22 - self.m23 = m23 - self.m24 = m24 - self.m31 = m31 - self.m32 = m32 - self.m33 = m33 - self.m34 = m34 - self.m41 = m41 - self.m42 = m42 - self.m43 = m43 - self.m44 = m44 - } else { - return nil - } - } -} diff --git a/README.md b/README.md index 7dca81aa..b779095d 100644 --- a/README.md +++ b/README.md @@ -1,94 +1,99 @@ - - -Supercharged transition engine for iOS. Build your custom view transitions with few lines of code or even no code at all. Inspired by Polymer's [neon-animated-pages](https://elements.polymer-project.org/elements/neon-animation) and Keynote's `Magic Move`. + +[![Carthage compatible](https://img.shields.io/badge/Carthage-Compatible-brightgreen.svg?style=flat)](https://github.com/Carthage/Carthage) [![Version](https://img.shields.io/cocoapods/v/Hero.svg?style=flat)](http://cocoapods.org/pods/Hero) [![License](https://img.shields.io/cocoapods/l/Hero.svg?style=flat)](https://github.com/lkzhao/Hero/blob/master/LICENSE?raw=true) -![Xcode 8.0+](https://img.shields.io/badge/XCode-8.0%2B-blue.svg) +![Xcode 8.2+](https://img.shields.io/badge/Xcode-8.2%2B-blue.svg) ![iOS 8.0+](https://img.shields.io/badge/iOS-8.0%2B-blue.svg) ![Swift 3.0+](https://img.shields.io/badge/Swift-3.0%2B-orange.svg) -## Usage Guide -**[Read here](https://github.com/lkzhao/Hero/blob/master/Resources/guide.md)** +[中文 README](https://github.com/lkzhao/Hero/blob/master/README.zh-cn.md) + +## Introduction + +**Hero** is a library for building iOS view controller transitions. It provides a layer on top of the UIKit's cumbersome transition APIs. Making custom transitions an easy task for developers. + +### Features + + + +#### With Hero, you can easily mix & match these effects to build your own custom transition. + +At its core, Hero is similar to Keynote's **Magic Move**. It checks the `heroID` property on all source and destinations views. Every matched view pairs are then automatically transitioned from it's old state to it's new state. -## What is Hero? +Hero can also construct animations for unmatched views. It is easy to define these animations via the `heroModifiers` property. Hero will run these animations alongside the **Magic Move** animations. All of these can be interactive, too. -Hero is a library for building iOS view controller transitions. It provides extensions and an API layer on top of the UIKit's cumbersome transition APIs. Making custom transitions a easy task for developers. +By default, Hero provides **dynamic duration & easing** based on the [Material Design Motion Guide](https://material.io/guidelines/motion/duration-easing.html). The duration is determined by the distance and size change. The easing curve is selected base on whether or not the view is entering or exiting the screen. It save you the hassle while providing consistent and delightful animations. -At its core, Hero provides a automatic transition similar to Keynote's `Magic Move`. It does this by checking the `heroID` property on both view controllers' subviews. Every matched view pairs are then automatically transitioned from it's old state to it's new state. +Hero does not make any assumption about how the view is built or structured. It will not modify any of your views' states other than hiding them during the animation. This means that it works with **autolayout**, **programmatic layout**, **UICollectionView**(without modifying its layout object), **UITableView**, **UINavigationController**, **UITabBarController**, etc... -Hero is also able to construct animations for other views that are not matched. It is super easy to define those animations via the `heroModifiers` property. and Hero will run these animations alongside the `Magic Move` animations. Not only that, Hero is able to handle everything interactively, too. +## Video Demos +The following videos give you a general idea of what you can do with **Hero** -Hero does all of these without any assumption about how the view is built or structured. It will not modify any of your views' states other than hidding them during the animation. This means that it works great with autolayout, programmatic layout, UICollectionView, UITableView, UINavigationController etc... +1. Video overview of the **example project**. +2. Video overview of the **built-in debugger** that display timeline, arc curve, and 3d informations. +3. Video overview of the usage with [Injection App](http://johnholdsworth.com/injection.html) to provide **dynamic modifications** in realtime. Changing `HeroID` or `HeroModifiers` **without** recompiling! -## Tl;dr: This is what Hero does: -* Automatically transition matched views between view controllers -* Built in animations for unmatched views: - * Fade - * Scale - * Rotate - * Translate - * Position - * Bounds -* Attributes to tweak animation properties for each views independently - * Easing (Timing Functions) - * Spring Damping - * Spring Stiffness -* Works with - * Autolayout - * Programmatic Layout - * UINavigationController - * UITableView - * UICollectionView (without messing with UICollectionViewLayout) -* Apply `cascade` effects to these animations -* Super slim API for making all of these interactive! + + + -## Gallery +## Installation & Usage Guide +Hero is available on Carthage & Cocoapods. See the **[usage guide](https://github.com/lkzhao/Hero/wiki/Usage-Guide)** for instructions. -These transition examples can be done in minutes. download or clone the **[Project](http://github.com/lkzhao/Hero/zipball/master/)** to see how they are implemented. +##### NOTE: Hero won't work on iPhone 7 Simulators due to a [bug](https://forums.developer.apple.com/thread/63438) by Apple. Try using other simulators or a real device when working with Hero. - - - - - +## Usage Example 1 -## Tutorials + + + -### Basic HeroID Tutorial - +##### View Controller 1 +```swift +redView.heroID = "foo" +greyView.heroID = "bar" +``` -#### To achieve the transition above (3 steps) -1. **Setup the view controllers and construct the view hierarchy** +##### View Controller 2 +```swift +isHeroEnabled = true +redView.heroID = "foo" +greyView.heroID = "bar" +greenView.heroModifiers = [.translate(x:0, y:100), .scale(0.5)] +``` - -2. **Using either the StoryBoard's Identity Inspector or by code, set views' heroID** +## Usage Example 2 + + + - +##### View Controller 1 +```swift +greyView.heroID = "foo" +``` - or +##### View Controller 2 +```swift +isHeroEnabled = true +greyView.heroID = "foo" - ```swift - blueView.heroID = "blue" - ``` - - **Remember to set `heroID` to both the source view and the destination view** +// collectionView is the parent view of all red cells +collectionView.heroModifiers = [.cascade] +for cell in redCells { + cell.heroModifiers = [.fade, .scale(0.5)] +} +``` -3. **Enable Hero Transition to the destination view controller (ViewController2)** +You can do these in the **storyboard** too! - - - or - - ```swift - viewController2.isHeroEnabled = true - ``` + + -### [Music Player Tutorial](Resources/musicPlayer.md) -#### More to come +## Contribute -For detailed explaination about how **Hero ID**, **Hero Modifiers**, and supported animations, read the **[Usage Guide](https://github.com/lkzhao/Hero/blob/master/Resources/guide.md)**, or download the **[Source Code](http://github.com/lkzhao/Hero/zipball/master/)**. +We welcome any contributions. Please read the [Contribution Guide](https://github.com/lkzhao/Hero/wiki/Contribution-Guide). ## License diff --git a/README.zh-cn.md b/README.zh-cn.md new file mode 100644 index 00000000..92cd5721 --- /dev/null +++ b/README.zh-cn.md @@ -0,0 +1,93 @@ + + +[![Carthage compatible](https://img.shields.io/badge/Carthage-Compatible-brightgreen.svg?style=flat)](https://github.com/Carthage/Carthage) +[![Version](https://img.shields.io/cocoapods/v/Hero.svg?style=flat)](http://cocoapods.org/pods/Hero) +[![License](https://img.shields.io/cocoapods/l/Hero.svg?style=flat)](https://github.com/lkzhao/Hero/blob/master/LICENSE?raw=true) +![Xcode 8.2+](https://img.shields.io/badge/Xcode-8.2%2B-blue.svg) +![iOS 8.0+](https://img.shields.io/badge/iOS-8.0%2B-blue.svg) +![Swift 3.0+](https://img.shields.io/badge/Swift-3.0%2B-orange.svg) + +**Hero**是一个iOS界面切换库。它代替了UIKit本身的转场动画接口,使制作自定义的转场动画(View Controller Transition)非常简单! + +### 特点 + + + +#### 你可以使用这些效果来拼凑出你想要的转场动画。 + +Hero很像Keynote的[“神奇移动”过渡(Magic Move)](https://support.apple.com/kb/PH16959?locale=zh_CN)。在界面切换时,Hero会把开始界面的视图与结束界面的视图配对,假如他能找到一对儿有着一样的`heroID`的视图的话,Hero便会自动为此视图创建动画,从它一开始的状态移动到结束时的状态。 + +不仅如此,Hero还可以为没有配对的视图制作动画。每一个视图都可以轻易的用`heroModifiers`来告诉Hero你想为这个视图所创造的动画。交互式动画(interactive transition)也是支持的哟。 + +Hero还参照Google的[Material Design Motion Guide](https://material.io/guidelines/motion/duration-easing.html)来提供动态的动画长度与时间曲线。你不需要告诉Hero动画的长度与时间曲线,Hero会参照视图的移动长度和大小来自动选择最适合的参数。 + +无论你使用怎样的方法制作和布局你的视图,Hero都能帮你省去很多时间制作动画。Hero支持 **auto layout**, **programmatic layout**, **UICollectionView**, **UITableView**, **UINavigationController**, **UITabBarController**, 等等。。 + +## 视频 + +1. 实例介绍。**Example Project**. +2. 自带的校错程序介绍, 可以显示时间轴,曲线路线,和3D视图。**built-in debugger** + + + + +## 安装方法与用法 +Hero可以用Carthage或者Cocoapods安装,具体用法请见**[Usage Guide](https://github.com/lkzhao/Hero/wiki/Usage-Guide)**。 + +##### 注: 因为一个苹果的[bug](https://forums.developer.apple.com/thread/63438),Hero 不能在iPhone 7 Simulators上使用。 请使用其他版本的Simulator或者使用真机。 + +## 简单实例 1 + + + + + +##### View Controller 1 +```swift +redView.heroID = "foo" +greyView.heroID = "bar" +``` + +##### View Controller 2 +```swift +isHeroEnabled = true +redView.heroID = "foo" +greyView.heroID = "bar" +greenView.heroModifiers = [.translate(x:0, y:100), .scale(0.5)] +``` + + +## 简单实例 2 + + + + +##### View Controller 1 +```swift +greyView.heroID = "foo" +``` + +##### View Controller 2 +```swift +isHeroEnabled = true +greyView.heroID = "foo" + +// collectionView 是所有红色视图的父视图 +collectionView.heroModifiers = [.cascade] +for cell in redCells { + cell.heroModifiers = [.fade, .scale(0.5)] +} +``` + +Hero 还支持 **storyboard**。 你可以在Storyboard右边的Identity Inspector来使用HeroID与HeroModifiers。 + + + + +## Contribute + +We welcome any contributions. Please read the [Contribution Guide](https://github.com/lkzhao/Hero/wiki/Contribution-Guide). + +## License + +Hero is available under the MIT license. See the LICENSE file for more info. diff --git a/Resources/HeroLogo.png b/Resources/HeroLogo.png new file mode 100644 index 00000000..44e9f181 Binary files /dev/null and b/Resources/HeroLogo.png differ diff --git a/Resources/HeroLogo@2x.png b/Resources/HeroLogo@2x.png new file mode 100644 index 00000000..dc04f644 Binary files /dev/null and b/Resources/HeroLogo@2x.png differ diff --git a/Resources/ViewController.png b/Resources/ViewController.png new file mode 100644 index 00000000..7a10c4da Binary files /dev/null and b/Resources/ViewController.png differ diff --git a/Resources/ViewController@2x.png b/Resources/ViewController@2x.png new file mode 100644 index 00000000..f86a8821 Binary files /dev/null and b/Resources/ViewController@2x.png differ diff --git a/Resources/advance-animation.svg b/Resources/advance-animation.svg new file mode 100644 index 00000000..17043f22 --- /dev/null +++ b/Resources/advance-animation.svg @@ -0,0 +1,446 @@ + + + + simple + Created with Sketch. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Resources/advance-v1.svg b/Resources/advance-v1.svg new file mode 100644 index 00000000..66052deb --- /dev/null +++ b/Resources/advance-v1.svg @@ -0,0 +1,21 @@ + + + + simple + Created with Sketch. + + + + + + + + + View Controller 2 + + + + + + + \ No newline at end of file diff --git a/Resources/advance-v2.svg b/Resources/advance-v2.svg new file mode 100644 index 00000000..35651a3a --- /dev/null +++ b/Resources/advance-v2.svg @@ -0,0 +1,36 @@ + + + + simple + Created with Sketch. + + + + + + + + + View Controller 2 + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Resources/basic.gif b/Resources/basic.gif new file mode 100644 index 00000000..cf2a166c Binary files /dev/null and b/Resources/basic.gif differ diff --git a/Resources/basic.png b/Resources/basic.png new file mode 100644 index 00000000..3085bc0d Binary files /dev/null and b/Resources/basic.png differ diff --git a/Resources/basic.svg b/Resources/basic.svg new file mode 100644 index 00000000..2ae08477 --- /dev/null +++ b/Resources/basic.svg @@ -0,0 +1,345 @@ + + + + + + + + + + + + + Match + + + + + + + + + + + + + + + + + + + Scale + + + + + + + + + + + + + + + + + + + + + + + + Translate + + + + + + + + + + + + + + + + + + + + Rotate + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Resources/blue.png b/Resources/blue.png new file mode 100644 index 00000000..ca555114 Binary files /dev/null and b/Resources/blue.png differ diff --git a/Resources/blue@2x.png b/Resources/blue@2x.png new file mode 100644 index 00000000..3a9db062 Binary files /dev/null and b/Resources/blue@2x.png differ diff --git a/Resources/debugger.png b/Resources/debugger.png new file mode 100644 index 00000000..286dd565 Binary files /dev/null and b/Resources/debugger.png differ diff --git a/Resources/effects.svg b/Resources/effects.svg new file mode 100644 index 00000000..52d57d60 --- /dev/null +++ b/Resources/effects.svg @@ -0,0 +1,223 @@ + + + + + + + + + + + + + Arc + + + + + + + + + + + + + + + + + + Cascade + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Interactive + + + + + + + + + + + + + + + + + + + + + + + Dynamic + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Resources/heroTransition.gif b/Resources/heroTransition.gif new file mode 100644 index 00000000..b00b63f5 Binary files /dev/null and b/Resources/heroTransition.gif differ diff --git a/Resources/liveInjection.png b/Resources/liveInjection.png new file mode 100644 index 00000000..f83fcd40 Binary files /dev/null and b/Resources/liveInjection.png differ diff --git a/Resources/overview.png b/Resources/overview.png new file mode 100644 index 00000000..12dfd717 Binary files /dev/null and b/Resources/overview.png differ diff --git a/Resources/scaleTutorial.svg b/Resources/scaleTutorial.svg new file mode 100644 index 00000000..7797d1b1 --- /dev/null +++ b/Resources/scaleTutorial.svg @@ -0,0 +1,166 @@ + + + + scaleTutorial + Created with Sketch. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + greyLabel + + + + + + + + + + + + + + + + fade translate(0,100) scale(0.5) + + + + + + Storyboard + + + + + + + \ No newline at end of file diff --git a/Resources/simple-animation.svg b/Resources/simple-animation.svg new file mode 100644 index 00000000..f578547f --- /dev/null +++ b/Resources/simple-animation.svg @@ -0,0 +1,120 @@ + + + + simple + Created with Sketch. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Resources/simple-v1.svg b/Resources/simple-v1.svg new file mode 100644 index 00000000..21da608c --- /dev/null +++ b/Resources/simple-v1.svg @@ -0,0 +1,22 @@ + + + + simple + Created with Sketch. + + + + + + + + + + + + + + View Controller 1 + + + \ No newline at end of file diff --git a/Resources/simple-v2.svg b/Resources/simple-v2.svg new file mode 100644 index 00000000..23e4241f --- /dev/null +++ b/Resources/simple-v2.svg @@ -0,0 +1,23 @@ + + + + simple + Created with Sketch. + + + + + + + + + View Controller 2 + + + + + + + + + \ No newline at end of file diff --git a/Resources/simpleTutorial.svg b/Resources/simpleTutorial.svg new file mode 100644 index 00000000..d1ff4ca8 --- /dev/null +++ b/Resources/simpleTutorial.svg @@ -0,0 +1,189 @@ + + + + Tutorial + Created with Sketch. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + redSquare + + + + + + + + + + + + + + + + greyButton + + + + + + Storyboard + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Resources/storyboardView.png b/Resources/storyboardView.png new file mode 100644 index 00000000..72f815cc Binary files /dev/null and b/Resources/storyboardView.png differ diff --git a/Resources/storyboardViewController.png b/Resources/storyboardViewController.png new file mode 100644 index 00000000..f86a8821 Binary files /dev/null and b/Resources/storyboardViewController.png differ