Compare commits

..
45 Commits
Author SHA1 Message Date
Alex.k 3aa04958d3 added docs 2016-06-07 11:27:32 +03:00
Alex.k 43808c6d33 items count 2016-06-07 10:44:59 +03:00
Alex.k 84f19193e3 removed print 2016-06-07 10:44:01 +03:00
Alex.k a2c6b4afbf Merge branch 'master' of https://github.com/Ramotion/expanding-collection 2016-06-07 10:42:10 +03:00
Alex.k 2f74142383 small fixing 2016-06-07 10:42:05 +03:00
Alex a4df164649 Merge pull request #13 from Dershowitz011/master
Readme fixed..
2016-06-06 19:24:12 +00:00
Shantanu R Desai 729f3b7c5b Readme fixed.. 2016-06-06 23:40:40 +05:30
Alex.k 959f922708 update podspec 2016-06-06 16:33:01 +03:00
Alex.k 656aa95fea Fixes #12 2016-06-06 16:30:37 +03:00
Alex.k 0f00fde7e6 update podspec 2016-06-06 09:38:56 +03:00
Alex f9654a5358 Merge pull request #11 from patrickreynolds/fix/clean-up
Minor cleanup and refactors
2016-06-06 06:33:17 +00:00
Alex dd43c0251f Merge pull request #10 from Dershowitz011/master
Fixes the error of Type 'UIImage' has no member 'Asset' in DemoTableViewController.
2016-06-06 06:30:38 +00:00
Patrick Reynolds b3f881281e Minor clean up and refactors 2016-06-05 19:19:43 -07:00
Shantanu R Desai c17d24bcee Fixes the error of Type 'UIImage' has no member 'Asset' in DemoTableViewController 2016-06-05 00:37:21 +05:30
Alex b1853f8e2a Update README.md 2016-06-02 16:34:25 +03:00
Alex.k 58e672ef87 update podspec 2016-06-02 14:41:54 +03:00
Alex.k de040b348b update readme 2016-06-02 14:40:51 +03:00
Alex.k 01bd7502ca Merge branch 'master' of https://github.com/Ramotion/expanding-collection 2016-06-02 14:40:09 +03:00
Alex.k 8b09ecc842 update readme 2016-06-02 14:40:01 +03:00
Alex 6738ca13cb Update README.md 2016-06-02 12:51:49 +03:00
Alex 19ba6c05aa Update README.md 2016-06-02 12:51:12 +03:00
Alex.k 3184fff1e1 public outlets 2016-06-02 11:21:30 +03:00
Alex.k aec1fba654 shared scheme 2016-06-02 10:54:40 +03:00
Juri Vasylenko 9638439000 Merge pull request #4 from albinekcom/patch-1
Fix code style in collectionView method in README
2016-05-31 10:35:06 +03:00
Juri Vasylenko e6e69fa55e fix typos 2016-05-31 11:33:46 +04:00
Albin "albinek" Sadowski 5621816196 Fix code style in collectionView method in README 2016-05-30 22:02:44 +02:00
Alex 4e1d8cad4f Update README.md 2016-05-30 17:03:40 +03:00
Alex.k 8600aa0d54 Merge branch 'master' of https://github.com/Ramotion/expanding-collection 2016-05-30 16:57:37 +03:00
Alex.k aa0a14896c Fixes #1 2016-05-30 16:57:27 +03:00
Alex 46dfafada1 Merge pull request #2 from BasThomas/patch-1
Fix readme syntax highlighting
2016-05-30 13:38:57 +00:00
Bas Broek 94f0f5fb6b Fix readme syntax highlighting 2016-05-29 20:32:19 +02:00
Alex.k 8c90388bda added contributing 2016-05-27 17:47:51 +03:00
Alex.k 5623d1fe50 update readme 2016-05-27 17:40:44 +03:00
Alex.k 5cee05d1c4 update travis 2016-05-27 17:27:46 +03:00
Alex.k 185d81d648 Merge branch 'master' of https://github.com/Ramotion/expanding-collection 2016-05-27 17:26:39 +03:00
Alex.k a899d78f2b added travis file 2016-05-27 17:26:34 +03:00
RamotionRussell 538e682116 Update README.md 2016-05-27 17:05:49 +03:00
Alex.k ebf4524f3b readme 2016-05-27 16:55:36 +03:00
Alex.k 2d7a929f83 Merge branch 'master' of https://github.com/Ramotion/expanding-collection 2016-05-27 16:50:56 +03:00
Alex.k ee0b1a3d5a update readme 2016-05-27 16:50:41 +03:00
Juri Vasylenko da9febb69e Update README.md 2016-05-27 17:49:30 +04:00
Alex.k ab1b552e14 update readme 2016-05-27 16:41:53 +03:00
Alex.k d576d316c6 update readme 2016-05-27 16:38:46 +03:00
Alex.k 75d8d52d55 added readme 2016-05-27 16:30:54 +03:00
Alex.k 6d69a98dd1 small improves 2016-05-27 16:19:13 +03:00
26 changed files with 592 additions and 90 deletions
+6
View File
@@ -0,0 +1,6 @@
osx_image: xcode7.3
language: objective-c
xcode_project: DemoExpandingCollection/DemoExpandingCollection.xcodeproj
xcode_scheme: ExpandingCollection
xcode_sdk: iphonesimulator
+33
View File
@@ -0,0 +1,33 @@
# Contributing to a Project
Now that you’ve found the material for understanding the project, here is how you can take action.
### Create an Issue
If you find a bug in a project you’re using (and you don’t know how to fix it), have trouble following the documentation or have a question about the project – create an issue! There’s nothing to it and whatever issue you’re having, you’re likely not the only one, so others will find your issue helpful, too. For more information on how issues work, check out our Issues guide.
#### Issues Pro Tips
Check existing issues for your issue. Duplicating an issue is slower for both parties so search through open and closed issues to see if what you’re running into has been addressed already.
Be clear about what your problem is: what was the expected outcome, what happened instead? Detail how someone else can recreate the problem.
Link to demos recreating the problem on things like JSFiddle or CodePen.
Include system details like what the browser, library or operating system you’re using and its version.
Paste error output or logs in your issue or in a Gist. If pasting them in the issue, wrap it in three backticks: ``` so that it renders nicely.
### Pull Request
If you’re able to patch the bug or add the feature yourself – fantastic, make a pull request with the code! Be sure you’ve read any documents on contributing, understand the license and have signed a CLA if required. Once you’ve submitted a pull request the maintainer(s) can compare your branch to the existing one and decide whether or not to incorporate (pull in) your changes.
#### Pull Request Pro Tips
Fork the repository and clone it locally. Connect your local to the original ‘upstream’ repository by adding it as a remote. Pull in changes from ‘upstream’ often so that you stay up to date so that when you submit your pull request, merge conflicts will be less likely. See more detailed instructions here.
Create a branch for your edits.
Be clear about what problem is occurring and how someone can recreate that problem or why your feature will help. Then be equally as clear about the steps you took to make your changes.
It’s best to test. Run your changes against any existing tests if they exist and create new ones when needed. Whether tests exist or not, make sure your changes don’t break the existing project.
Include screenshots of the before and after if your changes include differences in HTML/CSS. Drag and drop the images into the body of your pull request.
Contribute in the style of the project to the best of your abilities. This may mean using indents, semi colons or comments differently than you would in your own repository, but makes it easier for the maintainer to merge, others to understand and maintain in the future.
#### Open Pull Requests
Once you’ve opened a pull request a discussion will start around your proposed changes. Other contributors and users may chime in, but ultimately the decision is made by the maintainer(s). You may be asked to make some changes to your pull request, if so, add more commits to your branch and push them – they’ll automatically go into the existing pull request.
If your pull request is merged – great! If it is not, no sweat, it may not be what the project maintainer had in mind, or they were already working on it. This happens, so our recommendation is to take any feedback you’ve received and go forth and pull request again – or create your own open source project.
@@ -10,7 +10,6 @@
8422CA731CF73EE4007E8522 /* AnimationBarButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8422CA701CF73EE4007E8522 /* AnimationBarButton.swift */; };
8422CA741CF73EE4007E8522 /* Rotatable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8422CA721CF73EE4007E8522 /* Rotatable.swift */; };
8485962C1CF585F3000BCC74 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8485962B1CF585F3000BCC74 /* AppDelegate.swift */; };
8485962E1CF585F3000BCC74 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8485962D1CF585F3000BCC74 /* ViewController.swift */; };
848596311CF585F3000BCC74 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8485962F1CF585F3000BCC74 /* Main.storyboard */; };
848596331CF585F3000BCC74 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 848596321CF585F3000BCC74 /* Assets.xcassets */; };
848596361CF585F3000BCC74 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 848596341CF585F3000BCC74 /* LaunchScreen.storyboard */; };
@@ -32,6 +31,20 @@
848596881CF58A62000BCC74 /* PageCollectionLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = 848596871CF58A62000BCC74 /* PageCollectionLayout.swift */; };
8485968B1CF58A7D000BCC74 /* CollectionViewHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8485968A1CF58A7D000BCC74 /* CollectionViewHelper.swift */; };
848596921CF58DE0000BCC74 /* BasePageCollectionCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 848596911CF58DE0000BCC74 /* BasePageCollectionCell.swift */; };
8499D8171D001B82004B5B37 /* ExpandingCollection.h in Headers */ = {isa = PBXBuildFile; fileRef = 8499D8161D001B82004B5B37 /* ExpandingCollection.h */; settings = {ATTRIBUTES = (Public, ); }; };
8499D81B1D001B82004B5B37 /* ExpandingCollection.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8499D8141D001B82004B5B37 /* ExpandingCollection.framework */; };
8499D81C1D001B82004B5B37 /* ExpandingCollection.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 8499D8141D001B82004B5B37 /* ExpandingCollection.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
8499D8211D001B9E004B5B37 /* BasePageCollectionCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 848596911CF58DE0000BCC74 /* BasePageCollectionCell.swift */; };
8499D8221D001BA1004B5B37 /* PageCollectionLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = 848596871CF58A62000BCC74 /* PageCollectionLayout.swift */; };
8499D8231D001BA5004B5B37 /* PageCollectionView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 848596841CF58A3F000BCC74 /* PageCollectionView.swift */; };
8499D8241D001BA8004B5B37 /* ExpandingViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 848596811CF58A36000BCC74 /* ExpandingViewController.swift */; };
8499D8251D001BAD004B5B37 /* SubviewsForEach.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84AC75E41CF6F5CB00421857 /* SubviewsForEach.swift */; };
8499D8261D001BB1004B5B37 /* ScreenShotHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8485967A1CF5897B000BCC74 /* ScreenShotHelper.swift */; };
8499D8271D001BB5004B5B37 /* ConstraintsHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 848596771CF58973000BCC74 /* ConstraintsHelper.swift */; };
8499D8281D001BBA004B5B37 /* ConfigurationHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 848596741CF58965000BCC74 /* ConfigurationHelper.swift */; };
8499D8291D001BBF004B5B37 /* CornerAnimatable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 848596711CF58954000BCC74 /* CornerAnimatable.swift */; };
8499D82A1D001BC3004B5B37 /* ExpandingTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 848596671CF58853000BCC74 /* ExpandingTableViewController.swift */; };
8499D82B1D001BC7004B5B37 /* TransitionDriver.swift in Sources */ = {isa = PBXBuildFile; fileRef = 848596601CF58763000BCC74 /* TransitionDriver.swift */; };
84AC75E51CF6F5CB00421857 /* SubviewsForEach.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84AC75E41CF6F5CB00421857 /* SubviewsForEach.swift */; };
/* End PBXBuildFile section */
@@ -43,14 +56,34 @@
remoteGlobalIDString = 848596271CF585F3000BCC74;
remoteInfo = DemoExpandingCollection;
};
8499D8191D001B82004B5B37 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 848596201CF585F3000BCC74 /* Project object */;
proxyType = 1;
remoteGlobalIDString = 8499D8131D001B82004B5B37;
remoteInfo = ExpandingCollection;
};
/* End PBXContainerItemProxy section */
/* Begin PBXCopyFilesBuildPhase section */
8499D8201D001B82004B5B37 /* Embed Frameworks */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "";
dstSubfolderSpec = 10;
files = (
8499D81C1D001B82004B5B37 /* ExpandingCollection.framework in Embed Frameworks */,
);
name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
8422CA701CF73EE4007E8522 /* AnimationBarButton.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AnimationBarButton.swift; sourceTree = "<group>"; };
8422CA721CF73EE4007E8522 /* Rotatable.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Rotatable.swift; sourceTree = "<group>"; };
848596281CF585F3000BCC74 /* DemoExpandingCollection.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = DemoExpandingCollection.app; sourceTree = BUILT_PRODUCTS_DIR; };
8485962B1CF585F3000BCC74 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
8485962D1CF585F3000BCC74 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
848596301CF585F3000BCC74 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
848596321CF585F3000BCC74 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
848596351CF585F3000BCC74 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
@@ -75,6 +108,9 @@
848596871CF58A62000BCC74 /* PageCollectionLayout.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PageCollectionLayout.swift; sourceTree = "<group>"; };
8485968A1CF58A7D000BCC74 /* CollectionViewHelper.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CollectionViewHelper.swift; sourceTree = "<group>"; };
848596911CF58DE0000BCC74 /* BasePageCollectionCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BasePageCollectionCell.swift; sourceTree = "<group>"; };
8499D8141D001B82004B5B37 /* ExpandingCollection.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = ExpandingCollection.framework; sourceTree = BUILT_PRODUCTS_DIR; };
8499D8161D001B82004B5B37 /* ExpandingCollection.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ExpandingCollection.h; sourceTree = "<group>"; };
8499D8181D001B82004B5B37 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
84AC75E41CF6F5CB00421857 /* SubviewsForEach.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SubviewsForEach.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */
@@ -83,6 +119,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
8499D81B1D001B82004B5B37 /* ExpandingCollection.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -93,6 +130,13 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
8499D8101D001B82004B5B37 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
@@ -126,6 +170,7 @@
children = (
8485962A1CF585F3000BCC74 /* DemoExpandingCollection */,
8485963F1CF585F3000BCC74 /* DemoExpandingCollectionTests */,
8499D8151D001B82004B5B37 /* ExpandingCollection */,
848596291CF585F3000BCC74 /* Products */,
);
sourceTree = "<group>";
@@ -135,6 +180,7 @@
children = (
848596281CF585F3000BCC74 /* DemoExpandingCollection.app */,
8485963C1CF585F3000BCC74 /* DemoExpandingCollectionTests.xctest */,
8499D8141D001B82004B5B37 /* ExpandingCollection.framework */,
);
name = Products;
sourceTree = "<group>";
@@ -148,7 +194,6 @@
8485965E1CF5870B000BCC74 /* Source */,
848596521CF586E0000BCC74 /* ViewControllers */,
8485962B1CF585F3000BCC74 /* AppDelegate.swift */,
8485962D1CF585F3000BCC74 /* ViewController.swift */,
8485962F1CF585F3000BCC74 /* Main.storyboard */,
848596321CF585F3000BCC74 /* Assets.xcassets */,
848596341CF585F3000BCC74 /* LaunchScreen.storyboard */,
@@ -349,6 +394,15 @@
path = Cells;
sourceTree = "<group>";
};
8499D8151D001B82004B5B37 /* ExpandingCollection */ = {
isa = PBXGroup;
children = (
8499D8161D001B82004B5B37 /* ExpandingCollection.h */,
8499D8181D001B82004B5B37 /* Info.plist */,
);
path = ExpandingCollection;
sourceTree = "<group>";
};
84AC75E31CF6F55C00421857 /* SubviewsForEach */ = {
isa = PBXGroup;
children = (
@@ -359,6 +413,17 @@
};
/* End PBXGroup section */
/* Begin PBXHeadersBuildPhase section */
8499D8111D001B82004B5B37 /* Headers */ = {
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
files = (
8499D8171D001B82004B5B37 /* ExpandingCollection.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXHeadersBuildPhase section */
/* Begin PBXNativeTarget section */
848596271CF585F3000BCC74 /* DemoExpandingCollection */ = {
isa = PBXNativeTarget;
@@ -368,10 +433,12 @@
848596241CF585F3000BCC74 /* Sources */,
848596251CF585F3000BCC74 /* Frameworks */,
848596261CF585F3000BCC74 /* Resources */,
8499D8201D001B82004B5B37 /* Embed Frameworks */,
);
buildRules = (
);
dependencies = (
8499D81A1D001B82004B5B37 /* PBXTargetDependency */,
);
name = DemoExpandingCollection;
productName = DemoExpandingCollection;
@@ -396,6 +463,24 @@
productReference = 8485963C1CF585F3000BCC74 /* DemoExpandingCollectionTests.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
8499D8131D001B82004B5B37 /* ExpandingCollection */ = {
isa = PBXNativeTarget;
buildConfigurationList = 8499D81F1D001B82004B5B37 /* Build configuration list for PBXNativeTarget "ExpandingCollection" */;
buildPhases = (
8499D80F1D001B82004B5B37 /* Sources */,
8499D8101D001B82004B5B37 /* Frameworks */,
8499D8111D001B82004B5B37 /* Headers */,
8499D8121D001B82004B5B37 /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = ExpandingCollection;
productName = ExpandingCollection;
productReference = 8499D8141D001B82004B5B37 /* ExpandingCollection.framework */;
productType = "com.apple.product-type.framework";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
@@ -414,6 +499,10 @@
CreatedOnToolsVersion = 7.3.1;
TestTargetID = 848596271CF585F3000BCC74;
};
8499D8131D001B82004B5B37 = {
CreatedOnToolsVersion = 7.3.1;
DevelopmentTeam = LEAZS7L33U;
};
};
};
buildConfigurationList = 848596231CF585F3000BCC74 /* Build configuration list for PBXProject "DemoExpandingCollection" */;
@@ -431,6 +520,7 @@
targets = (
848596271CF585F3000BCC74 /* DemoExpandingCollection */,
8485963B1CF585F3000BCC74 /* DemoExpandingCollectionTests */,
8499D8131D001B82004B5B37 /* ExpandingCollection */,
);
};
/* End PBXProject section */
@@ -454,6 +544,13 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
8499D8121D001B82004B5B37 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */
@@ -486,7 +583,6 @@
8485965B1CF586F7000BCC74 /* DemoCollectionViewCell.swift in Sources */,
8485966A1CF58853000BCC74 /* ExpandingTableViewController.swift in Sources */,
8485967B1CF5897B000BCC74 /* ScreenShotHelper.swift in Sources */,
8485962E1CF585F3000BCC74 /* ViewController.swift in Sources */,
848596721CF58954000BCC74 /* CornerAnimatable.swift in Sources */,
8422CA741CF73EE4007E8522 /* Rotatable.swift in Sources */,
8485965D1CF586F7000BCC74 /* DemoViewController.swift in Sources */,
@@ -510,6 +606,24 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
8499D80F1D001B82004B5B37 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
8499D8271D001BB5004B5B37 /* ConstraintsHelper.swift in Sources */,
8499D8221D001BA1004B5B37 /* PageCollectionLayout.swift in Sources */,
8499D8261D001BB1004B5B37 /* ScreenShotHelper.swift in Sources */,
8499D8251D001BAD004B5B37 /* SubviewsForEach.swift in Sources */,
8499D8281D001BBA004B5B37 /* ConfigurationHelper.swift in Sources */,
8499D8241D001BA8004B5B37 /* ExpandingViewController.swift in Sources */,
8499D82A1D001BC3004B5B37 /* ExpandingTableViewController.swift in Sources */,
8499D82B1D001BC7004B5B37 /* TransitionDriver.swift in Sources */,
8499D8291D001BBF004B5B37 /* CornerAnimatable.swift in Sources */,
8499D8211D001B9E004B5B37 /* BasePageCollectionCell.swift in Sources */,
8499D8231D001BA5004B5B37 /* PageCollectionView.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXTargetDependency section */
@@ -518,6 +632,11 @@
target = 848596271CF585F3000BCC74 /* DemoExpandingCollection */;
targetProxy = 8485963D1CF585F3000BCC74 /* PBXContainerItemProxy */;
};
8499D81A1D001B82004B5B37 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 8499D8131D001B82004B5B37 /* ExpandingCollection */;
targetProxy = 8499D8191D001B82004B5B37 /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */
/* Begin PBXVariantGroup section */
@@ -629,6 +748,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
EMBEDDED_CONTENT_CONTAINS_SWIFT = YES;
INFOPLIST_FILE = DemoExpandingCollection/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
@@ -644,6 +764,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
EMBEDDED_CONTENT_CONTAINS_SWIFT = YES;
INFOPLIST_FILE = DemoExpandingCollection/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
@@ -677,6 +798,52 @@
};
name = Release;
};
8499D81D1D001B82004B5B37 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CURRENT_PROJECT_VERSION = 1;
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = ExpandingCollection/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.ramotion.dev;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
TARGETED_DEVICE_FAMILY = "1,2";
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
name = Debug;
};
8499D81E1D001B82004B5B37 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CURRENT_PROJECT_VERSION = 1;
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = ExpandingCollection/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.ramotion.dev;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
TARGETED_DEVICE_FAMILY = "1,2";
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
@@ -707,6 +874,15 @@
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
8499D81F1D001B82004B5B37 /* Build configuration list for PBXNativeTarget "ExpandingCollection" */ = {
isa = XCConfigurationList;
buildConfigurations = (
8499D81D1D001B82004B5B37 /* Debug */,
8499D81E1D001B82004B5B37 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 848596201CF585F3000BCC74 /* Project object */;
@@ -0,0 +1,80 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0730"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "8499D8131D001B82004B5B37"
BuildableName = "ExpandingCollection.framework"
BlueprintName = "ExpandingCollection"
ReferencedContainer = "container:DemoExpandingCollection.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "8499D8131D001B82004B5B37"
BuildableName = "ExpandingCollection.framework"
BlueprintName = "ExpandingCollection"
ReferencedContainer = "container:DemoExpandingCollection.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "8499D8131D001B82004B5B37"
BuildableName = "ExpandingCollection.framework"
BlueprintName = "ExpandingCollection"
ReferencedContainer = "container:DemoExpandingCollection.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
@@ -55,4 +55,4 @@ extension AppDelegate {
NSShadowAttributeName: shadow
]
}
}
}
@@ -9,8 +9,9 @@
import UIKit
extension UICollectionView {
func getReusableCellWithIdentifier<T: UICollectionViewCell where T: CollectionViewCellIdentifiable>(indexPath: NSIndexPath) -> T {
guard let cell = self.dequeueReusableCellWithReuseIdentifier(T.cellIdentifier, forIndexPath: indexPath) as? T else {
guard let cell = dequeueReusableCellWithReuseIdentifier(T.cellIdentifier, forIndexPath: indexPath) as? T else {
fatalError("Couldn't instantiate view controller with identifier \(T.cellIdentifier) ")
}
@@ -23,7 +23,7 @@ extension UIStoryboard {
}
func instantiateViewController<T: UIViewController where T: StoryboardIdentifiable>() -> T {
guard let viewController = self.instantiateViewControllerWithIdentifier(T.storyboardIdentifier) as? T else {
guard let viewController = instantiateViewControllerWithIdentifier(T.storyboardIdentifier) as? T else {
fatalError("Couldn't instantiate view controller with identifier \(T.storyboardIdentifier) ")
}
@@ -1,25 +0,0 @@
//
// ViewController.swift
// DemoExpandingCollection
//
// Created by Alex K. on 25/05/16.
// Copyright © 2016 Alex K. All rights reserved.
//
import UIKit
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
}
@@ -14,7 +14,8 @@ class DemoTableViewController: ExpandingTableViewController {
override func viewDidLoad() {
super.viewDidLoad()
configureNavBar()
tableView.backgroundView = UIImageView(image: UIImage.Asset.BackgroundImage.image)
let image1 = UIImage.Asset.BackgroundImage.image
tableView.backgroundView = UIImageView(image: image1)
}
}
// MARK: Helpers
@@ -33,8 +34,10 @@ extension DemoTableViewController {
@IBAction func backButtonHandler(sender: AnyObject) {
// buttonAnimation
for case let viewController as DemoViewController in navigationController!.viewControllers {
if case let rightButton as AnimatingBarButton = viewController.navigationItem.rightBarButtonItem {
let viewControllers: [DemoViewController?] = navigationController?.viewControllers.map { $0 as? DemoViewController } ?? []
for viewController in viewControllers {
if let rightButton = viewController?.navigationItem.rightBarButtonItem as? AnimatingBarButton {
rightButton.animationSelected(false)
}
}
@@ -49,8 +52,10 @@ extension DemoTableViewController {
override func scrollViewDidScroll(scrollView: UIScrollView) {
if scrollView.contentOffset.y < -25 {
// buttonAnimation
for case let viewController as DemoViewController in navigationController!.viewControllers {
if case let rightButton as AnimatingBarButton = viewController.navigationItem.rightBarButtonItem {
let viewControllers: [DemoViewController?] = navigationController?.viewControllers.map { $0 as? DemoViewController } ?? []
for viewController in viewControllers {
if let rightButton = viewController?.navigationItem.rightBarButtonItem as? AnimatingBarButton {
rightButton.animationSelected(false)
}
}
@@ -59,4 +64,4 @@ extension DemoTableViewController {
scrollOffsetY = scrollView.contentOffset.y
}
}
}
@@ -19,6 +19,5 @@ class DemoCollectionViewCell: BasePageCollectionCell {
customTitle.layer.shadowRadius = 2
customTitle.layer.shadowOffset = CGSize(width: 0, height: 3)
customTitle.layer.shadowOpacity = 0.2
}
}
}
@@ -69,7 +69,7 @@
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="4h2-Xv-xjU">
<rect key="frame" x="0.0" y="0.0" width="256" height="335"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="image" translatesAutoresizingMaskIntoConstraints="NO" id="9FK-FA-F0l">
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="item0" translatesAutoresizingMaskIntoConstraints="NO" id="9FK-FA-F0l">
<rect key="frame" x="0.0" y="0.0" width="256" height="335"/>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" tag="101" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="ATCOASTAL" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="XFh-D7-eSl">
@@ -190,7 +190,7 @@
<resources>
<image name="dots" width="4" height="19"/>
<image name="icons" width="116" height="39"/>
<image name="image" width="375" height="382"/>
<image name="item0" width="414" height="736"/>
<image name="pinIcon" width="26" height="32"/>
<image name="stars" width="77" height="11"/>
</resources>
@@ -41,7 +41,7 @@ extension DemoViewController {
}
private func fillCellIsOpeenArry() {
for _ in 0..<items.count {
for _ in items {
cellsIsOpen.append(false)
}
}
@@ -75,15 +75,12 @@ extension DemoViewController {
func swipeHandler(sender: UISwipeGestureRecognizer) {
let indexPath = NSIndexPath(forRow: currentIndex, inSection: 0)
guard case let cell as DemoCollectionViewCell = collectionView?.cellForItemAtIndexPath(indexPath) else {
return
}
guard let cell = collectionView?.cellForItemAtIndexPath(indexPath) as? DemoCollectionViewCell else { return }
// double swipe Up transition
if cell.isOpened == true && sender.direction == .Up {
pushToViewController(getViewController())
if case let rightButton as AnimatingBarButton = navigationItem.rightBarButtonItem {
if let rightButton = navigationItem.rightBarButtonItem as? AnimatingBarButton {
rightButton.animationSelected(true)
}
}
@@ -99,7 +96,7 @@ extension DemoViewController {
extension DemoViewController {
func scrollViewDidScroll(scrollView: UIScrollView) {
pageLabel.text = "\(currentIndex)/\(items.count)"
pageLabel.text = "\(currentIndex+1)/\(items.count)"
}
}
@@ -108,28 +105,25 @@ extension DemoViewController {
extension DemoViewController {
func collectionView(collectionView: UICollectionView, willDisplayCell cell: UICollectionViewCell, forItemAtIndexPath indexPath: NSIndexPath) {
guard case let cell as DemoCollectionViewCell = cell else {
return
}
let index = indexPath.row % 4
guard let cell = cell as? DemoCollectionViewCell else { return }
let index = indexPath.row % items.count
let info = items[index]
cell.backgroundImageView?.image = UIImage(named: info.imageName)
cell.customTitle.text = info.title
cell.cellIsOpen(cellsIsOpen[indexPath.row], animated: false)
cell.cellIsOpen(cellsIsOpen[index], animated: false)
}
func collectionView(collectionView: UICollectionView, didSelectItemAtIndexPath indexPath: NSIndexPath) {
guard case let cell as DemoCollectionViewCell = collectionView.cellForItemAtIndexPath(indexPath) else {
return
}
if currentIndex != indexPath.row { return }
guard let cell = collectionView.cellForItemAtIndexPath(indexPath) as? DemoCollectionViewCell
where currentIndex == indexPath.row else { return }
if cell.isOpened == false {
cell.cellIsOpen(true)
} else {
pushToViewController(getViewController())
if case let rightButton as AnimatingBarButton = navigationItem.rightBarButtonItem {
if let rightButton = navigationItem.rightBarButtonItem as? AnimatingBarButton {
rightButton.animationSelected(true)
}
}
@@ -148,4 +142,3 @@ extension DemoViewController {
return collectionView.dequeueReusableCellWithReuseIdentifier(String(DemoCollectionViewCell), forIndexPath: indexPath)
}
}
@@ -58,10 +58,8 @@ extension AnimatingBarButton {
}
private func configureImageView(imageView: UIImageView, imageName: String) {
guard let customView = self.customView else {
return
}
guard let customView = customView else { return }
imageView.translatesAutoresizingMaskIntoConstraints = false
imageView.image = UIImage(named: imageName)
imageView.contentMode = .ScaleAspectFit
@@ -85,5 +83,4 @@ extension AnimatingBarButton {
}
}
}
}
@@ -9,12 +9,12 @@
import UIKit
protocol Rotatable {
func rotateAnimationFrom(fromItem: UIView, toItem: UIView, duration: Double)
}
extension Rotatable {
func rotateAnimationFrom(fromItem: UIView, toItem: UIView, duration: Double) {
let fromRotate = animationFrom(0, to: M_PI, key: "transform.rotation", duration: duration)
@@ -36,7 +36,7 @@ extension Rotatable {
$0.fromValue = from
$0.toValue = to
$0.fillMode = kCAFillModeForwards
$0.removedOnCompletion = false;
$0.removedOnCompletion = false
}
}
}
}
@@ -28,9 +28,8 @@ class DemoExpandingCollectionTests: XCTestCase {
func testPerformanceExample() {
// This is an example of a performance test case.
self.measureBlock {
measureBlock {
// Put the code you want to measure the time of here.
}
}
}
@@ -0,0 +1,19 @@
//
// ExpandingCollection.h
// ExpandingCollection
//
// Created by Alex K. on 02/06/16.
// Copyright © 2016 Alex K. All rights reserved.
//
#import <UIKit/UIKit.h>
//! Project version number for ExpandingCollection.
FOUNDATION_EXPORT double ExpandingCollectionVersionNumber;
//! Project version string for ExpandingCollection.
FOUNDATION_EXPORT const unsigned char ExpandingCollectionVersionString[];
// In this header, you should import all the public headers of your framework using statements like #import <ExpandingCollection/PublicHeader.h>
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>
</plist>
+147
View File
@@ -1 +1,148 @@
![header](./header.png)
# expanding-collection
[![Twitter](https://img.shields.io/badge/Twitter-@Ramotion-blue.svg?style=flat)](http://twitter.com/Ramotion)
[![CocoaPods](https://img.shields.io/cocoapods/p/expanding-collection.svg)](https://cocoapods.org/pods/expanding-collection)
[![CocoaPods](https://img.shields.io/cocoapods/v/expanding-collection.svg)](http://cocoapods.org/pods/expanding-collection)
[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Ramotion/expanding-collection)
[![Travis](https://travis-ci.org/Ramotion/elastic-pull-to-update.svg?branch=master)](https://travis-ci.org/Ramotion/elastic-pull-to-update)
[![codebeat badge](https://codebeat.co/badges/6a009992-5bf2-4730-aa35-f3b20ce7693d)](https://codebeat.co/projects/github-com-ramotion-expanding-collection)
[shot on dribbble](https://dribbble.com/shots/2741477-iOS-Expanding-Collection-Open-Source):
![Animation](preview.gif)
The [iPhone mockup](https://store.ramotion.com/product/iphone-6-mockups?utm_source=gthb&utm_medium=special&utm_campaign=expanding-collection) available [here](https://store.ramotion.com/product/iphone-6-mockups?utm_source=gthb&utm_medium=special&utm_campaign=expanding-collection).
## Requirements
- iOS 8.0+
- Xcode 7.3
## Installation
Just add the Source folder to your project.
or use [CocoaPods](https://cocoapods.org) with Podfile:
``` ruby
pod 'expanding-collection'
```
or [Carthage](https://github.com/Carthage/Carthage) users can simply add to their `Cartfile`:
```
github "Ramotion/expanding-collection"
```
## Usage
```swift
import expanding_collection
```
#### Create CollectionViewCell
![cell](./images/image2.png)
1) Create UICollectionViewCell inherit from `BasePageCollectionCell` (recommend create cell with xib file)
2) Adding FrontView
- add a view to YOURCELL.xib and connect it to `@IBOutlet weak var frontContainerView: UIView!`
- add width, height, centerX and centerY constraints (width and height constranints must equal cellSize)
![cell](./images/image1.png)
- connect centerY constraint to `@IBOutlet weak var frontConstraintY: NSLayoutConstraint!`
- add any desired uiviews to frontView
3) Adding BackView
- repeat step 2 (connect outlets to `@IBOutlet weak var backContainerView: UIView!`, `@IBOutlet weak var backConstraintY: NSLayoutConstraint!`)
4) Cell example [DemoCell](https://github.com/Ramotion/expanding-collection/tree/master/DemoExpandingCollection/DemoExpandingCollection/ViewControllers/DemoViewController/Cells)
###### If set `tag = 101` for any `FrontView.subviews` this view will be hidden during the transition animation
#### Create CollectionViewController
1) Create a UIViewController inheriting from `ExpandingViewController`
2) Register Cell and set Cell size:
``` swift
override func viewDidLoad() {
itemSize = CGSize(width: 214, height: 264)
super.viewDidLoad()
// register cell
let nib = UINib(nibName: "NibName", bundle: nil)
collectionView?.registerNib(nib, forCellWithReuseIdentifier: "CellIdentifier")
}
```
3) Add UICollectionViewDataSource methods
``` swift
extension YourViewController {
override func collectionView(collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
return items.count
}
override func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCellWithReuseIdentifier("CellIdentifier"), forIndexPath: indexPath)
// configure cell
return cell
}
}
```
4) Open Cell animation
```swift
override func viewDidLoad() {
itemSize = CGSize(width: 214, height: 264)
super.viewDidLoad()
// register cell
let nib = UINib(nibName: "CellIdentifier", bundle: nil)
collectionView?.registerNib(nib, forCellWithReuseIdentifier: String(DemoCollectionViewCell))
}
```
``` swift
func collectionView(collectionView: UICollectionView, didSelectItemAtIndexPath indexPath: NSIndexPath) {
cell.cellIsOpen(!cell.isOpened)
}
```
#### Transition animation
1) Create a UITableViewController inheriting from `ExpandingTableViewController`
2) Set header height default 236
``` swift
override func viewDidLoad() {
super.viewDidLoad()
headerHeight = ***
}
```
3) Call the push method in YourViewController to YourTableViewController
``` swift
if cell.isOpened == true {
let vc: YourTableViewController = // ... create view controller
pushToViewController(vc)
}
```
4) For back transition use `popTransitionAnimation()`
## License
Expanding collection is released under the MIT license.
See [LICENSE](./LICENSE) for details.
## About
The project maintained by [app development agency](https://ramotion.com?utm_source=gthb&utm_medium=special&utm_campaign=expanding-collection) [Ramotion Inc.](https://ramotion.com?utm_source=gthb&utm_medium=special&utm_campaign=expanding-collection)
See our other [open-source projects](https://github.com/ramotion) or [hire](https://ramotion.com?utm_source=gthb&utm_medium=special&utm_campaign=expanding-collection) us to design, develop, and grow your product.
[![Twitter URL](https://img.shields.io/twitter/url/http/shields.io.svg?style=social)](https://twitter.com/intent/tweet?text=https://github.com/ramotion/expanding-collection)
[![Twitter Follow](https://img.shields.io/twitter/follow/ramotion.svg?style=social)](https://twitter.com/ramotion)
@@ -8,16 +8,14 @@
import UIKit
/// Base class for UITableViewcontroller which have back transition method
public class ExpandingTableViewController: UITableViewController {
// MARK: Vars
var headerHeight: CGFloat = 236
var transitionDriver: TransitionDriver?
/// The height of the table view header
public var headerHeight: CGFloat = 236
public required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
}
var transitionDriver: TransitionDriver?
}
// MARK: Helpers
@@ -31,10 +29,14 @@ extension ExpandingTableViewController {
return view.takeSnapshot(CGRect(origin: backImageOrigin, size: backImageSize))
}
}
// MARK: Public
// MARK: Methods
extension ExpandingTableViewController {
/**
Pops the top view controller from the navigation stack and updates the display with custom animation.
*/
public func popTransitionAnimation() {
guard let transitionDriver = self.transitionDriver else {
return
@@ -8,9 +8,11 @@
import UIKit
/// Base class for UICollectionViewCell
public class BasePageCollectionCell: UICollectionViewCell {
@IBInspectable public var openSize: CGFloat = 40
/// Animation oposition offset when cell is open
@IBInspectable public var yOffset: CGFloat = 40
// MARK: Constants
@@ -25,23 +27,43 @@ public class BasePageCollectionCell: UICollectionViewCell {
// MARK: Vars
@IBOutlet weak var frontContainerView: UIView!
@IBOutlet weak var backContainerView: UIView!
/// The view used as the face of the cell must connectid from xib or storyboard.
@IBOutlet public weak var frontContainerView: UIView!
/// The view used as the back of the cell must connectid from xib or storyboard.
@IBOutlet public weak var backContainerView: UIView!
@IBOutlet weak var backConstraintY: NSLayoutConstraint!
@IBOutlet weak var frontConstraintY: NSLayoutConstraint!
/// constraints for backContainerView must connectid from xib or storyboard
@IBOutlet public weak var backConstraintY: NSLayoutConstraint!
/// constraints for frontContainerView must connectid from xib or storyboard
@IBOutlet public weak var frontConstraintY: NSLayoutConstraint!
var shadowView: UIView?
/// A Boolean value that indicates whether the cell is opened.
public var isOpened = false
// MARK: inits
/**
Initializes a UICollectionViewCell from data in a given unarchiver.
- parameter aDecoder: An unarchiver object.
- returns: An initialized UICollectionViewCell object.
*/
required public init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
configureOutletFromDecoder(aDecoder)
}
/**
Initializes and returns a newly allocated view object with the specified frame rectangle.
- parameter frame: The frame rectangle for the view
- returns: An initialized UICollectionViewCell object.
*/
override init(frame: CGRect) {
super.init(frame: frame)
@@ -70,18 +92,24 @@ extension BasePageCollectionCell {
extension BasePageCollectionCell {
/**
Open or close cell.
- parameter isOpen: Contains the value true if the cell should display open state, if false should display close state.
- parameter animated: Set to true if the change in selection state is animated.
*/
public func cellIsOpen(isOpen: Bool, animated: Bool = true) {
if isOpen == isOpened { return }
frontConstraintY.constant = isOpen == true ? -bounds.size.height / 5 : 0
backConstraintY.constant = isOpen == true ? bounds.size.height / 5 - openSize / 2 : 0
backConstraintY.constant = isOpen == true ? bounds.size.height / 5 - yOffset / 2 : 0
if let widthConstant = backContainerView.getConstraint(.Width) {
widthConstant.constant = isOpen == true ? contentView.bounds.size.width + openSize : contentView.bounds.size.width
widthConstant.constant = isOpen == true ? contentView.bounds.size.width + yOffset : contentView.bounds.size.width
}
if let heightConstant = backContainerView.getConstraint(.Height) {
heightConstant.constant = isOpen == true ? contentView.bounds.size.height + openSize : contentView.bounds.size.height
heightConstant.constant = isOpen == true ? contentView.bounds.size.height + yOffset : contentView.bounds.size.height
}
if animated == true {
@@ -8,17 +8,28 @@
import UIKit
/// UIViewController with UICollectionView with custom transition method
public class ExpandingViewController: UIViewController {
/// The default size to use for cells.
public var itemSize = CGSize(width: 256, height: 335)
/// The collection view object managed by this view controller.
public var collectionView: UICollectionView?
private var transitionDriver: TransitionDriver?
/// Index of current cell
public var currentIndex: Int {
guard let collectionView = self.collectionView else { return 0 }
let startOffset = (collectionView.bounds.size.width - itemSize.width) / 2
return Int((collectionView.contentOffset.x + startOffset) / (itemSize.width + 25))
guard let collectionLayout = collectionView.collectionViewLayout as? UICollectionViewFlowLayout else {
return 0
}
let minimumLineSpacing = collectionLayout.minimumLineSpacing
return Int((collectionView.contentOffset.x + startOffset + itemSize.width / 2) / (itemSize.width + minimumLineSpacing))
}
}
@@ -34,8 +45,13 @@ extension ExpandingViewController {
// MARK: Transition
extension ExpandingViewController {
public extension ExpandingViewController {
/**
Pushes a view controller onto the receiver’s stack and updates the display with custom animation.
- parameter viewController: The table view controller to push onto the stack.
*/
func pushToViewController(viewController: ExpandingTableViewController) {
guard let collectionView = self.collectionView else {
return
+1 -1
View File
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'expanding-collection'
s.version = '0.0.1'
s.version = '0.0.6'
s.summary = 'Transition animtion from CollectionView to TableView'
s.license = 'MIT'
s.homepage = 'https://github.com/Ramotion/expanding-collection'
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 108 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 MiB