Compare commits

..
15 Commits
Author SHA1 Message Date
Alex.k 6d69a98dd1 small improves 2016-05-27 16:19:13 +03:00
Alex.k bee252050b added podspec file 2016-05-27 10:56:48 +03:00
Alex.k 0bdc46adbd improves 2016-05-27 10:23:11 +03:00
Alex.k 884866d1f6 added title 2016-05-27 09:19:06 +03:00
Alex.k ba885aa710 design update 2016-05-26 17:53:00 +03:00
Alex.k 9709256851 remove magic numbers 2016-05-26 15:27:24 +03:00
Alex.k f62fdd7720 added titles 2016-05-26 15:19:22 +03:00
Alex.k e4b9dd7d6e fixing shadows 2016-05-26 14:57:18 +03:00
Alex.k ad43eff0ed tag key information 2016-05-26 12:57:53 +03:00
Alex.k d308cafc50 fixed selected non current cell 2016-05-25 14:53:19 +03:00
Alex.k 8afa951192 added alpha 2016-05-25 14:45:26 +03:00
Alex.k 6796b2aad0 refactor 2016-05-25 12:01:33 +03:00
Alex.k a43c19c08f added project 2016-05-25 11:28:01 +03:00
Alex 11811389fb Create README.md 2016-05-25 11:12:07 +03:00
Juri Vasylenko 730e302ba2 Initial commit 2016-05-25 12:01:40 +04:00
76 changed files with 3606 additions and 1016 deletions
+63
View File
@@ -0,0 +1,63 @@
# Xcode
#
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
## Build generated
build/
DerivedData
## Various settings
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata
## Other
*.xccheckout
*.moved-aside
*.xcuserstate
*.xcscmblueprint
## Obj-C/Swift specific
*.hmap
*.ipa
## Playgrounds
timeline.xctimeline
playground.xcworkspace
# Swift Package Manager
#
# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
# Packages/
.build/
# CocoaPods
#
# We recommend against adding the Pods directory to your .gitignore. However
# you should judge for yourself, the pros and cons are mentioned at:
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
#
# Pods/
# Carthage
#
# Add this line if you want to avoid checking in source code from Carthage dependencies.
# Carthage/Checkouts
Carthage/Build
# fastlane
#
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
# screenshots whenever they are needed.
# For more information about the recommended setup visit:
# https://github.com/fastlane/fastlane/blob/master/docs/Gitignore.md
fastlane/report.xml
fastlane/screenshots
@@ -0,0 +1,708 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
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 */; };
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 */; };
848596411CF585F3000BCC74 /* DemoExpandingCollectionTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 848596401CF585F3000BCC74 /* DemoExpandingCollectionTests.swift */; };
8485965A1CF586F7000BCC74 /* DemoTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 848596541CF586F7000BCC74 /* DemoTableViewController.swift */; };
8485965B1CF586F7000BCC74 /* DemoCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 848596571CF586F7000BCC74 /* DemoCollectionViewCell.swift */; };
8485965C1CF586F7000BCC74 /* DemoCollectionViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 848596581CF586F7000BCC74 /* DemoCollectionViewCell.xib */; };
8485965D1CF586F7000BCC74 /* DemoViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 848596591CF586F7000BCC74 /* DemoViewController.swift */; };
848596611CF58763000BCC74 /* TransitionDriver.swift in Sources */ = {isa = PBXBuildFile; fileRef = 848596601CF58763000BCC74 /* TransitionDriver.swift */; };
8485966A1CF58853000BCC74 /* ExpandingTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 848596671CF58853000BCC74 /* ExpandingTableViewController.swift */; };
8485966D1CF588E0000BCC74 /* Images.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8485966C1CF588E0000BCC74 /* Images.swift */; };
848596721CF58954000BCC74 /* CornerAnimatable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 848596711CF58954000BCC74 /* CornerAnimatable.swift */; };
848596751CF58965000BCC74 /* ConfigurationHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 848596741CF58965000BCC74 /* ConfigurationHelper.swift */; };
848596781CF58973000BCC74 /* ConstraintsHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 848596771CF58973000BCC74 /* ConstraintsHelper.swift */; };
8485967B1CF5897B000BCC74 /* ScreenShotHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8485967A1CF5897B000BCC74 /* ScreenShotHelper.swift */; };
8485967F1CF589C4000BCC74 /* StoryboardHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8485967E1CF589C4000BCC74 /* StoryboardHelper.swift */; };
848596821CF58A36000BCC74 /* ExpandingViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 848596811CF58A36000BCC74 /* ExpandingViewController.swift */; };
848596851CF58A3F000BCC74 /* PageCollectionView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 848596841CF58A3F000BCC74 /* PageCollectionView.swift */; };
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 */; };
84AC75E51CF6F5CB00421857 /* SubviewsForEach.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84AC75E41CF6F5CB00421857 /* SubviewsForEach.swift */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
8485963D1CF585F3000BCC74 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 848596201CF585F3000BCC74 /* Project object */;
proxyType = 1;
remoteGlobalIDString = 848596271CF585F3000BCC74;
remoteInfo = DemoExpandingCollection;
};
/* End PBXContainerItemProxy 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>"; };
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>"; };
848596371CF585F3000BCC74 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
8485963C1CF585F3000BCC74 /* DemoExpandingCollectionTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = DemoExpandingCollectionTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
848596401CF585F3000BCC74 /* DemoExpandingCollectionTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DemoExpandingCollectionTests.swift; sourceTree = "<group>"; };
848596421CF585F3000BCC74 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
848596541CF586F7000BCC74 /* DemoTableViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DemoTableViewController.swift; sourceTree = "<group>"; };
848596571CF586F7000BCC74 /* DemoCollectionViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DemoCollectionViewCell.swift; sourceTree = "<group>"; };
848596581CF586F7000BCC74 /* DemoCollectionViewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = DemoCollectionViewCell.xib; sourceTree = "<group>"; };
848596591CF586F7000BCC74 /* DemoViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DemoViewController.swift; sourceTree = "<group>"; };
848596601CF58763000BCC74 /* TransitionDriver.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TransitionDriver.swift; sourceTree = "<group>"; };
848596671CF58853000BCC74 /* ExpandingTableViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ExpandingTableViewController.swift; sourceTree = "<group>"; };
8485966C1CF588E0000BCC74 /* Images.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Images.swift; sourceTree = "<group>"; };
848596711CF58954000BCC74 /* CornerAnimatable.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CornerAnimatable.swift; sourceTree = "<group>"; };
848596741CF58965000BCC74 /* ConfigurationHelper.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ConfigurationHelper.swift; sourceTree = "<group>"; };
848596771CF58973000BCC74 /* ConstraintsHelper.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ConstraintsHelper.swift; sourceTree = "<group>"; };
8485967A1CF5897B000BCC74 /* ScreenShotHelper.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ScreenShotHelper.swift; sourceTree = "<group>"; };
8485967E1CF589C4000BCC74 /* StoryboardHelper.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StoryboardHelper.swift; sourceTree = "<group>"; };
848596811CF58A36000BCC74 /* ExpandingViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ExpandingViewController.swift; sourceTree = "<group>"; };
848596841CF58A3F000BCC74 /* PageCollectionView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PageCollectionView.swift; sourceTree = "<group>"; };
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>"; };
84AC75E41CF6F5CB00421857 /* SubviewsForEach.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SubviewsForEach.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
848596251CF585F3000BCC74 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
848596391CF585F3000BCC74 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
8422CA6E1CF73ECD007E8522 /* Views */ = {
isa = PBXGroup;
children = (
8422CA6F1CF73EE4007E8522 /* AnimatingBarButton */,
);
path = Views;
sourceTree = "<group>";
};
8422CA6F1CF73EE4007E8522 /* AnimatingBarButton */ = {
isa = PBXGroup;
children = (
8422CA701CF73EE4007E8522 /* AnimationBarButton.swift */,
8422CA711CF73EE4007E8522 /* Animations */,
);
path = AnimatingBarButton;
sourceTree = "<group>";
};
8422CA711CF73EE4007E8522 /* Animations */ = {
isa = PBXGroup;
children = (
8422CA721CF73EE4007E8522 /* Rotatable.swift */,
);
path = Animations;
sourceTree = "<group>";
};
8485961F1CF585F3000BCC74 = {
isa = PBXGroup;
children = (
8485962A1CF585F3000BCC74 /* DemoExpandingCollection */,
8485963F1CF585F3000BCC74 /* DemoExpandingCollectionTests */,
848596291CF585F3000BCC74 /* Products */,
);
sourceTree = "<group>";
};
848596291CF585F3000BCC74 /* Products */ = {
isa = PBXGroup;
children = (
848596281CF585F3000BCC74 /* DemoExpandingCollection.app */,
8485963C1CF585F3000BCC74 /* DemoExpandingCollectionTests.xctest */,
);
name = Products;
sourceTree = "<group>";
};
8485962A1CF585F3000BCC74 /* DemoExpandingCollection */ = {
isa = PBXGroup;
children = (
8422CA6E1CF73ECD007E8522 /* Views */,
8485967C1CF589A4000BCC74 /* Helpers */,
8485966B1CF588E0000BCC74 /* Constants */,
8485965E1CF5870B000BCC74 /* Source */,
848596521CF586E0000BCC74 /* ViewControllers */,
8485962B1CF585F3000BCC74 /* AppDelegate.swift */,
8485962F1CF585F3000BCC74 /* Main.storyboard */,
848596321CF585F3000BCC74 /* Assets.xcassets */,
848596341CF585F3000BCC74 /* LaunchScreen.storyboard */,
848596371CF585F3000BCC74 /* Info.plist */,
);
path = DemoExpandingCollection;
sourceTree = "<group>";
};
8485963F1CF585F3000BCC74 /* DemoExpandingCollectionTests */ = {
isa = PBXGroup;
children = (
848596401CF585F3000BCC74 /* DemoExpandingCollectionTests.swift */,
848596421CF585F3000BCC74 /* Info.plist */,
);
path = DemoExpandingCollectionTests;
sourceTree = "<group>";
};
848596521CF586E0000BCC74 /* ViewControllers */ = {
isa = PBXGroup;
children = (
848596531CF586F7000BCC74 /* DemoTableViewController */,
848596551CF586F7000BCC74 /* DemoViewController */,
);
path = ViewControllers;
sourceTree = "<group>";
};
848596531CF586F7000BCC74 /* DemoTableViewController */ = {
isa = PBXGroup;
children = (
848596541CF586F7000BCC74 /* DemoTableViewController.swift */,
);
path = DemoTableViewController;
sourceTree = "<group>";
};
848596551CF586F7000BCC74 /* DemoViewController */ = {
isa = PBXGroup;
children = (
848596561CF586F7000BCC74 /* Cells */,
848596591CF586F7000BCC74 /* DemoViewController.swift */,
);
path = DemoViewController;
sourceTree = "<group>";
};
848596561CF586F7000BCC74 /* Cells */ = {
isa = PBXGroup;
children = (
848596571CF586F7000BCC74 /* DemoCollectionViewCell.swift */,
848596581CF586F7000BCC74 /* DemoCollectionViewCell.xib */,
);
path = Cells;
sourceTree = "<group>";
};
8485965E1CF5870B000BCC74 /* Source */ = {
isa = PBXGroup;
children = (
848596801CF589F9000BCC74 /* ExpandingViewController */,
8485966E1CF5891D000BCC74 /* Helpers */,
848596621CF5881E000BCC74 /* ExpandingTableViewController */,
8485965F1CF58763000BCC74 /* TransitionDriver */,
);
name = Source;
path = ../../Source;
sourceTree = "<group>";
};
8485965F1CF58763000BCC74 /* TransitionDriver */ = {
isa = PBXGroup;
children = (
848596601CF58763000BCC74 /* TransitionDriver.swift */,
);
path = TransitionDriver;
sourceTree = "<group>";
};
848596621CF5881E000BCC74 /* ExpandingTableViewController */ = {
isa = PBXGroup;
children = (
848596671CF58853000BCC74 /* ExpandingTableViewController.swift */,
);
path = ExpandingTableViewController;
sourceTree = "<group>";
};
8485966B1CF588E0000BCC74 /* Constants */ = {
isa = PBXGroup;
children = (
8485966C1CF588E0000BCC74 /* Images.swift */,
);
path = Constants;
sourceTree = "<group>";
};
8485966E1CF5891D000BCC74 /* Helpers */ = {
isa = PBXGroup;
children = (
84AC75E31CF6F55C00421857 /* SubviewsForEach */,
848596791CF5897B000BCC74 /* ScreenShot */,
848596761CF58973000BCC74 /* Constraints Helpers */,
848596731CF58965000BCC74 /* ConfigurationHelper */,
8485966F1CF58954000BCC74 /* Animations */,
);
path = Helpers;
sourceTree = "<group>";
};
8485966F1CF58954000BCC74 /* Animations */ = {
isa = PBXGroup;
children = (
848596701CF58954000BCC74 /* CornerAnimatable */,
);
path = Animations;
sourceTree = "<group>";
};
848596701CF58954000BCC74 /* CornerAnimatable */ = {
isa = PBXGroup;
children = (
848596711CF58954000BCC74 /* CornerAnimatable.swift */,
);
path = CornerAnimatable;
sourceTree = "<group>";
};
848596731CF58965000BCC74 /* ConfigurationHelper */ = {
isa = PBXGroup;
children = (
848596741CF58965000BCC74 /* ConfigurationHelper.swift */,
);
path = ConfigurationHelper;
sourceTree = "<group>";
};
848596761CF58973000BCC74 /* Constraints Helpers */ = {
isa = PBXGroup;
children = (
848596771CF58973000BCC74 /* ConstraintsHelper.swift */,
);
path = "Constraints Helpers";
sourceTree = "<group>";
};
848596791CF5897B000BCC74 /* ScreenShot */ = {
isa = PBXGroup;
children = (
8485967A1CF5897B000BCC74 /* ScreenShotHelper.swift */,
);
path = ScreenShot;
sourceTree = "<group>";
};
8485967C1CF589A4000BCC74 /* Helpers */ = {
isa = PBXGroup;
children = (
848596891CF58A7D000BCC74 /* CollectionViewHelper */,
8485967D1CF589C4000BCC74 /* StoryboardHelper */,
);
path = Helpers;
sourceTree = "<group>";
};
8485967D1CF589C4000BCC74 /* StoryboardHelper */ = {
isa = PBXGroup;
children = (
8485967E1CF589C4000BCC74 /* StoryboardHelper.swift */,
);
path = StoryboardHelper;
sourceTree = "<group>";
};
848596801CF589F9000BCC74 /* ExpandingViewController */ = {
isa = PBXGroup;
children = (
848596831CF58A3F000BCC74 /* CollectionView */,
848596811CF58A36000BCC74 /* ExpandingViewController.swift */,
);
path = ExpandingViewController;
sourceTree = "<group>";
};
848596831CF58A3F000BCC74 /* CollectionView */ = {
isa = PBXGroup;
children = (
848596901CF58DE0000BCC74 /* Cells */,
848596861CF58A62000BCC74 /* Layout */,
848596841CF58A3F000BCC74 /* PageCollectionView.swift */,
);
path = CollectionView;
sourceTree = "<group>";
};
848596861CF58A62000BCC74 /* Layout */ = {
isa = PBXGroup;
children = (
848596871CF58A62000BCC74 /* PageCollectionLayout.swift */,
);
path = Layout;
sourceTree = "<group>";
};
848596891CF58A7D000BCC74 /* CollectionViewHelper */ = {
isa = PBXGroup;
children = (
8485968A1CF58A7D000BCC74 /* CollectionViewHelper.swift */,
);
path = CollectionViewHelper;
sourceTree = "<group>";
};
848596901CF58DE0000BCC74 /* Cells */ = {
isa = PBXGroup;
children = (
848596911CF58DE0000BCC74 /* BasePageCollectionCell.swift */,
);
path = Cells;
sourceTree = "<group>";
};
84AC75E31CF6F55C00421857 /* SubviewsForEach */ = {
isa = PBXGroup;
children = (
84AC75E41CF6F5CB00421857 /* SubviewsForEach.swift */,
);
path = SubviewsForEach;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
848596271CF585F3000BCC74 /* DemoExpandingCollection */ = {
isa = PBXNativeTarget;
buildConfigurationList = 848596451CF585F3000BCC74 /* Build configuration list for PBXNativeTarget "DemoExpandingCollection" */;
buildPhases = (
8485968F1CF58B8A000BCC74 /* Images Generator */,
848596241CF585F3000BCC74 /* Sources */,
848596251CF585F3000BCC74 /* Frameworks */,
848596261CF585F3000BCC74 /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = DemoExpandingCollection;
productName = DemoExpandingCollection;
productReference = 848596281CF585F3000BCC74 /* DemoExpandingCollection.app */;
productType = "com.apple.product-type.application";
};
8485963B1CF585F3000BCC74 /* DemoExpandingCollectionTests */ = {
isa = PBXNativeTarget;
buildConfigurationList = 848596481CF585F3000BCC74 /* Build configuration list for PBXNativeTarget "DemoExpandingCollectionTests" */;
buildPhases = (
848596381CF585F3000BCC74 /* Sources */,
848596391CF585F3000BCC74 /* Frameworks */,
8485963A1CF585F3000BCC74 /* Resources */,
);
buildRules = (
);
dependencies = (
8485963E1CF585F3000BCC74 /* PBXTargetDependency */,
);
name = DemoExpandingCollectionTests;
productName = DemoExpandingCollectionTests;
productReference = 8485963C1CF585F3000BCC74 /* DemoExpandingCollectionTests.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
848596201CF585F3000BCC74 /* Project object */ = {
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0730;
LastUpgradeCheck = 0730;
ORGANIZATIONNAME = "Alex K.";
TargetAttributes = {
848596271CF585F3000BCC74 = {
CreatedOnToolsVersion = 7.3.1;
};
8485963B1CF585F3000BCC74 = {
CreatedOnToolsVersion = 7.3.1;
TestTargetID = 848596271CF585F3000BCC74;
};
};
};
buildConfigurationList = 848596231CF585F3000BCC74 /* Build configuration list for PBXProject "DemoExpandingCollection" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = 8485961F1CF585F3000BCC74;
productRefGroup = 848596291CF585F3000BCC74 /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
848596271CF585F3000BCC74 /* DemoExpandingCollection */,
8485963B1CF585F3000BCC74 /* DemoExpandingCollectionTests */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
848596261CF585F3000BCC74 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
848596361CF585F3000BCC74 /* LaunchScreen.storyboard in Resources */,
848596331CF585F3000BCC74 /* Assets.xcassets in Resources */,
848596311CF585F3000BCC74 /* Main.storyboard in Resources */,
8485965C1CF586F7000BCC74 /* DemoCollectionViewCell.xib in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
8485963A1CF585F3000BCC74 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */
8485968F1CF58B8A000BCC74 /* Images Generator */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "Images Generator";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "if which swiftgen >/dev/null; then\nswiftgen images \"$PROJECT_DIR/DemoExpandingCollection/Assets.xcassets\" --output \"$PROJECT_DIR/DemoExpandingCollection/Constants/Images.swift\"\nelse\necho \"warning: SwiftGen not installed, download it from https://github.com/AliSoftware/SwiftGen\"\nfi";
};
/* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
848596241CF585F3000BCC74 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
848596751CF58965000BCC74 /* ConfigurationHelper.swift in Sources */,
848596781CF58973000BCC74 /* ConstraintsHelper.swift in Sources */,
848596611CF58763000BCC74 /* TransitionDriver.swift in Sources */,
8485967F1CF589C4000BCC74 /* StoryboardHelper.swift in Sources */,
8485965A1CF586F7000BCC74 /* DemoTableViewController.swift in Sources */,
8485965B1CF586F7000BCC74 /* DemoCollectionViewCell.swift in Sources */,
8485966A1CF58853000BCC74 /* ExpandingTableViewController.swift in Sources */,
8485967B1CF5897B000BCC74 /* ScreenShotHelper.swift in Sources */,
848596721CF58954000BCC74 /* CornerAnimatable.swift in Sources */,
8422CA741CF73EE4007E8522 /* Rotatable.swift in Sources */,
8485965D1CF586F7000BCC74 /* DemoViewController.swift in Sources */,
8485966D1CF588E0000BCC74 /* Images.swift in Sources */,
8422CA731CF73EE4007E8522 /* AnimationBarButton.swift in Sources */,
8485968B1CF58A7D000BCC74 /* CollectionViewHelper.swift in Sources */,
8485962C1CF585F3000BCC74 /* AppDelegate.swift in Sources */,
848596821CF58A36000BCC74 /* ExpandingViewController.swift in Sources */,
848596881CF58A62000BCC74 /* PageCollectionLayout.swift in Sources */,
84AC75E51CF6F5CB00421857 /* SubviewsForEach.swift in Sources */,
848596851CF58A3F000BCC74 /* PageCollectionView.swift in Sources */,
848596921CF58DE0000BCC74 /* BasePageCollectionCell.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
848596381CF585F3000BCC74 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
848596411CF585F3000BCC74 /* DemoExpandingCollectionTests.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXTargetDependency section */
8485963E1CF585F3000BCC74 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 848596271CF585F3000BCC74 /* DemoExpandingCollection */;
targetProxy = 8485963D1CF585F3000BCC74 /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */
/* Begin PBXVariantGroup section */
8485962F1CF585F3000BCC74 /* Main.storyboard */ = {
isa = PBXVariantGroup;
children = (
848596301CF585F3000BCC74 /* Base */,
);
name = Main.storyboard;
sourceTree = "<group>";
};
848596341CF585F3000BCC74 /* LaunchScreen.storyboard */ = {
isa = PBXVariantGroup;
children = (
848596351CF585F3000BCC74 /* Base */,
);
name = LaunchScreen.storyboard;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
848596431CF585F3000BCC74 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.3;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
};
name = Debug;
};
848596441CF585F3000BCC74 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.3;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
VALIDATE_PRODUCT = YES;
};
name = Release;
};
848596461CF585F3000BCC74 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
INFOPLIST_FILE = DemoExpandingCollection/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.ramotion.DemoExpandingCollection;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "";
};
name = Debug;
};
848596471CF585F3000BCC74 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
INFOPLIST_FILE = DemoExpandingCollection/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.ramotion.DemoExpandingCollection;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "";
};
name = Release;
};
848596491CF585F3000BCC74 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
INFOPLIST_FILE = DemoExpandingCollectionTests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.ramotion.DemoExpandingCollectionTests;
PRODUCT_NAME = "$(TARGET_NAME)";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/DemoExpandingCollection.app/DemoExpandingCollection";
};
name = Debug;
};
8485964A1CF585F3000BCC74 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
INFOPLIST_FILE = DemoExpandingCollectionTests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.ramotion.DemoExpandingCollectionTests;
PRODUCT_NAME = "$(TARGET_NAME)";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/DemoExpandingCollection.app/DemoExpandingCollection";
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
848596231CF585F3000BCC74 /* Build configuration list for PBXProject "DemoExpandingCollection" */ = {
isa = XCConfigurationList;
buildConfigurations = (
848596431CF585F3000BCC74 /* Debug */,
848596441CF585F3000BCC74 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
848596451CF585F3000BCC74 /* Build configuration list for PBXNativeTarget "DemoExpandingCollection" */ = {
isa = XCConfigurationList;
buildConfigurations = (
848596461CF585F3000BCC74 /* Debug */,
848596471CF585F3000BCC74 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
848596481CF585F3000BCC74 /* Build configuration list for PBXNativeTarget "DemoExpandingCollectionTests" */ = {
isa = XCConfigurationList;
buildConfigurations = (
848596491CF585F3000BCC74 /* Debug */,
8485964A1CF585F3000BCC74 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 848596201CF585F3000BCC74 /* Project object */;
}
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "self:DemoExpandingCollection.xcodeproj">
</FileRef>
</Workspace>
@@ -0,0 +1,58 @@
//
// AppDelegate.swift
// DemoExpandingCollection
//
// Created by Alex K. on 25/05/16.
// Copyright © 2016 Alex K. All rights reserved.
//
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
configureNavigationTabBar()
return true
}
func applicationWillResignActive(application: UIApplication) {
}
func applicationDidEnterBackground(application: UIApplication) {
}
func applicationWillEnterForeground(application: UIApplication) {
}
func applicationDidBecomeActive(application: UIApplication) {
}
func applicationWillTerminate(application: UIApplication) {
}
}
extension AppDelegate {
private func configureNavigationTabBar() {
//transparent background
UINavigationBar.appearance().setBackgroundImage(UIImage(), forBarMetrics: .Default)
UINavigationBar.appearance().shadowImage = UIImage()
UINavigationBar.appearance().translucent = true
let shadow = NSShadow()
shadow.shadowOffset = CGSize(width: 0, height: 2)
shadow.shadowColor = UIColor(red: 0, green: 0, blue: 0, alpha: 0.1)
// shadow.shadowOffset = k
UINavigationBar.appearance().titleTextAttributes = [
NSForegroundColorAttributeName : UIColor.whiteColor(),
NSShadowAttributeName: shadow
]
}
}
@@ -0,0 +1,38 @@
{
"images" : [
{
"idiom" : "iphone",
"size" : "29x29",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "29x29",
"scale" : "3x"
},
{
"idiom" : "iphone",
"size" : "40x40",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "40x40",
"scale" : "3x"
},
{
"idiom" : "iphone",
"size" : "60x60",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "60x60",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "pngIcon.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 600 KiB

@@ -0,0 +1,24 @@
{
"images" : [
{
"idiom" : "universal"
},
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "close.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

@@ -0,0 +1,6 @@
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}
@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "text-1.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "dots.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 476 B

@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "face1.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "face2.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 KiB

@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "heand.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 605 B

@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "icons.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "image.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 757 KiB

@@ -0,0 +1,6 @@
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}
@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "boston.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 MiB

@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "item2.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 MiB

@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "san_francisco.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 MiB

@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "item4.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "Circle.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "map.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 55 KiB

@@ -0,0 +1,12 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "pinIcon.pdf"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "search(f).png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "stars.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="8150" systemVersion="15A204g" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" initialViewController="01J-lp-oVM">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="8122"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="EHf-IW-A2E">
<objects>
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="Llm-lL-Icb"/>
<viewControllerLayoutGuide type="bottom" id="xb3-aO-Qok"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<animations/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="53" y="375"/>
</scene>
</scenes>
</document>
@@ -0,0 +1,475 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10117" systemVersion="15F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="L1n-Ia-Jrw">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
<capability name="Constraints to layout margins" minToolsVersion="6.0"/>
</dependencies>
<scenes>
<!--Demo View Controller-->
<scene sceneID="7vj-xm-Mde">
<objects>
<viewController automaticallyAdjustsScrollViewInsets="NO" id="owA-8G-88G" customClass="DemoViewController" customModule="DemoExpandingCollection" customModuleProvider="target" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="CpK-wn-s3i"/>
<viewControllerLayoutGuide type="bottom" id="mRg-Mx-OVI"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="CO1-du-RsN">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="BackgroundImage" translatesAutoresizingMaskIntoConstraints="NO" id="o88-Ae-QCA">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="1/15" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Irl-Rb-fcB">
<rect key="frame" x="285" y="559" width="31" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" red="0.85882352941176465" green="0.8666666666666667" blue="0.87058823529411766" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="mRg-Mx-OVI" firstAttribute="top" secondItem="Irl-Rb-fcB" secondAttribute="bottom" constant="20" id="2LM-iO-324"/>
<constraint firstItem="o88-Ae-QCA" firstAttribute="top" secondItem="CpK-wn-s3i" secondAttribute="bottom" constant="-44" id="MHx-PV-wBs"/>
<constraint firstAttribute="trailing" secondItem="o88-Ae-QCA" secondAttribute="trailing" id="Xcv-FC-DFw"/>
<constraint firstItem="mRg-Mx-OVI" firstAttribute="top" secondItem="o88-Ae-QCA" secondAttribute="bottom" id="aWe-c0-hwO"/>
<constraint firstItem="o88-Ae-QCA" firstAttribute="leading" secondItem="CO1-du-RsN" secondAttribute="leading" id="sd9-mZ-FXM"/>
<constraint firstItem="Irl-Rb-fcB" firstAttribute="centerX" secondItem="CO1-du-RsN" secondAttribute="centerX" id="yzg-tR-vdV"/>
</constraints>
</view>
<navigationItem key="navigationItem" id="Mck-gv-XOR">
<nil key="title"/>
<barButtonItem key="leftBarButtonItem" image="searchIcon" id="xuF-jX-6LN"/>
<view key="titleView" contentMode="scaleToFill" id="U0J-H7-fvX">
<rect key="frame" x="180" y="6" width="240" height="33"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="Title" translatesAutoresizingMaskIntoConstraints="NO" id="92b-RV-q6w">
<rect key="frame" x="95" y="9" width="51" height="16"/>
<constraints>
<constraint firstAttribute="width" constant="51" id="E8y-UB-H4U"/>
<constraint firstAttribute="height" constant="16" id="FBz-Jg-2za"/>
</constraints>
</imageView>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="92b-RV-q6w" firstAttribute="centerX" secondItem="U0J-H7-fvX" secondAttribute="centerX" id="kLZ-Jr-wTP"/>
<constraint firstItem="92b-RV-q6w" firstAttribute="centerY" secondItem="U0J-H7-fvX" secondAttribute="centerY" id="qaL-Bm-FyO"/>
</constraints>
</view>
<barButtonItem key="rightBarButtonItem" title="Item" id="mbm-hT-lYD" customClass="AnimatingBarButton" customModule="DemoExpandingCollection" customModuleProvider="target">
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="string" keyPath="normalImageName" value="locationButton"/>
<userDefinedRuntimeAttribute type="string" keyPath="selectedImageName" value="CloseButton"/>
<userDefinedRuntimeAttribute type="number" keyPath="duration">
<real key="value" value="0.29999999999999999"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</barButtonItem>
</navigationItem>
<connections>
<outlet property="pageLabel" destination="Irl-Rb-fcB" id="oUZ-x9-PkD"/>
<segue destination="7RW-i0-HfN" kind="show" identifier="NoName" id="enc-PY-spo"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="cU0-3v-d17" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="1258" y="428"/>
</scene>
<!--Navigation Controller-->
<scene sceneID="ECt-UZ-ruI">
<objects>
<navigationController automaticallyAdjustsScrollViewInsets="NO" id="L1n-Ia-Jrw" sceneMemberID="viewController">
<toolbarItems/>
<nil key="simulatedStatusBarMetrics"/>
<navigationBar key="navigationBar" contentMode="scaleToFill" id="5hs-Ir-kRn">
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
<autoresizingMask key="autoresizingMask"/>
</navigationBar>
<nil name="viewControllers"/>
<connections>
<segue destination="owA-8G-88G" kind="relationship" relationship="rootViewController" id="1aC-mc-OKf"/>
</connections>
</navigationController>
<placeholder placeholderIdentifier="IBFirstResponder" id="8Yh-rW-xNc" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="530" y="428"/>
</scene>
<!--Demo Table View Controller-->
<scene sceneID="7Xk-ar-e7L">
<objects>
<tableViewController storyboardIdentifier="DemoTableViewController" automaticallyAdjustsScrollViewInsets="NO" id="7RW-i0-HfN" customClass="DemoTableViewController" customModule="DemoExpandingCollection" customModuleProvider="target" sceneMemberID="viewController">
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" showsHorizontalScrollIndicator="NO" showsVerticalScrollIndicator="NO" dataMode="static" style="plain" separatorStyle="none" rowHeight="44" sectionHeaderHeight="28" sectionFooterHeight="28" id="2SU-lJ-2AP">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<sections>
<tableViewSection id="IIl-eL-sK9">
<cells>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="CustomTableViewCell" rowHeight="124" id="SFA-X2-Rbf">
<rect key="frame" x="0.0" y="0.0" width="600" height="124"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="SFA-X2-Rbf" id="RQr-Ti-ps0">
<rect key="frame" x="0.0" y="0.0" width="600" height="124"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="map" translatesAutoresizingMaskIntoConstraints="NO" id="MOR-g7-Roh">
<rect key="frame" x="0.0" y="0.0" width="600" height="124"/>
</imageView>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="stars" translatesAutoresizingMaskIntoConstraints="NO" id="u4E-kh-oBd">
<rect key="frame" x="40" y="92" width="77" height="12"/>
<constraints>
<constraint firstAttribute="width" constant="77" id="fcy-Ae-Cqj"/>
<constraint firstAttribute="height" constant="12" id="r69-to-MYP"/>
</constraints>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="La Crescenta-Montrose, CA91020 Glendale
NO. 7911847" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Xh7-la-W1r">
<rect key="frame" x="40" y="48" width="552" height="27"/>
<fontDescription key="fontDescription" type="system" pointSize="11"/>
<color key="textColor" red="0.49803921568627452" green="0.51764705882352935" blue="0.53725490196078429" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<constraints>
<constraint firstAttribute="bottom" secondItem="MOR-g7-Roh" secondAttribute="bottom" id="64C-HI-xQM"/>
<constraint firstItem="MOR-g7-Roh" firstAttribute="top" secondItem="RQr-Ti-ps0" secondAttribute="top" id="Cjy-jq-WtT"/>
<constraint firstItem="MOR-g7-Roh" firstAttribute="leading" secondItem="RQr-Ti-ps0" secondAttribute="leading" id="Fgn-Df-miD"/>
<constraint firstItem="Xh7-la-W1r" firstAttribute="centerY" secondItem="RQr-Ti-ps0" secondAttribute="centerY" id="Nb4-fR-NyZ"/>
<constraint firstAttribute="bottom" secondItem="u4E-kh-oBd" secondAttribute="bottom" constant="20" id="Plo-xq-pNV"/>
<constraint firstAttribute="trailing" secondItem="MOR-g7-Roh" secondAttribute="trailing" id="ZD6-fx-i9t"/>
<constraint firstItem="u4E-kh-oBd" firstAttribute="leading" secondItem="RQr-Ti-ps0" secondAttribute="leading" constant="40" id="vYf-4O-cBv"/>
<constraint firstItem="Xh7-la-W1r" firstAttribute="leading" secondItem="RQr-Ti-ps0" secondAttribute="leading" constant="40" id="wrw-sB-fcz"/>
<constraint firstAttribute="trailingMargin" secondItem="Xh7-la-W1r" secondAttribute="trailing" id="xQd-KQ-kXu"/>
</constraints>
</tableViewCellContentView>
</tableViewCell>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" rowHeight="124" id="ew1-hI-ark">
<rect key="frame" x="0.0" y="124" width="600" height="124"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="ew1-hI-ark" id="tMC-aw-BE2">
<rect key="frame" x="0.0" y="0.0" width="600" height="124"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="face2" translatesAutoresizingMaskIntoConstraints="NO" id="9zL-0u-FrF">
<rect key="frame" x="40" y="20" width="40" height="40"/>
<constraints>
<constraint firstAttribute="width" constant="40" id="78B-o8-UlD"/>
<constraint firstAttribute="height" constant="40" id="b9d-Vi-STe"/>
</constraints>
</imageView>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="heand" translatesAutoresizingMaskIntoConstraints="NO" id="Nk4-8x-Lwg">
<rect key="frame" x="524" y="34" width="14" height="13"/>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Peter Allan" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="KVC-Pp-S9H">
<rect key="frame" x="108" y="31" width="74" height="18"/>
<fontDescription key="fontDescription" type="system" pointSize="15"/>
<color key="textColor" red="0.41960784313725491" green="0.41960784313725491" blue="0.41960784313725491" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="FEB 14th" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="UAK-of-lpJ">
<rect key="frame" x="219" y="34" width="43" height="12"/>
<fontDescription key="fontDescription" type="system" pointSize="10"/>
<color key="textColor" red="0.76470588235294112" green="0.76470588235294112" blue="0.76470588235294112" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="3" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="2zo-A7-sbM">
<rect key="frame" x="40" y="57" width="498" height="59"/>
<constraints>
<constraint firstAttribute="height" constant="59" id="zel-Yy-v9k"/>
</constraints>
<string key="text">The federal beach atc requires states that receive funding to develop a risk-based beach evaluation and classification plan and apply it to</string>
<fontDescription key="fontDescription" type="system" pointSize="12"/>
<color key="textColor" red="0.44313725490196076" green="0.44313725490196076" blue="0.44313725490196076" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<constraints>
<constraint firstItem="2zo-A7-sbM" firstAttribute="leading" secondItem="tMC-aw-BE2" secondAttribute="leading" constant="40" id="H38-Fq-dyr"/>
<constraint firstItem="UAK-of-lpJ" firstAttribute="centerY" secondItem="KVC-Pp-S9H" secondAttribute="centerY" id="LsD-yB-O6d"/>
<constraint firstItem="UAK-of-lpJ" firstAttribute="leading" secondItem="KVC-Pp-S9H" secondAttribute="trailing" constant="37" id="Q2S-o9-jqX"/>
<constraint firstAttribute="trailing" secondItem="Nk4-8x-Lwg" secondAttribute="trailing" constant="62" id="V8O-HD-kFA"/>
<constraint firstItem="Nk4-8x-Lwg" firstAttribute="centerY" secondItem="9zL-0u-FrF" secondAttribute="centerY" id="W5E-fE-j0w"/>
<constraint firstAttribute="trailing" secondItem="2zo-A7-sbM" secondAttribute="trailing" constant="62" id="Z9T-o6-3gf"/>
<constraint firstItem="KVC-Pp-S9H" firstAttribute="centerY" secondItem="9zL-0u-FrF" secondAttribute="centerY" id="brv-4K-N8t"/>
<constraint firstItem="KVC-Pp-S9H" firstAttribute="leading" secondItem="9zL-0u-FrF" secondAttribute="trailing" constant="28" id="i1I-Wl-eDa"/>
<constraint firstAttribute="bottomMargin" secondItem="2zo-A7-sbM" secondAttribute="bottom" id="i8F-BH-FCe"/>
<constraint firstItem="9zL-0u-FrF" firstAttribute="leading" secondItem="tMC-aw-BE2" secondAttribute="leading" constant="40" id="vVg-gG-k8j"/>
<constraint firstItem="9zL-0u-FrF" firstAttribute="top" secondItem="tMC-aw-BE2" secondAttribute="top" constant="20" id="w5h-fl-OmZ"/>
</constraints>
</tableViewCellContentView>
</tableViewCell>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" rowHeight="124" id="0ee-7A-I2I">
<rect key="frame" x="0.0" y="248" width="600" height="124"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="0ee-7A-I2I" id="jPx-eH-c2S">
<rect key="frame" x="0.0" y="0.0" width="600" height="124"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="face1" translatesAutoresizingMaskIntoConstraints="NO" id="T8j-gX-HQZ">
<rect key="frame" x="40" y="20" width="40" height="40"/>
<constraints>
<constraint firstAttribute="height" constant="40" id="AKq-2T-BRC"/>
<constraint firstAttribute="width" constant="40" id="lAw-yT-R7T"/>
</constraints>
</imageView>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="heand" translatesAutoresizingMaskIntoConstraints="NO" id="szO-5V-CyH">
<rect key="frame" x="524" y="34" width="14" height="13"/>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Amada Iin" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="UEu-Ap-Kms">
<rect key="frame" x="108" y="31" width="68" height="18"/>
<fontDescription key="fontDescription" type="system" pointSize="15"/>
<color key="textColor" red="0.41960784309999999" green="0.41960784309999999" blue="0.41960784309999999" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="FEB 14th" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="7hI-Qw-bUn">
<rect key="frame" x="213" y="34" width="43" height="12"/>
<fontDescription key="fontDescription" type="system" pointSize="10"/>
<color key="textColor" red="0.76470588240000004" green="0.76470588240000004" blue="0.76470588240000004" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="3" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="rkV-jC-tTs">
<rect key="frame" x="40" y="57" width="498" height="59"/>
<constraints>
<constraint firstAttribute="height" constant="59" id="pYw-qC-eUH"/>
</constraints>
<string key="text">The federal beach atc requires states that receive funding to develop a risk-based beach evaluation and classification plan and apply it to</string>
<fontDescription key="fontDescription" type="system" pointSize="12"/>
<color key="textColor" red="0.4431372549" green="0.4431372549" blue="0.4431372549" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<constraints>
<constraint firstItem="UEu-Ap-Kms" firstAttribute="centerY" secondItem="T8j-gX-HQZ" secondAttribute="centerY" id="0ar-MM-JhP"/>
<constraint firstAttribute="trailing" secondItem="szO-5V-CyH" secondAttribute="trailing" constant="62" id="I1Z-x4-mXH"/>
<constraint firstItem="7hI-Qw-bUn" firstAttribute="leading" secondItem="UEu-Ap-Kms" secondAttribute="trailing" constant="37" id="JWw-Z3-bSW"/>
<constraint firstItem="7hI-Qw-bUn" firstAttribute="centerY" secondItem="UEu-Ap-Kms" secondAttribute="centerY" id="KR6-QV-sS2"/>
<constraint firstItem="szO-5V-CyH" firstAttribute="centerY" secondItem="T8j-gX-HQZ" secondAttribute="centerY" id="UVU-13-4LE"/>
<constraint firstItem="rkV-jC-tTs" firstAttribute="leading" secondItem="jPx-eH-c2S" secondAttribute="leading" constant="40" id="cf4-Ue-Xs2"/>
<constraint firstItem="UEu-Ap-Kms" firstAttribute="leading" secondItem="T8j-gX-HQZ" secondAttribute="trailing" constant="28" id="fhv-QP-9Wc"/>
<constraint firstAttribute="trailing" secondItem="rkV-jC-tTs" secondAttribute="trailing" constant="62" id="kZt-vH-S8D"/>
<constraint firstItem="T8j-gX-HQZ" firstAttribute="leading" secondItem="jPx-eH-c2S" secondAttribute="leading" constant="40" id="v3e-He-0Sh"/>
<constraint firstItem="T8j-gX-HQZ" firstAttribute="top" secondItem="jPx-eH-c2S" secondAttribute="top" constant="20" id="v85-ak-nGz"/>
<constraint firstAttribute="bottomMargin" secondItem="rkV-jC-tTs" secondAttribute="bottom" id="wJM-Lw-H9T"/>
</constraints>
</tableViewCellContentView>
</tableViewCell>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" rowHeight="124" id="fTH-KP-Ac5">
<rect key="frame" x="0.0" y="372" width="600" height="124"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="fTH-KP-Ac5" id="BGd-Mp-TnE">
<rect key="frame" x="0.0" y="0.0" width="600" height="124"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="face2" translatesAutoresizingMaskIntoConstraints="NO" id="l6O-iU-Deh">
<rect key="frame" x="40" y="20" width="40" height="40"/>
<constraints>
<constraint firstAttribute="height" constant="40" id="Wvu-NC-dmu"/>
<constraint firstAttribute="width" constant="40" id="goR-UO-N7g"/>
</constraints>
</imageView>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="heand" translatesAutoresizingMaskIntoConstraints="NO" id="ceS-Mg-PrP">
<rect key="frame" x="524" y="34" width="14" height="13"/>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Peter Allan" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="a3U-of-sdv">
<rect key="frame" x="108" y="31" width="74" height="18"/>
<fontDescription key="fontDescription" type="system" pointSize="15"/>
<color key="textColor" red="0.41960784309999999" green="0.41960784309999999" blue="0.41960784309999999" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="FEB 14th" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="h3x-N2-MWJ">
<rect key="frame" x="219" y="34" width="43" height="12"/>
<fontDescription key="fontDescription" type="system" pointSize="10"/>
<color key="textColor" red="0.76470588240000004" green="0.76470588240000004" blue="0.76470588240000004" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="3" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="3ZN-4l-hGa">
<rect key="frame" x="40" y="57" width="498" height="59"/>
<constraints>
<constraint firstAttribute="height" constant="59" id="z9M-6w-uYi"/>
</constraints>
<string key="text">The federal beach atc requires states that receive funding to develop a risk-based beach evaluation and classification plan and apply it to</string>
<fontDescription key="fontDescription" type="system" pointSize="12"/>
<color key="textColor" red="0.4431372549" green="0.4431372549" blue="0.4431372549" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<constraints>
<constraint firstItem="h3x-N2-MWJ" firstAttribute="centerY" secondItem="a3U-of-sdv" secondAttribute="centerY" id="879-Lf-sHE"/>
<constraint firstItem="l6O-iU-Deh" firstAttribute="top" secondItem="BGd-Mp-TnE" secondAttribute="top" constant="20" id="C4W-pg-781"/>
<constraint firstAttribute="bottomMargin" secondItem="3ZN-4l-hGa" secondAttribute="bottom" id="KIV-vm-vEj"/>
<constraint firstItem="a3U-of-sdv" firstAttribute="centerY" secondItem="l6O-iU-Deh" secondAttribute="centerY" id="N7q-ub-LKa"/>
<constraint firstAttribute="trailing" secondItem="ceS-Mg-PrP" secondAttribute="trailing" constant="62" id="Sfq-JU-4Nm"/>
<constraint firstItem="l6O-iU-Deh" firstAttribute="leading" secondItem="BGd-Mp-TnE" secondAttribute="leading" constant="40" id="VMR-N1-Xjl"/>
<constraint firstItem="ceS-Mg-PrP" firstAttribute="centerY" secondItem="l6O-iU-Deh" secondAttribute="centerY" id="fdg-23-M6H"/>
<constraint firstAttribute="trailing" secondItem="3ZN-4l-hGa" secondAttribute="trailing" constant="62" id="hmQ-iS-d5t"/>
<constraint firstItem="a3U-of-sdv" firstAttribute="leading" secondItem="l6O-iU-Deh" secondAttribute="trailing" constant="28" id="o1q-GY-Lns"/>
<constraint firstItem="3ZN-4l-hGa" firstAttribute="leading" secondItem="BGd-Mp-TnE" secondAttribute="leading" constant="40" id="oCn-vE-6YT"/>
<constraint firstItem="h3x-N2-MWJ" firstAttribute="leading" secondItem="a3U-of-sdv" secondAttribute="trailing" constant="37" id="wku-gF-N0I"/>
</constraints>
</tableViewCellContentView>
</tableViewCell>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" rowHeight="124" id="irZ-0L-X9r">
<rect key="frame" x="0.0" y="496" width="600" height="124"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="irZ-0L-X9r" id="t3x-Eb-ktg">
<rect key="frame" x="0.0" y="0.0" width="600" height="124"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="face1" translatesAutoresizingMaskIntoConstraints="NO" id="SY0-ki-F5U">
<rect key="frame" x="40" y="20" width="40" height="40"/>
<constraints>
<constraint firstAttribute="width" constant="40" id="1XW-AC-9LK"/>
<constraint firstAttribute="height" constant="40" id="jDR-B8-a7U"/>
</constraints>
</imageView>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="heand" translatesAutoresizingMaskIntoConstraints="NO" id="g7r-dJ-em9">
<rect key="frame" x="524" y="34" width="14" height="13"/>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Amada Iin" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="0sx-fO-Xiy">
<rect key="frame" x="108" y="31" width="68" height="18"/>
<fontDescription key="fontDescription" type="system" pointSize="15"/>
<color key="textColor" red="0.41960784309999999" green="0.41960784309999999" blue="0.41960784309999999" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="FEB 14th" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="SVA-lD-IQs">
<rect key="frame" x="213" y="34" width="43" height="12"/>
<fontDescription key="fontDescription" type="system" pointSize="10"/>
<color key="textColor" red="0.76470588240000004" green="0.76470588240000004" blue="0.76470588240000004" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="3" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="kYn-LQ-ReD">
<rect key="frame" x="40" y="57" width="498" height="59"/>
<constraints>
<constraint firstAttribute="height" constant="59" id="sMt-dP-LYh"/>
</constraints>
<string key="text">The federal beach atc requires states that receive funding to develop a risk-based beach evaluation and classification plan and apply it to</string>
<fontDescription key="fontDescription" type="system" pointSize="12"/>
<color key="textColor" red="0.4431372549" green="0.4431372549" blue="0.4431372549" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<constraints>
<constraint firstItem="SVA-lD-IQs" firstAttribute="centerY" secondItem="0sx-fO-Xiy" secondAttribute="centerY" id="2jW-fL-D7T"/>
<constraint firstAttribute="trailing" secondItem="g7r-dJ-em9" secondAttribute="trailing" constant="62" id="ChQ-bB-Cik"/>
<constraint firstItem="0sx-fO-Xiy" firstAttribute="centerY" secondItem="SY0-ki-F5U" secondAttribute="centerY" id="Faj-Bw-0Tu"/>
<constraint firstItem="kYn-LQ-ReD" firstAttribute="leading" secondItem="t3x-Eb-ktg" secondAttribute="leading" constant="40" id="HLb-38-S1u"/>
<constraint firstAttribute="trailing" secondItem="kYn-LQ-ReD" secondAttribute="trailing" constant="62" id="HzA-Nb-vXy"/>
<constraint firstItem="g7r-dJ-em9" firstAttribute="centerY" secondItem="SY0-ki-F5U" secondAttribute="centerY" id="KEY-Pc-yZs"/>
<constraint firstItem="SY0-ki-F5U" firstAttribute="leading" secondItem="t3x-Eb-ktg" secondAttribute="leading" constant="40" id="NZg-9p-Sb1"/>
<constraint firstItem="0sx-fO-Xiy" firstAttribute="leading" secondItem="SY0-ki-F5U" secondAttribute="trailing" constant="28" id="Xe5-9G-9vl"/>
<constraint firstItem="SY0-ki-F5U" firstAttribute="top" secondItem="t3x-Eb-ktg" secondAttribute="top" constant="20" id="YyV-BS-5UD"/>
<constraint firstAttribute="bottomMargin" secondItem="kYn-LQ-ReD" secondAttribute="bottom" id="oHX-7c-bG2"/>
<constraint firstItem="SVA-lD-IQs" firstAttribute="leading" secondItem="0sx-fO-Xiy" secondAttribute="trailing" constant="37" id="xkH-1T-7dm"/>
</constraints>
</tableViewCellContentView>
</tableViewCell>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" rowHeight="124" id="Fj4-n4-S6M">
<rect key="frame" x="0.0" y="620" width="600" height="124"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="Fj4-n4-S6M" id="D8J-AG-YUN">
<rect key="frame" x="0.0" y="0.0" width="600" height="124"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="face2" translatesAutoresizingMaskIntoConstraints="NO" id="dRk-IE-zXs">
<rect key="frame" x="40" y="20" width="40" height="40"/>
<constraints>
<constraint firstAttribute="height" constant="40" id="KNl-fy-6Ga"/>
<constraint firstAttribute="width" constant="40" id="hN8-5E-akX"/>
</constraints>
</imageView>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="heand" translatesAutoresizingMaskIntoConstraints="NO" id="hz8-Cp-lQj">
<rect key="frame" x="524" y="34" width="14" height="13"/>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Peter Allan" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="YjL-xf-PcV">
<rect key="frame" x="108" y="31" width="74" height="18"/>
<fontDescription key="fontDescription" type="system" pointSize="15"/>
<color key="textColor" red="0.41960784309999999" green="0.41960784309999999" blue="0.41960784309999999" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="FEB 14th" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="J4t-pX-zbM">
<rect key="frame" x="219" y="34" width="43" height="12"/>
<fontDescription key="fontDescription" type="system" pointSize="10"/>
<color key="textColor" red="0.76470588240000004" green="0.76470588240000004" blue="0.76470588240000004" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="3" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Q6w-vY-gMp">
<rect key="frame" x="40" y="57" width="498" height="59"/>
<constraints>
<constraint firstAttribute="height" constant="59" id="T4M-G7-7hc"/>
</constraints>
<string key="text">The federal beach atc requires states that receive funding to develop a risk-based beach evaluation and classification plan and apply it to</string>
<fontDescription key="fontDescription" type="system" pointSize="12"/>
<color key="textColor" red="0.4431372549" green="0.4431372549" blue="0.4431372549" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<constraints>
<constraint firstItem="Q6w-vY-gMp" firstAttribute="leading" secondItem="D8J-AG-YUN" secondAttribute="leading" constant="40" id="1ka-fN-GDR"/>
<constraint firstItem="dRk-IE-zXs" firstAttribute="leading" secondItem="D8J-AG-YUN" secondAttribute="leading" constant="40" id="7Oe-Rd-NXO"/>
<constraint firstItem="hz8-Cp-lQj" firstAttribute="centerY" secondItem="dRk-IE-zXs" secondAttribute="centerY" id="C2R-V0-FlH"/>
<constraint firstItem="J4t-pX-zbM" firstAttribute="leading" secondItem="YjL-xf-PcV" secondAttribute="trailing" constant="37" id="DG5-6g-aw8"/>
<constraint firstItem="dRk-IE-zXs" firstAttribute="top" secondItem="D8J-AG-YUN" secondAttribute="top" constant="20" id="FvH-zN-qew"/>
<constraint firstItem="J4t-pX-zbM" firstAttribute="centerY" secondItem="YjL-xf-PcV" secondAttribute="centerY" id="JiC-Tf-VdR"/>
<constraint firstAttribute="trailing" secondItem="hz8-Cp-lQj" secondAttribute="trailing" constant="62" id="LWy-zf-18F"/>
<constraint firstItem="YjL-xf-PcV" firstAttribute="leading" secondItem="dRk-IE-zXs" secondAttribute="trailing" constant="28" id="PDn-rh-K7o"/>
<constraint firstAttribute="trailing" secondItem="Q6w-vY-gMp" secondAttribute="trailing" constant="62" id="X6j-C7-AtW"/>
<constraint firstItem="YjL-xf-PcV" firstAttribute="centerY" secondItem="dRk-IE-zXs" secondAttribute="centerY" id="jkE-J3-oHA"/>
<constraint firstAttribute="bottomMargin" secondItem="Q6w-vY-gMp" secondAttribute="bottom" id="nTe-QJ-NrE"/>
</constraints>
</tableViewCellContentView>
</tableViewCell>
</cells>
</tableViewSection>
</sections>
<connections>
<outlet property="dataSource" destination="7RW-i0-HfN" id="gZB-9b-euG"/>
<outlet property="delegate" destination="7RW-i0-HfN" id="28D-Ct-5A9"/>
</connections>
</tableView>
<navigationItem key="navigationItem" id="9zG-W9-jGP">
<nil key="title"/>
<barButtonItem key="leftBarButtonItem" image="searchIcon" id="sSw-AG-wrF"/>
<view key="titleView" contentMode="scaleToFill" id="qyb-Fh-aIr" userLabel="Item View">
<rect key="frame" x="180" y="6" width="240" height="33"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="Title" translatesAutoresizingMaskIntoConstraints="NO" id="a24-t2-9jd">
<rect key="frame" x="95" y="9" width="51" height="16"/>
<constraints>
<constraint firstAttribute="height" constant="16" id="5Zr-Wx-iQB"/>
<constraint firstAttribute="width" constant="51" id="RtX-4m-x9W"/>
</constraints>
</imageView>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="a24-t2-9jd" firstAttribute="centerX" secondItem="qyb-Fh-aIr" secondAttribute="centerX" id="sdW-OO-2BS"/>
<constraint firstItem="a24-t2-9jd" firstAttribute="centerY" secondItem="qyb-Fh-aIr" secondAttribute="centerY" id="xKF-DL-knz"/>
</constraints>
</view>
<barButtonItem key="rightBarButtonItem" image="CloseButton" id="liu-ff-VuS">
<connections>
<action selector="backButtonHandler:" destination="7RW-i0-HfN" id="cOO-dk-yI9"/>
</connections>
</barButtonItem>
</navigationItem>
</tableViewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="koT-TQ-RUs" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="1967" y="428"/>
</scene>
</scenes>
<resources>
<image name="BackgroundImage" width="375" height="667"/>
<image name="CloseButton" width="20" height="20"/>
<image name="Title" width="51" height="16"/>
<image name="face1" width="40" height="39"/>
<image name="face2" width="40" height="39"/>
<image name="heand" width="14" height="13"/>
<image name="map" width="375" height="124"/>
<image name="searchIcon" width="20" height="20"/>
<image name="stars" width="77" height="11"/>
</resources>
</document>
@@ -0,0 +1,35 @@
// Generated using SwiftGen, by O.Halligon — https://github.com/AliSoftware/SwiftGen
import Foundation
import UIKit
extension UIImage {
enum Asset: String {
case BackgroundImage = "BackgroundImage"
case CloseButton = "CloseButton"
case Dots = "dots"
case Face1 = "face1"
case Face2 = "face2"
case Heand = "heand"
case Icons = "icons"
case Image = "image"
case Item0 = "item0"
case Item1 = "item1"
case Item2 = "item2"
case Item3 = "item3"
case LocationButton = "locationButton"
case Map = "map"
case PinIcon = "pinIcon"
case SearchIcon = "searchIcon"
case Stars = "stars"
case Title = "Title"
var image: UIImage {
return UIImage(asset: self)
}
}
convenience init!(asset: Asset) {
self.init(named: asset.rawValue)
}
}
@@ -0,0 +1,33 @@
//
// CollectionViewHelper.swift
// TestCollectionView
//
// Created by Alex K. on 04/05/16.
// Copyright © 2016 Alex K. All rights reserved.
//
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 {
fatalError("Couldn't instantiate view controller with identifier \(T.cellIdentifier) ")
}
return cell
}
}
// MARK: UITableViewCell
protocol CollectionViewCellIdentifiable {
static var cellIdentifier: String { get }
}
extension CollectionViewCellIdentifiable where Self: UICollectionViewCell {
static var cellIdentifier: String {
return String(self)
}
}
extension UICollectionViewCell : CollectionViewCellIdentifiable { }
@@ -0,0 +1,46 @@
//
// StoryboardHelper.swift
// TestCollectionView
//
// Created by Alex K. on 10/05/16.
// Copyright © 2016 Alex K. All rights reserved.
//
import UIKit
extension UIStoryboard {
enum Storyboard : String {
case Main
}
convenience init(storyboard: Storyboard, bundle: NSBundle? = nil) {
self.init(name: storyboard.rawValue, bundle: bundle)
}
class func storyboard(storyboard: Storyboard, bundle: NSBundle? = nil) -> UIStoryboard {
return UIStoryboard(name: storyboard.rawValue, bundle: bundle)
}
func instantiateViewController<T: UIViewController where T: StoryboardIdentifiable>() -> T {
guard let viewController = self.instantiateViewControllerWithIdentifier(T.storyboardIdentifier) as? T else {
fatalError("Couldn't instantiate view controller with identifier \(T.storyboardIdentifier) ")
}
return viewController
}
}
extension UIViewController : StoryboardIdentifiable { }
// MARK: identifiable
protocol StoryboardIdentifiable {
static var storyboardIdentifier: String { get }
}
extension StoryboardIdentifiable where Self: UIViewController {
static var storyboardIdentifier: String {
return String(self)
}
}
@@ -0,0 +1,42 @@
<?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>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UIStatusBarHidden</key>
<true/>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
</dict>
</plist>
@@ -0,0 +1,62 @@
//
// DemoTableViewController.swift
// TestCollectionView
//
// Created by Alex K. on 24/05/16.
// Copyright © 2016 Alex K. All rights reserved.
//
import UIKit
class DemoTableViewController: ExpandingTableViewController {
private var scrollOffsetY: CGFloat = 0
override func viewDidLoad() {
super.viewDidLoad()
configureNavBar()
tableView.backgroundView = UIImageView(image: UIImage.Asset.BackgroundImage.image)
}
}
// MARK: Helpers
extension DemoTableViewController {
private func configureNavBar() {
navigationItem.leftBarButtonItem?.image = navigationItem.leftBarButtonItem?.image!.imageWithRenderingMode(UIImageRenderingMode.AlwaysOriginal)
navigationItem.rightBarButtonItem?.image = navigationItem.rightBarButtonItem?.image!.imageWithRenderingMode(UIImageRenderingMode.AlwaysOriginal)
}
}
// MARK: Actions
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 {
rightButton.animationSelected(false)
}
}
popTransitionAnimation()
}
}
// MARK: UIScrollViewDelegate
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 {
rightButton.animationSelected(false)
}
}
popTransitionAnimation()
}
scrollOffsetY = scrollView.contentOffset.y
}
}
@@ -0,0 +1,24 @@
//
// DemoCollectionViewCell.swift
// TestCollectionView
//
// Created by Alex K. on 12/05/16.
// Copyright © 2016 Alex K. All rights reserved.
//
import UIKit
class DemoCollectionViewCell: BasePageCollectionCell {
@IBOutlet weak var backgroundImageView: UIImageView!
@IBOutlet weak var customTitle: UILabel!
override func awakeFromNib() {
super.awakeFromNib()
customTitle.layer.shadowRadius = 2
customTitle.layer.shadowOffset = CGSize(width: 0, height: 3)
customTitle.layer.shadowOpacity = 0.2
}
}
@@ -0,0 +1,197 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="10117" systemVersion="15F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<collectionViewCell opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" id="gTV-IL-0wX" customClass="DemoCollectionViewCell" customModule="DemoExpandingCollection" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="256" height="335"/>
<autoresizingMask key="autoresizingMask"/>
<view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center">
<rect key="frame" x="0.0" y="0.0" width="256" height="335"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="rbd-6U-uYZ">
<rect key="frame" x="0.0" y="0.0" width="256" height="335"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="icons" translatesAutoresizingMaskIntoConstraints="NO" id="7zK-Le-Npw">
<rect key="frame" x="20" y="287" width="116" height="40"/>
<constraints>
<constraint firstAttribute="width" constant="116" id="7hq-gd-WaT"/>
<constraint firstAttribute="height" constant="40" id="cUH-6u-zMD"/>
</constraints>
</imageView>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="dots" translatesAutoresizingMaskIntoConstraints="NO" id="Au6-h8-xBa">
<rect key="frame" x="228" y="298" width="4" height="19"/>
<constraints>
<constraint firstAttribute="height" constant="19" id="KJW-6L-1Ol"/>
<constraint firstAttribute="width" constant="4" id="YcW-cL-JpF"/>
</constraints>
</imageView>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="stars" translatesAutoresizingMaskIntoConstraints="NO" id="l9V-6B-rdj">
<rect key="frame" x="159" y="266" width="77" height="12"/>
<constraints>
<constraint firstAttribute="height" constant="12" id="Nl5-u6-NGX"/>
<constraint firstAttribute="width" constant="77" id="NwE-fo-yyB"/>
</constraints>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="NO. 7911847" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="pMH-Qa-ClW">
<rect key="frame" x="24" y="265" width="68" height="14"/>
<fontDescription key="fontDescription" type="system" pointSize="11"/>
<color key="textColor" red="0.49803921568627452" green="0.51764705882352935" blue="0.53725490196078429" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="La Crescenta-Montrose, CA91020" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="eC4-wU-lTH">
<rect key="frame" x="39" y="240" width="179" height="14"/>
<fontDescription key="fontDescription" type="system" pointSize="11"/>
<color key="textColor" red="0.49803921569999998" green="0.51764705879999995" blue="0.53725490200000003" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="Au6-h8-xBa" firstAttribute="top" secondItem="l9V-6B-rdj" secondAttribute="bottom" constant="20" id="1qd-Em-ZT9"/>
<constraint firstItem="pMH-Qa-ClW" firstAttribute="leading" secondItem="rbd-6U-uYZ" secondAttribute="leading" constant="24" id="7zn-VD-NCK"/>
<constraint firstAttribute="trailing" secondItem="l9V-6B-rdj" secondAttribute="trailing" constant="20" id="Bx8-Es-m5m"/>
<constraint firstAttribute="trailing" secondItem="Au6-h8-xBa" secondAttribute="trailing" constant="24" id="Eiq-Mk-Msj"/>
<constraint firstItem="eC4-wU-lTH" firstAttribute="centerX" secondItem="rbd-6U-uYZ" secondAttribute="centerX" id="GPf-gb-s8O"/>
<constraint firstAttribute="bottom" secondItem="eC4-wU-lTH" secondAttribute="bottom" constant="81" id="IBD-EA-167"/>
<constraint firstItem="7zK-Le-Npw" firstAttribute="leading" secondItem="rbd-6U-uYZ" secondAttribute="leading" constant="20" id="TPF-bw-RZD"/>
<constraint firstItem="pMH-Qa-ClW" firstAttribute="centerY" secondItem="l9V-6B-rdj" secondAttribute="centerY" id="VJk-xM-6CG"/>
<constraint firstAttribute="width" constant="256" id="bOS-YB-1Lf"/>
<constraint firstItem="Au6-h8-xBa" firstAttribute="centerY" secondItem="7zK-Le-Npw" secondAttribute="centerY" id="pmY-wA-X0z"/>
<constraint firstAttribute="bottom" secondItem="7zK-Le-Npw" secondAttribute="bottom" constant="8" id="rz8-al-BzK"/>
<constraint firstAttribute="height" constant="335" id="uVN-GL-ji7"/>
</constraints>
</view>
<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="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">
<rect key="frame" x="62" y="10" width="132" height="29"/>
<accessibility key="accessibilityConfiguration">
<bool key="isElement" value="NO"/>
</accessibility>
<fontDescription key="fontDescription" type="system" pointSize="24"/>
<color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<nil key="highlightedColor"/>
<color key="shadowColor" red="0.0" green="0.0" blue="0.0" alpha="0.076029349662162168" colorSpace="calibratedRGB"/>
<size key="shadowOffset" width="0.0" height="0.0"/>
</label>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="oce-vs-fcR" userLabel="LeftView">
<rect key="frame" x="8" y="293" width="110" height="32"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="NORTH LAT 36" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ZG8-y8-Dfi">
<rect key="frame" x="13" y="9" width="85" height="15"/>
<fontDescription key="fontDescription" type="system" weight="thin" pointSize="12"/>
<color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" red="1" green="0.2070791421" blue="0.80130883779999995" alpha="0.0" colorSpace="calibratedRGB"/>
<constraints>
<constraint firstItem="ZG8-y8-Dfi" firstAttribute="centerX" secondItem="oce-vs-fcR" secondAttribute="centerX" id="5kH-aW-2nu"/>
<constraint firstAttribute="height" constant="32" id="Ltd-P2-jig"/>
<constraint firstItem="ZG8-y8-Dfi" firstAttribute="centerY" secondItem="oce-vs-fcR" secondAttribute="centerY" id="vKS-ZL-gya"/>
</constraints>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="FVj-GH-Mhw" userLabel="CenterView">
<rect key="frame" x="119" y="293" width="20" height="32"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="pinIcon" translatesAutoresizingMaskIntoConstraints="NO" id="LFF-iv-Z1U">
<rect key="frame" x="2" y="7" width="15" height="18"/>
<accessibility key="accessibilityConfiguration">
<accessibilityTraits key="traits" staticText="YES"/>
<bool key="isElement" value="YES"/>
</accessibility>
<constraints>
<constraint firstAttribute="height" constant="18" id="1dN-X0-Bf6"/>
<constraint firstAttribute="width" constant="15" id="bDb-0k-7tD"/>
</constraints>
</imageView>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
<accessibility key="accessibilityConfiguration">
<accessibilityTraits key="traits" staticText="YES"/>
<bool key="isElement" value="NO"/>
</accessibility>
<constraints>
<constraint firstAttribute="height" constant="32" id="6kc-cx-RQG"/>
<constraint firstAttribute="width" constant="20" id="HZC-Cm-9vv"/>
<constraint firstItem="LFF-iv-Z1U" firstAttribute="centerX" secondItem="FVj-GH-Mhw" secondAttribute="centerX" id="m3x-mJ-N1X"/>
<constraint firstItem="LFF-iv-Z1U" firstAttribute="centerY" secondItem="FVj-GH-Mhw" secondAttribute="centerY" id="wiM-X5-HkU"/>
</constraints>
</view>
<view tag="4" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="EKg-XH-vNU" userLabel="RightView">
<rect key="frame" x="140" y="293" width="110" height="32"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="EAST LNG 97" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="zmS-RM-seQ">
<rect key="frame" x="18" y="9" width="75" height="15"/>
<fontDescription key="fontDescription" type="system" weight="thin" pointSize="12"/>
<color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" red="1" green="0.20707914213106515" blue="0.8013088377544425" alpha="0.0" colorSpace="calibratedRGB"/>
<constraints>
<constraint firstItem="zmS-RM-seQ" firstAttribute="centerY" secondItem="EKg-XH-vNU" secondAttribute="centerY" id="dxV-Q6-AU9"/>
<constraint firstItem="zmS-RM-seQ" firstAttribute="centerX" secondItem="EKg-XH-vNU" secondAttribute="centerX" id="ls8-YV-n1Q"/>
<constraint firstAttribute="height" constant="32" id="qBY-ls-e2P"/>
</constraints>
</view>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="9FK-FA-F0l" firstAttribute="top" secondItem="4h2-Xv-xjU" secondAttribute="top" id="0HR-8P-WVW"/>
<constraint firstItem="EKg-XH-vNU" firstAttribute="leading" secondItem="FVj-GH-Mhw" secondAttribute="trailing" constant="1" id="6Bb-cJ-uQs"/>
<constraint firstItem="EKg-XH-vNU" firstAttribute="centerY" secondItem="oce-vs-fcR" secondAttribute="centerY" id="CIg-Mj-d0n"/>
<constraint firstAttribute="height" constant="335" id="Daq-kO-5kx"/>
<constraint firstAttribute="width" constant="256" id="KpD-0P-bHb"/>
<constraint firstAttribute="bottom" secondItem="oce-vs-fcR" secondAttribute="bottom" constant="10" id="NaA-tk-a2A"/>
<constraint firstItem="XFh-D7-eSl" firstAttribute="centerX" secondItem="4h2-Xv-xjU" secondAttribute="centerX" id="R29-hI-QrJ"/>
<constraint firstItem="XFh-D7-eSl" firstAttribute="top" secondItem="4h2-Xv-xjU" secondAttribute="top" constant="10" id="Rqu-wG-qYm"/>
<constraint firstAttribute="bottom" secondItem="9FK-FA-F0l" secondAttribute="bottom" id="T93-uF-QTS"/>
<constraint firstItem="oce-vs-fcR" firstAttribute="leading" secondItem="4h2-Xv-xjU" secondAttribute="leading" constant="8" id="b8q-tF-xpu"/>
<constraint firstItem="oce-vs-fcR" firstAttribute="width" secondItem="EKg-XH-vNU" secondAttribute="width" id="cXw-ba-vBK"/>
<constraint firstAttribute="trailing" secondItem="9FK-FA-F0l" secondAttribute="trailing" id="dDb-4G-VP0"/>
<constraint firstAttribute="trailing" secondItem="EKg-XH-vNU" secondAttribute="trailing" constant="6" id="qlV-dg-rJ7"/>
<constraint firstItem="9FK-FA-F0l" firstAttribute="leading" secondItem="4h2-Xv-xjU" secondAttribute="leading" id="rSI-NM-sWq"/>
<constraint firstItem="FVj-GH-Mhw" firstAttribute="leading" secondItem="oce-vs-fcR" secondAttribute="trailing" constant="1" id="tj6-tP-w0U"/>
<constraint firstItem="FVj-GH-Mhw" firstAttribute="centerY" secondItem="EKg-XH-vNU" secondAttribute="centerY" id="yg0-HH-sZA"/>
</constraints>
</view>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
</view>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="4h2-Xv-xjU" firstAttribute="centerY" secondItem="gTV-IL-0wX" secondAttribute="centerY" id="0xA-8H-CCG"/>
<constraint firstItem="rbd-6U-uYZ" firstAttribute="centerX" secondItem="gTV-IL-0wX" secondAttribute="centerX" id="6nN-mZ-xkq"/>
<constraint firstItem="rbd-6U-uYZ" firstAttribute="centerY" secondItem="gTV-IL-0wX" secondAttribute="centerY" id="dmf-qy-2nS"/>
<constraint firstItem="4h2-Xv-xjU" firstAttribute="centerX" secondItem="gTV-IL-0wX" secondAttribute="centerX" id="rxW-Py-qwy"/>
</constraints>
<size key="customSize" width="275" height="575"/>
<connections>
<outlet property="backConstraintY" destination="dmf-qy-2nS" id="szE-V2-yce"/>
<outlet property="backContainerView" destination="rbd-6U-uYZ" id="bk5-30-huH"/>
<outlet property="backgroundImageView" destination="9FK-FA-F0l" id="kns-UF-jMo"/>
<outlet property="customTitle" destination="XFh-D7-eSl" id="eia-lY-ptu"/>
<outlet property="frontConstraintY" destination="0xA-8H-CCG" id="qOL-jY-lrP"/>
<outlet property="frontContainerView" destination="4h2-Xv-xjU" id="Mxy-UR-phd"/>
</connections>
<point key="canvasLocation" x="547" y="515.5"/>
</collectionViewCell>
</objects>
<resources>
<image name="dots" width="4" height="19"/>
<image name="icons" width="116" height="39"/>
<image name="item0" width="414" height="736"/>
<image name="pinIcon" width="26" height="32"/>
<image name="stars" width="77" height="11"/>
</resources>
</document>
@@ -0,0 +1,151 @@
//
// DemoViewController.swift
// TestCollectionView
//
// Created by Alex K. on 12/05/16.
// Copyright © 2016 Alex K. All rights reserved.
//
import UIKit
class DemoViewController: ExpandingViewController {
typealias ItemInfo = (imageName: String, title: String)
private var cellsIsOpen = [Bool]()
private let items: [ItemInfo] = [("item0", "Boston"),("item1", "New York"),("item2", "San Francisco"),("item3", "Washington")]
@IBOutlet weak var pageLabel: UILabel!
}
// MARK: life cicle
extension DemoViewController {
override func viewDidLoad() {
super.viewDidLoad()
registerCell()
fillCellIsOpeenArry()
addGestureToView(collectionView!)
configureNavBar()
}
}
// MARK: Helpers
extension DemoViewController {
private func registerCell() {
let nib = UINib(nibName: String(DemoCollectionViewCell), bundle: nil)
collectionView?.registerNib(nib, forCellWithReuseIdentifier: String(DemoCollectionViewCell))
}
private func fillCellIsOpeenArry() {
for _ in 0..<items.count {
cellsIsOpen.append(false)
}
}
private func getViewController() -> ExpandingTableViewController {
let storyboard = UIStoryboard(storyboard: .Main)
let toViewController: DemoTableViewController = storyboard.instantiateViewController()
return toViewController
}
private func configureNavBar() {
navigationItem.leftBarButtonItem?.image = navigationItem.leftBarButtonItem?.image!.imageWithRenderingMode(UIImageRenderingMode.AlwaysOriginal)
}
}
/// MARK: Gesture
extension DemoViewController {
private func addGestureToView(toView: UIView) {
let gesutereUp = Init(UISwipeGestureRecognizer(target: self, action: #selector(DemoViewController.swipeHandler(_:)))) {
$0.direction = .Up
}
let gesutereDown = Init(UISwipeGestureRecognizer(target: self, action: #selector(DemoViewController.swipeHandler(_:)))) {
$0.direction = .Down
}
toView.addGestureRecognizer(gesutereUp)
toView.addGestureRecognizer(gesutereDown)
}
func swipeHandler(sender: UISwipeGestureRecognizer) {
let indexPath = NSIndexPath(forRow: currentIndex, inSection: 0)
guard case let cell as DemoCollectionViewCell = collectionView?.cellForItemAtIndexPath(indexPath) else {
return
}
// double swipe Up transition
if cell.isOpened == true && sender.direction == .Up {
pushToViewController(getViewController())
if case let rightButton as AnimatingBarButton = navigationItem.rightBarButtonItem {
rightButton.animationSelected(true)
}
}
let open = sender.direction == .Up ? true : false
cell.cellIsOpen(open)
cellsIsOpen[indexPath.row] = cell.isOpened
}
}
// MARK: UIScrollViewDelegate
extension DemoViewController {
func scrollViewDidScroll(scrollView: UIScrollView) {
pageLabel.text = "\(currentIndex+1)/\(items.count)"
}
}
// MARK: UICollectionViewDataSource
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
let info = items[index]
cell.backgroundImageView?.image = UIImage(named: info.imageName)
cell.customTitle.text = info.title
cell.cellIsOpen(cellsIsOpen[indexPath.row], 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 }
if cell.isOpened == false {
cell.cellIsOpen(true)
} else {
pushToViewController(getViewController())
if case let rightButton as AnimatingBarButton = navigationItem.rightBarButtonItem {
rightButton.animationSelected(true)
}
}
}
}
// MARK: UICollectionViewDataSource
extension DemoViewController {
override func collectionView(collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
return items.count
}
override func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -> UICollectionViewCell {
return collectionView.dequeueReusableCellWithReuseIdentifier(String(DemoCollectionViewCell), forIndexPath: indexPath)
}
}
@@ -0,0 +1,89 @@
//
// AnimationBarButton.swift
// TestCollectionView
//
// Created by Alex K. on 23/05/16.
// Copyright © 2016 Alex K. All rights reserved.
//
import UIKit
class AnimatingBarButton: UIBarButtonItem, Rotatable {
@IBInspectable var normalImageName: String = ""
@IBInspectable var selectedImageName: String = ""
@IBInspectable var duration: Double = 1
let normalView = UIImageView(frame: .zero)
let selectedView = UIImageView(frame: .zero)
}
// MARK: life cicle
extension AnimatingBarButton {
override func awakeFromNib() {
super.awakeFromNib()
customView = UIView(frame: CGRect(x: 0, y: 0, width: 44, height: 44))
// customView?.backgroundColor = .redColor()
configurateImageViews()
}
}
// MARK: public
extension AnimatingBarButton {
func animationSelected(selected: Bool) {
if selected {
rotateAnimationFrom(normalView, toItem: selectedView, duration: duration)
} else {
rotateAnimationFrom(selectedView, toItem: normalView, duration: duration)
}
}
}
// MARK: Create
extension AnimatingBarButton {
private func configurateImageViews() {
configureImageView(normalView, imageName: normalImageName)
configureImageView(selectedView, imageName: selectedImageName)
selectedView.alpha = 0
// normalView.hidden = true
}
private func configureImageView(imageView: UIImageView, imageName: String) {
guard let customView = self.customView else {
return
}
imageView.translatesAutoresizingMaskIntoConstraints = false
imageView.image = UIImage(named: imageName)
imageView.contentMode = .ScaleAspectFit
// imageView.backgroundColor = .greenColor()
// imageView.layer.anchorPoint = CGPoint(x: 0.5, y: 0.5)
customView.addSubview(imageView)
// add constraints
[(NSLayoutAttribute.CenterX, 12), (.CenterY, -1)].forEach { info in
(customView, imageView) >>>- {
$0.attribute = info.0
$0.constant = CGFloat(info.1)
}
}
[NSLayoutAttribute.Height, .Width].forEach { attribute in
imageView >>>- {
$0.attribute = attribute
$0.constant = 20
}
}
}
}
@@ -0,0 +1,42 @@
//
// Rotatable.swift
// TestCollectionView
//
// Created by Alex K. on 23/05/16.
// Copyright © 2016 Alex K. All rights reserved.
//
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)
let fromOpacity = animationFrom(1, to: 0, key: "opacity", duration: duration)
let toRotate = animationFrom(-M_PI, to: 0, key: "transform.rotation", duration: duration)
let toOpacity = animationFrom(0, to: 1, key: "opacity", duration: duration)
fromItem.layer.addAnimation(fromRotate, forKey: nil)
fromItem.layer.addAnimation(fromOpacity, forKey: nil)
toItem.layer.addAnimation(toRotate, forKey: nil)
toItem.layer.addAnimation(toOpacity, forKey: nil)
}
private func animationFrom(from: Double, to: Double, key: String, duration: Double) -> CABasicAnimation {
return Init(CABasicAnimation(keyPath: key)) {
$0.duration = duration
$0.fromValue = from
$0.toValue = to
$0.fillMode = kCAFillModeForwards
$0.removedOnCompletion = false;
}
}
}
@@ -0,0 +1,36 @@
//
// DemoExpandingCollectionTests.swift
// DemoExpandingCollectionTests
//
// Created by Alex K. on 25/05/16.
// Copyright © 2016 Alex K. All rights reserved.
//
import XCTest
@testable import DemoExpandingCollection
class DemoExpandingCollectionTests: XCTestCase {
override func setUp() {
super.setUp()
// Put setup code here. This method is called before the invocation of each test method in the class.
}
override func tearDown() {
// Put teardown code here. This method is called after the invocation of each test method in the class.
super.tearDown()
}
func testExample() {
// This is an example of a functional test case.
// Use XCTAssert and related functions to verify your tests produce the correct results.
}
func testPerformanceExample() {
// This is an example of a performance test case.
self.measureBlock {
// Put the code you want to measure the time of here.
}
}
}
@@ -0,0 +1,24 @@
<?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>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
</dict>
</plist>
+21
View File
@@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2016 Ramotion
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.
+1
View File
@@ -0,0 +1 @@
# expanding-collection
@@ -0,0 +1,49 @@
//
// TableViewController.swift
// TestCollectionView
//
// Created by Alex K. on 06/05/16.
// Copyright © 2016 Alex K. All rights reserved.
//
import UIKit
public class ExpandingTableViewController: UITableViewController {
// MARK: Vars
public var headerHeight: CGFloat = 236
var transitionDriver: TransitionDriver?
public required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
}
}
// MARK: Helpers
extension ExpandingTableViewController {
private func getScreen() -> UIImage? {
let height = (headerHeight - tableView.contentOffset.y) < 0 ? 0 : (headerHeight - tableView.contentOffset.y)
let backImageSize = CGSize(width: view.bounds.width, height: view.bounds.height - height)
let backImageOrigin = CGPoint(x: 0, y: height + tableView.contentOffset.y)
return view.takeSnapshot(CGRect(origin: backImageOrigin, size: backImageSize))
}
}
// MARK: Public
extension ExpandingTableViewController {
public func popTransitionAnimation() {
guard let transitionDriver = self.transitionDriver else {
return
}
let backImage = getScreen()
let offset = tableView.contentOffset.y > headerHeight ? headerHeight : tableView.contentOffset.y
transitionDriver.popTransitionAnimationContantOffset(offset, backImage: backImage)
self.navigationController?.popViewControllerAnimated(false)
}
}
@@ -0,0 +1,235 @@
//
// PageConllectionCell.swift
// TestCollectionView
//
// Created by Alex K. on 04/05/16.
// Copyright © 2016 Alex K. All rights reserved.
//
import UIKit
public class BasePageCollectionCell: UICollectionViewCell {
@IBInspectable public var openSize: CGFloat = 40
// MARK: Constants
struct Constants {
static let backContainer = "backContainerViewKey"
static let shadowView = "shadowViewKey"
static let frontContainer = "frontContainerKey"
static let backContainerY = "backContainerYKey"
static let frontContainerY = "frontContainerYKey"
}
// MARK: Vars
@IBOutlet weak var frontContainerView: UIView!
@IBOutlet weak var backContainerView: UIView!
@IBOutlet weak var backConstraintY: NSLayoutConstraint!
@IBOutlet weak var frontConstraintY: NSLayoutConstraint!
var shadowView: UIView?
public var isOpened = false
// MARK: inits
required public init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
configureOutletFromDecoder(aDecoder)
}
override init(frame: CGRect) {
super.init(frame: frame)
commonInit()
}
}
// MARK: life cicle
extension BasePageCollectionCell {
public override func awakeFromNib() {
super.awakeFromNib()
commonInit()
}
private func commonInit() {
configurationViews()
shadowView = createShadowViewOnView(frontContainerView)
}
}
// MARK: Control
extension BasePageCollectionCell {
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
if let widthConstant = backContainerView.getConstraint(.Width) {
widthConstant.constant = isOpen == true ? contentView.bounds.size.width + openSize : contentView.bounds.size.width
}
if let heightConstant = backContainerView.getConstraint(.Height) {
heightConstant.constant = isOpen == true ? contentView.bounds.size.height + openSize : contentView.bounds.size.height
}
if animated == true {
UIView.animateWithDuration(0.3, delay: 0, options: .CurveEaseInOut, animations: {
self.contentView.layoutIfNeeded()
}, completion: nil)
} else {
self.contentView.layoutIfNeeded()
}
isOpened = isOpen
}
}
// MARK: Configuration
extension BasePageCollectionCell {
private func configurationViews() {
backContainerView.layer.masksToBounds = true
backContainerView.layer.cornerRadius = 5
frontContainerView.layer.masksToBounds = true
frontContainerView.layer.cornerRadius = 5
contentView.layer.masksToBounds = false
layer.masksToBounds = false
}
private func createShadowViewOnView(view: UIView?) -> UIView? {
guard let view = view else {return nil}
let shadow = Init(UIView(frame: .zero)) {
$0.backgroundColor = .clearColor()
$0.translatesAutoresizingMaskIntoConstraints = false
$0.layer.masksToBounds = false;
$0.layer.shadowColor = UIColor.blackColor().CGColor
$0.layer.shadowRadius = 10
$0.layer.shadowOpacity = 0.3
$0.layer.shadowOffset = CGSize(width: 0, height:0)
}
contentView.insertSubview(shadow, belowSubview: view)
// create constraints
for info: (attribute: NSLayoutAttribute, scale: CGFloat) in [(NSLayoutAttribute.Width, 0.8), (NSLayoutAttribute.Height, 0.9)] {
if let frontViewConstraint = view.getConstraint(info.attribute) {
shadow >>>- {
$0.attribute = info.attribute
$0.constant = frontViewConstraint.constant * info.scale
}
}
}
for info: (attribute: NSLayoutAttribute, offset: CGFloat) in [(NSLayoutAttribute.CenterX, 0), (NSLayoutAttribute.CenterY, 30)] {
(contentView, shadow, view) >>>- {
$0.attribute = info.attribute
$0.constant = info.offset
}
}
// size shadow
let width = shadow.getConstraint(.Width)?.constant
let height = shadow.getConstraint(.Height)?.constant
shadow.layer.shadowPath = UIBezierPath(roundedRect: CGRect(x: 0, y: 0, width: width!, height: height!), cornerRadius: 0).CGPath
return shadow
}
}
// MARK: NSCoding
extension BasePageCollectionCell {
private func highlightedImageFalseOnView(view: UIView) {
for item in view.subviews {
if case let imageView as UIImageView = item {
imageView.highlighted = false
}
if item.subviews.count > 0 {
highlightedImageFalseOnView(item)
}
}
}
private func copyShadowFromView(fromView: UIView, toView: UIView) {
fromView.layer.shadowPath = toView.layer.shadowPath
fromView.layer.masksToBounds = toView.layer.masksToBounds
fromView.layer.shadowColor = toView.layer.shadowColor
fromView.layer.shadowRadius = toView.layer.shadowRadius
fromView.layer.shadowOpacity = toView.layer.shadowOpacity
fromView.layer.shadowOffset = toView.layer.shadowOffset
}
func copyCell() -> BasePageCollectionCell? {
highlightedImageFalseOnView(contentView)
let data = NSKeyedArchiver.archivedDataWithRootObject(self)
guard case let copyView as BasePageCollectionCell = NSKeyedUnarchiver.unarchiveObjectWithData(data),
let shadowView = self.shadowView else {
return nil
}
// configure
copyView.backContainerView.layer.masksToBounds = backContainerView.layer.masksToBounds
copyView.backContainerView.layer.cornerRadius = backContainerView.layer.cornerRadius
copyView.frontContainerView.layer.masksToBounds = frontContainerView.layer.masksToBounds
copyView.frontContainerView.layer.cornerRadius = frontContainerView.layer.cornerRadius
// copy shadow layer
copyShadowFromView(copyView.shadowView!, toView: shadowView)
for index in 0..<copyView.frontContainerView.subviews.count {
copyShadowFromView(copyView.frontContainerView.subviews[index], toView: frontContainerView.subviews[index])
}
return copyView
}
public override func encodeWithCoder(coder: NSCoder) {
super.encodeWithCoder(coder)
coder.encodeObject(backContainerView, forKey: Constants.backContainer)
coder.encodeObject(frontContainerView, forKey: Constants.frontContainer)
coder.encodeObject(frontConstraintY, forKey: Constants.frontContainerY)
coder.encodeObject(backConstraintY, forKey: Constants.backContainerY)
coder.encodeObject(shadowView, forKey: Constants.shadowView)
}
private func configureOutletFromDecoder(coder: NSCoder) {
if case let shadowView as UIView = coder.decodeObjectForKey(Constants.shadowView) {
self.shadowView = shadowView
}
if case let backView as UIView = coder.decodeObjectForKey(Constants.backContainer) {
backContainerView = backView
}
if case let frontView as UIView = coder.decodeObjectForKey(Constants.frontContainer) {
frontContainerView = frontView
}
if case let constraint as NSLayoutConstraint = coder.decodeObjectForKey(Constants.frontContainerY) {
frontConstraintY = constraint
}
if case let constraint as NSLayoutConstraint = coder.decodeObjectForKey(Constants.backContainerY) {
backConstraintY = constraint
}
}
}
@@ -0,0 +1,149 @@
//
// PageCollectionLayout.swift
// TestCollectionView
//
// Created by Alex K. on 04/05/16.
// Copyright © 2016 Alex K. All rights reserved.
//
import UIKit
class PageCollectionLayout: UICollectionViewFlowLayout {
private var lastCollectionViewSize: CGSize = CGSizeZero
var scalingOffset: CGFloat = 200
var minimumScaleFactor: CGFloat = 0.9
var minimumAlphaFactor: CGFloat = 0.3
var scaleItems: Bool = true
required init?(coder aDecoder: NSCoder) {
fatalError()
}
init(itemSize: CGSize) {
super.init()
commonInit(itemSize)
}
}
// MARK: life cicle
extension PageCollectionLayout {
private func commonInit(itemSize: CGSize) {
scrollDirection = .Horizontal
minimumLineSpacing = 25
self.itemSize = itemSize
}
}
// MARK: override
extension PageCollectionLayout {
override func invalidateLayoutWithContext(context: UICollectionViewLayoutInvalidationContext) {
super.invalidateLayoutWithContext(context)
guard let collectionView = self.collectionView else { return }
if collectionView.bounds.size != lastCollectionViewSize {
self.configureInset()
self.lastCollectionViewSize = collectionView.bounds.size
}
}
override func targetContentOffsetForProposedContentOffset(proposedContentOffset: CGPoint, withScrollingVelocity velocity: CGPoint) -> CGPoint {
guard let collectionView = self.collectionView else {
return proposedContentOffset
}
let proposedRect = CGRectMake(proposedContentOffset.x, 0, collectionView.bounds.width, collectionView.bounds.height)
guard let layoutAttributes = self.layoutAttributesForElementsInRect(proposedRect) else {
return proposedContentOffset
}
var candidateAttributes: UICollectionViewLayoutAttributes?
let proposedContentOffsetCenterX = proposedContentOffset.x + collectionView.bounds.width / 2
for attributes in layoutAttributes {
if attributes.representedElementCategory != .Cell {
continue
}
if candidateAttributes == nil {
candidateAttributes = attributes
continue
}
if fabs(attributes.center.x - proposedContentOffsetCenterX) < fabs(candidateAttributes!.center.x - proposedContentOffsetCenterX) {
candidateAttributes = attributes
}
}
guard let aCandidateAttributes = candidateAttributes else {
return proposedContentOffset
}
var newOffsetX = aCandidateAttributes.center.x - collectionView.bounds.size.width / 2
let offset = newOffsetX - collectionView.contentOffset.x
if (velocity.x < 0 && offset > 0) || (velocity.x > 0 && offset < 0) {
let pageWidth = self.itemSize.width + self.minimumLineSpacing
newOffsetX += velocity.x > 0 ? pageWidth : -pageWidth
}
return CGPointMake(newOffsetX, proposedContentOffset.y)
}
override func shouldInvalidateLayoutForBoundsChange(newBounds: CGRect) -> Bool {
return true
}
override func layoutAttributesForElementsInRect(rect: CGRect) -> [UICollectionViewLayoutAttributes]? {
guard let collectionView = self.collectionView,
let superAttributes = super.layoutAttributesForElementsInRect(rect) else {
return super.layoutAttributesForElementsInRect(rect)
}
if scaleItems == false{
return super.layoutAttributesForElementsInRect(rect)
}
let contentOffset = collectionView.contentOffset
let size = collectionView.bounds.size
let visibleRect = CGRectMake(contentOffset.x, contentOffset.y, size.width, size.height)
let visibleCenterX = CGRectGetMidX(visibleRect)
guard case let newAttributesArray as [UICollectionViewLayoutAttributes] = NSArray(array: superAttributes, copyItems: true) else {
return nil
}
newAttributesArray.forEach {
let distanceFromCenter = visibleCenterX - $0.center.x
let absDistanceFromCenter = min(abs(distanceFromCenter), self.scalingOffset)
let scale = absDistanceFromCenter * (self.minimumScaleFactor - 1) / self.scalingOffset + 1
$0.transform3D = CATransform3DScale(CATransform3DIdentity, scale, scale, 1)
let alpha = absDistanceFromCenter * (self.minimumAlphaFactor - 1) / self.scalingOffset + 1
$0.alpha = alpha
}
return newAttributesArray
}
}
// MARK: helpers
extension PageCollectionLayout {
private func configureInset() -> Void {
guard let collectionView = self.collectionView else {
return
}
let inset = collectionView.bounds.size.width / 2 - itemSize.width / 2
collectionView.contentInset = UIEdgeInsetsMake(0, inset, 0, inset)
collectionView.contentOffset = CGPointMake(-inset, 0)
}
}
@@ -0,0 +1,47 @@
//
// PageCollectionView.swift
// TestCollectionView
//
// Created by Alex K. on 05/05/16.
// Copyright © 2016 Alex K. All rights reserved.
//
import UIKit
class PageCollectionView: UICollectionView {
}
// MARK: init
extension PageCollectionView {
class func createOnView(view: UIView,
layout: UICollectionViewLayout,
height:CGFloat,
dataSource: UICollectionViewDataSource,
delegate: UICollectionViewDelegate) -> PageCollectionView {
let collectionView = Init(PageCollectionView(frame: CGRect.zero, collectionViewLayout: layout)) {
$0.translatesAutoresizingMaskIntoConstraints = false
$0.decelerationRate = UIScrollViewDecelerationRateFast
$0.showsHorizontalScrollIndicator = false
$0.dataSource = dataSource
$0.delegate = delegate
$0.backgroundColor = .clearColor()
}
view.addSubview(collectionView)
// add constraints
collectionView >>>- {
$0.attribute = .Height
$0.constant = height
}
[NSLayoutAttribute.Left, .Right, .CenterY].forEach { attribute in
(view, collectionView) >>>- { $0.attribute = attribute }
}
return collectionView
}
}
@@ -0,0 +1,97 @@
//
// PageViewController.swift
// TestCollectionView
//
// Created by Alex K. on 05/05/16.
// Copyright © 2016 Alex K. All rights reserved.
//
import UIKit
public class ExpandingViewController: UIViewController {
public var itemSize = CGSize(width: 256, height: 335)
public var collectionView: UICollectionView?
private var transitionDriver: TransitionDriver?
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))
}
}
// MARK: life cicle
extension ExpandingViewController {
public override func viewDidLoad() {
super.viewDidLoad()
commonInit()
}
}
// MARK: Transition
public extension ExpandingViewController {
func pushToViewController(viewController: ExpandingTableViewController) {
guard let collectionView = self.collectionView else {
return
}
viewController.transitionDriver = transitionDriver
let backImage = getBackImage(viewController, headerHeight: viewController.headerHeight)
transitionDriver?.pushTransitionAnimationIndex(currentIndex,
collecitionView: collectionView,
backImage: backImage,
headerHeight: viewController.headerHeight) { headerView in
viewController.tableView.tableHeaderView = headerView
self.navigationController?.pushViewController(viewController, animated: false)
}
}
}
// MARK: create
extension ExpandingViewController {
private func commonInit() {
let layout = PageCollectionLayout(itemSize: itemSize)
collectionView = PageCollectionView.createOnView(view,
layout: layout,
height: itemSize.height + itemSize.height / 5 * 2,
dataSource: self,
delegate: self)
transitionDriver = TransitionDriver(view: view)
}
}
// MARK: Helpers
extension ExpandingViewController {
private func getBackImage(viewController: UIViewController, headerHeight: CGFloat) -> UIImage? {
let imageSize = CGSize(width: viewController.view.bounds.width, height: viewController.view.bounds.height - headerHeight)
let imageFrame = CGRect(origin: CGPoint(x: 0, y: 0), size: imageSize)
return viewController.view.takeSnapshot(imageFrame)
}
}
// MARK: UICollectionViewDataSource
extension ExpandingViewController: UICollectionViewDataSource, UICollectionViewDelegate{
public func collectionView(collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
fatalError("need emplementation in subclass")
}
public func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -> UICollectionViewCell {
fatalError("need emplementation in subclass")
}
}
@@ -0,0 +1,30 @@
//
// CornerAnimatable.swift
// TestCollectionView
//
// Created by Alex K. on 20/05/16.
// Copyright © 2016 Alex K. All rights reserved.
//
import UIKit
protocol CornerAnimatable {
func animationCornerRadius(radius: CGFloat, duration: Double)
}
extension CornerAnimatable where Self: UIView {
func animationCornerRadius(radius: CGFloat, duration: Double) {
let animation = Init(CABasicAnimation(keyPath: "cornerRadius")) {
$0.duration = duration
$0.toValue = radius
$0.fillMode = kCAFillModeForwards
$0.removedOnCompletion = false;
}
layer.addAnimation(animation, forKey: nil)
}
}
extension UIView: CornerAnimatable {}
@@ -0,0 +1,16 @@
//
// ConfigurationHelper.swift
// TestCollectionView
//
// Created by Alex K. on 05/05/16.
// Copyright © 2016 Alex K. All rights reserved.
//
import Foundation
@warn_unused_result
internal func Init<Type>(value : Type, @noescape block: (object: Type) -> Void) -> Type
{
block(object: value)
return value
}
@@ -0,0 +1,91 @@
//
// ConstraintsHelper.swift
// TestCollectionView
//
// Created by Alex K. on 05/05/16.
// Copyright © 2016 Alex K. All rights reserved.
//
import UIKit
struct ConstraintInfo {
var attribute: NSLayoutAttribute = .Left
var secondAttribute: NSLayoutAttribute = .NotAnAttribute
var constant: CGFloat = 0
var identifier: String?
var relation: NSLayoutRelation = .Equal
}
infix operator >>>- { associativity left precedence 150 }
func >>>- <T: UIView> (left: (T, T), @noescape block: (inout ConstraintInfo) -> ()) -> NSLayoutConstraint {
var info = ConstraintInfo()
block(&info)
info.secondAttribute = info.secondAttribute == .NotAnAttribute ? info.attribute : info.secondAttribute
let constraint = NSLayoutConstraint(item: left.1,
attribute: info.attribute,
relatedBy: info.relation,
toItem: left.0,
attribute: info.secondAttribute,
multiplier: 1,
constant: info.constant)
constraint.identifier = info.identifier
left.0.addConstraint(constraint)
return constraint
}
func >>>- <T: UIView> (left: T, @noescape block: (inout ConstraintInfo) -> ()) -> NSLayoutConstraint {
var info = ConstraintInfo()
block(&info)
let constraint = NSLayoutConstraint(item: left,
attribute: info.attribute,
relatedBy: info.relation,
toItem: nil,
attribute: info.attribute,
multiplier: 1,
constant: info.constant)
constraint.identifier = info.identifier
left.addConstraint(constraint)
return constraint
}
func >>>- <T: UIView> (left: (T, T, T), @noescape block: (inout ConstraintInfo) -> ()) -> NSLayoutConstraint {
var info = ConstraintInfo()
block(&info)
info.secondAttribute = info.secondAttribute == .NotAnAttribute ? info.attribute : info.secondAttribute
let constraint = NSLayoutConstraint(item: left.1,
attribute: info.attribute,
relatedBy: info.relation,
toItem: left.2,
attribute: info.secondAttribute,
multiplier: 1,
constant: info.constant)
constraint.identifier = info.identifier
left.0.addConstraint(constraint)
return constraint
}
// MARK: UIView
extension UIView {
func addScaleToFillConstratinsOnView(view: UIView) {
[NSLayoutAttribute.Left, .Right, .Top, .Bottom].forEach { attribute in
(self, view) >>>- { $0.attribute = attribute }
}
}
func getConstraint(attributes: NSLayoutAttribute) -> NSLayoutConstraint? {
return constraints.filter {
if $0.firstAttribute == attributes && $0.secondItem == nil {
return true
}
return false
}.first
}
}
@@ -0,0 +1,28 @@
//
// ScreenShotHelper.swift
// TestCollectionView
//
// Created by Alex K. on 11/05/16.
// Copyright © 2016 Alex K. All rights reserved.
//
import UIKit
extension UIView {
func takeSnapshot(frame: CGRect) -> UIImage? {
UIGraphicsBeginImageContextWithOptions(frame.size, false, 0.0)
let context = UIGraphicsGetCurrentContext();
CGContextTranslateCTM(context, frame.origin.x * -1, frame.origin.y * -1)
guard let currentContext = UIGraphicsGetCurrentContext() else {
return nil
}
self.layer.renderInContext(currentContext)
let image = UIGraphicsGetImageFromCurrentImageContext()
UIGraphicsEndImageContext()
return image
}
}
@@ -0,0 +1,32 @@
//
// SubviewsForEach.swift
// DemoExpandingCollection
//
// Created by Alex K. on 26/05/16.
// Copyright © 2016 Alex K. All rights reserved.
//
import UIKit
protocol SubviewsForEach {
func subviewsForEach(f: UIView -> Void)
}
extension SubviewsForEach where Self: UIView {
func subviewsForEach(f: UIView -> Void) {
forEachView(self, f: f)
}
private func forEachView(view: UIView, f: UIView -> Void) {
view.subviews.forEach {
f($0)
if $0.subviews.count > 0 {
forEachView($0, f: f)
}
}
}
}
extension UIView: SubviewsForEach {}
@@ -0,0 +1,257 @@
//
// TransitionDriver.swift
// TestCollectionView
//
// Created by Alex K. on 11/05/16.
// Copyright © 2016 Alex K. All rights reserved.
//
import UIKit
class TransitionDriver {
// MARK: Constants
struct Constants {
static let HideKey = 101
}
// MARK: Vars
private let view: UIView
private let duration: Double = 0.4
// for push animation
private var copyCell: BasePageCollectionCell?
private var currentCell: BasePageCollectionCell?
private var backImageView: UIImageView?
private var leftCell: UICollectionViewCell?
private var rightCell: UICollectionViewCell?
private var step: CGFloat = 0
private var frontViewFrame = CGRect.zero
private var backViewFrame = CGRect.zero
init(view: UIView) {
self.view = view
}
}
// MARK: control
extension TransitionDriver {
func pushTransitionAnimationIndex(currentIndex: Int,
collecitionView: UICollectionView,
backImage: UIImage?,
headerHeight: CGFloat,
completion: UIView -> Void) {
guard case let cell as BasePageCollectionCell = collecitionView.cellForItemAtIndexPath(NSIndexPath(forRow: currentIndex, inSection: 0)),
let copyView = cell.copyCell() else { return }
copyCell = copyView
// move cells
moveCellsCurrentIndex(currentIndex, collectionView: collecitionView)
currentCell = cell
cell.hidden = true
configurateCell(copyView, backImage: backImage)
backImageView = addImageToView(copyView.backContainerView, image: backImage)
openBackViewConfigureConstraints(copyView, height: headerHeight)
openFrontViewConfigureConstraints(copyView, height: headerHeight)
// corner animation
copyView.backContainerView.animationCornerRadius(0, duration: duration)
copyView.frontContainerView.animationCornerRadius(0, duration: duration)
// constraints animation
UIView.animateWithDuration(duration, delay: 0, options: .CurveEaseInOut, animations: {
self.view.layoutIfNeeded()
self.backImageView?.alpha = 1
self.copyCell?.shadowView?.alpha = 0
copyView.frontContainerView.subviewsForEach { if $0.tag == Constants.HideKey { $0.alpha = 0 } }
}, completion: { success in
let data = NSKeyedArchiver.archivedDataWithRootObject(copyView.frontContainerView)
guard case let headerView as UIView = NSKeyedUnarchiver.unarchiveObjectWithData(data) else {
fatalError("must copy")
}
completion(headerView)
})
}
func popTransitionAnimationContantOffset(offset: CGFloat, backImage: UIImage?) {
guard let copyCell = self.copyCell else {
return
}
backImageView?.image = backImage
// configuration start position
configureCellBeforeClose(copyCell, offset: offset)
closeBackViewConfigurationConstraints(copyCell)
closeFrontViewConfigurationConstraints(copyCell)
// corner animation
copyCell.backContainerView.animationCornerRadius(copyCell.backContainerView.layer.cornerRadius, duration: duration)
copyCell.frontContainerView.animationCornerRadius(copyCell.frontContainerView.layer.cornerRadius, duration: duration)
UIView.animateWithDuration(duration, delay: 0, options: .CurveEaseInOut, animations: {
self.rightCell?.center.x -= self.step
self.leftCell?.center.x += self.step
self.view.layoutIfNeeded()
self.backImageView?.alpha = 0
copyCell.shadowView?.alpha = 1
copyCell.frontContainerView.subviewsForEach { if $0.tag == Constants.HideKey { $0.alpha = 1 } }
}, completion: { success in
self.currentCell?.hidden = false
self.removeCurrentCell()
})
}
}
// MARK: Helpers
extension TransitionDriver {
private func removeCurrentCell() {
if case let currentCell as UIView = self.copyCell {
currentCell.removeFromSuperview()
}
}
private func configurateCell(cell: BasePageCollectionCell, backImage: UIImage?) {
cell.translatesAutoresizingMaskIntoConstraints = false
view.addSubview(cell)
// add constraints
[(NSLayoutAttribute.Width, cell.bounds.size.width), (NSLayoutAttribute.Height, cell.bounds.size.height)].forEach { info in
cell >>>- {
$0.attribute = info.0
$0.constant = info.1
}
}
[NSLayoutAttribute.CenterX, .CenterY].forEach { attribute in
(view, cell) >>>- { $0.attribute = attribute }
}
cell.layoutIfNeeded()
}
private func addImageToView(view: UIView, image: UIImage?) -> UIImageView? {
guard let image = image else { return nil }
let imageView = Init(UIImageView(image: image)) {
$0.translatesAutoresizingMaskIntoConstraints = false
$0.alpha = 0
}
view.addSubview(imageView)
// add constraints
[NSLayoutAttribute.Left, .Right, .Top, .Bottom].forEach { attribute in
(view, imageView) >>>- { $0.attribute = attribute }
}
imageView.layoutIfNeeded()
return imageView
}
private func moveCellsCurrentIndex(currentIndex: Int, collectionView: UICollectionView) {
self.leftCell = nil
self.rightCell = nil
if let leftCell = collectionView.cellForItemAtIndexPath(NSIndexPath(forRow: currentIndex - 1, inSection: 0)) {
let step = leftCell.frame.size.width + (leftCell.frame.origin.x - collectionView.contentOffset.x)
UIView.animateWithDuration(0.2, animations: {
leftCell.center.x -= step
})
self.leftCell = leftCell
self.step = step
}
if let rightCell = collectionView.cellForItemAtIndexPath(NSIndexPath(forRow: currentIndex + 1, inSection: 0)) {
let step = collectionView.frame.size.width - (rightCell.frame.origin.x - collectionView.contentOffset.x)
UIView.animateWithDuration(0.2, animations: {
rightCell.center.x += step
})
self.rightCell = rightCell
self.step = step
}
}
}
// MARK: animations
extension TransitionDriver {
private func openFrontViewConfigureConstraints(cell: BasePageCollectionCell, height: CGFloat) {
if let heightConstraint = cell.frontContainerView.getConstraint(.Height) {
frontViewFrame.size.height = heightConstraint.constant
heightConstraint.constant = height
}
if let widthConstraint = cell.frontContainerView.getConstraint(.Width) {
frontViewFrame.size.width = widthConstraint.constant
widthConstraint.constant = view.bounds.size.width
}
frontViewFrame.origin.y = cell.frontConstraintY.constant
cell.frontConstraintY.constant = -view.bounds.size.height / 2 + height / 2
}
private func openBackViewConfigureConstraints(cell: BasePageCollectionCell, height: CGFloat) {
if let heightConstraint = cell.backContainerView.getConstraint(.Height) {
backViewFrame.size.height = heightConstraint.constant
heightConstraint.constant = view.bounds.size.height - height
}
if let widthConstraint = cell.backContainerView.getConstraint(.Width) {
backViewFrame.size.width = widthConstraint.constant
widthConstraint.constant = view.bounds.size.width
}
backViewFrame.origin.y = cell.backConstraintY.constant
cell.backConstraintY.constant = view.bounds.size.height / 2 - (view.bounds.size.height - 236) / 2
}
private func closeBackViewConfigurationConstraints(cell: BasePageCollectionCell?) {
guard let cell = cell else { return }
let heightConstraint = cell.backContainerView.getConstraint(.Height)
heightConstraint?.constant = backViewFrame.size.height
let widthConstraint = cell.backContainerView.getConstraint(.Width)
widthConstraint?.constant = backViewFrame.size.width
cell.backConstraintY.constant = backViewFrame.origin.y
}
private func closeFrontViewConfigurationConstraints(cell: BasePageCollectionCell?) {
guard let cell = cell else { return }
if let heightConstraint = cell.frontContainerView.getConstraint(.Height) {
heightConstraint.constant = frontViewFrame.size.height
}
if let widthConstraint = cell.frontContainerView.getConstraint(.Width) {
widthConstraint.constant = frontViewFrame.size.width
}
cell.frontConstraintY.constant = frontViewFrame.origin.y
}
private func configureCellBeforeClose(cell: BasePageCollectionCell, offset: CGFloat) {
cell.frontConstraintY.constant -= offset
cell.backConstraintY.constant -= offset / 2.0
if let heightConstraint = cell.backContainerView.getConstraint(.Height) {
heightConstraint.constant += offset
}
cell.contentView.layoutIfNeeded()
}
}
+12
View File
@@ -0,0 +1,12 @@
Pod::Spec.new do |s|
s.name = 'expanding-collection'
s.version = '0.0.1'
s.summary = 'Transition animtion from CollectionView to TableView'
s.license = 'MIT'
s.homepage = 'https://github.com/Ramotion/expanding-collection'
s.author = { 'Juri Vasylenko' => 'juri.v@ramotion.com' }
s.ios.deployment_target = '8.0'
s.source = { :git => 'https://github.com/Ramotion/expanding-collection.git', :tag => s.version.to_s }
s.source_files = 'Source/**/*.swift'
s.requires_arc = true
end
-217
View File
@@ -1,217 +0,0 @@
<!DOCTYPE html>
<html lang="en-us">
<head>
<meta charset="UTF-8">
<title>Expanding-collection by Ramotion</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="stylesheets/normalize.css" media="screen">
<link href='https://fonts.googleapis.com/css?family=Open+Sans:400,700' rel='stylesheet' type='text/css'>
<link rel="stylesheet" type="text/css" href="stylesheets/stylesheet.css" media="screen">
<link rel="stylesheet" type="text/css" href="stylesheets/github-light.css" media="screen">
</head>
<body>
<section class="page-header">
<h1 class="project-name">Expanding-collection</h1>
<h2 class="project-tagline">ExpandingCollection is a card peek/pop controller</h2>
<a href="https://github.com/Ramotion/expanding-collection" class="btn">View on GitHub</a>
<a href="https://github.com/Ramotion/expanding-collection/zipball/master" class="btn">Download .zip</a>
<a href="https://github.com/Ramotion/expanding-collection/tarball/master" class="btn">Download .tar.gz</a>
</section>
<section class="main-content">
<p><a href="https://business.ramotion.com?utm_source=gthb&amp;utm_medium=special&amp;utm_campaign=expanding-collection-logo"><img src="https://raw.githubusercontent.com/Ramotion/expanding-collection/master/header.png" alt="header"></a></p>
<h1>
<a id="expanding-collection" class="anchor" href="#expanding-collection" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>expanding-collection</h1>
<p><a href="http://twitter.com/Ramotion"><img src="https://img.shields.io/badge/Twitter-@Ramotion-blue.svg?style=flat" alt="Twitter"></a>
<a href="https://cocoapods.org/pods/expanding-collection"><img src="https://img.shields.io/cocoapods/p/expanding-collection.svg" alt="CocoaPods"></a>
<a href="http://cocoapods.org/pods/expanding-collection"><img src="https://img.shields.io/cocoapods/v/expanding-collection.svg" alt="CocoaPods"></a>
<a href="https://cdn.rawgit.com/Ramotion/expanding-collection/master/docs/index.html"><img src="https://img.shields.io/cocoapods/metrics/doc-percent/expanding-collection.svg" alt="CocoaPods"></a></p>
<p><a href="https://github.com/Ramotion/expanding-collection"><img src="https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat" alt="Carthage compatible"></a>
<a href="https://travis-ci.org/Ramotion/expanding-collection"><img src="https://travis-ci.org/Ramotion/expanding-collection.svg?branch=master" alt="Travis"></a>
<a href="https://codebeat.co/projects/github-com-ramotion-expanding-collection"><img src="https://codebeat.co/badges/6a009992-5bf2-4730-aa35-f3b20ce7693d" alt="codebeat badge"></a></p>
<h2>
<a id="about" class="anchor" href="#about" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>About</h2>
<p>This project is maintained by Ramotion, Inc.<br>
We specialize in the designing and coding of custom UI for Mobile Apps and Websites.<br><br><strong>Looking for developers for your project?</strong> [<a href="http://business.ramotion.com?utm_source=gthb&amp;utm_medium=special&amp;utm_campaign=expanding-collection-contact-us/#Get_in_Touch">▶︎CONTACT OUR TEAM◀︎</a>]</p>
<p><a href="https://dribbble.com/shots/2741477-iOS-Expanding-Collection-Open-Source"><img src="https://raw.githubusercontent.com/Ramotion/expanding-collection/master/preview.gif" alt="Animation"></a></p>
<p>The <a href="https://store.ramotion.com/product/iphone-6-mockups?utm_source=gthb&amp;utm_medium=special&amp;utm_campaign=expanding-collection">iPhone mockup</a> available <a href="https://store.ramotion.com/product/iphone-6-mockups?utm_source=gthb&amp;utm_medium=special&amp;utm_campaign=expanding-collection">here</a>.</p>
<h2>
<a id="requirements" class="anchor" href="#requirements" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Requirements</h2>
<ul>
<li>iOS 9.0+</li>
<li>Xcode 8</li>
</ul>
<h2>
<a id="installation" class="anchor" href="#installation" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Installation</h2>
<p>Just add the Source folder to your project.</p>
<p>or use <a href="https://cocoapods.org">CocoaPods</a> with Podfile:</p>
<div class="highlight highlight-source-ruby"><pre>pod <span class="pl-s"><span class="pl-pds">'</span>expanding-collection<span class="pl-pds">'</span></span>, <span class="pl-s"><span class="pl-pds">'</span>~&gt; 1.0.3<span class="pl-pds">'</span></span> swift <span class="pl-c1">3</span>
pod <span class="pl-s"><span class="pl-pds">'</span>expanding-collection<span class="pl-pds">'</span></span>, <span class="pl-s"><span class="pl-pds">'</span>~&gt; 0.3.2<span class="pl-pds">'</span></span> swift <span class="pl-c1">2</span></pre></div>
<p>or <a href="https://github.com/Carthage/Carthage">Carthage</a> users can simply add to their <code>Cartfile</code>:</p>
<pre><code>github "Ramotion/expanding-collection"
</code></pre>
<h2>
<a id="usage" class="anchor" href="#usage" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Usage</h2>
<div class="highlight highlight-source-swift"><pre><span class="pl-k">import</span> <span class="pl-c1">expanding_collection</span></pre></div>
<h4>
<a id="create-collectionviewcell" class="anchor" href="#create-collectionviewcell" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Create CollectionViewCell</h4>
<p><img src="https://raw.githubusercontent.com/Ramotion/expanding-collection/master/images/image2.png" alt="cell"></p>
<p>1) Create UICollectionViewCell inherit from <code>BasePageCollectionCell</code> (recommend create cell with xib file)</p>
<p>2) Adding FrontView</p>
<ul>
<li>add a view to YOURCELL.xib and connect it to <code>@IBOutlet weak var frontContainerView: UIView!</code><br>
</li>
<li>
<p>add width, height, centerX and centerY constraints (width and height constranints must equal cellSize)</p>
<p><img src="https://raw.githubusercontent.com/Ramotion/expanding-collection/master/images/image1.png" alt="cell"> </p>
</li>
<li>connect centerY constraint to <code>@IBOutlet weak var frontConstraintY: NSLayoutConstraint!</code>
</li>
<li>add any desired uiviews to frontView</li>
</ul>
<p>3) Adding BackView</p>
<ul>
<li>repeat step 2 (connect outlets to <code>@IBOutlet weak var backContainerView: UIView!</code>, <code>@IBOutlet weak var backConstraintY: NSLayoutConstraint!</code>)</li>
</ul>
<p>4) Cell example <a href="https://github.com/Ramotion/expanding-collection/tree/master/DemoExpandingCollection/DemoExpandingCollection/ViewControllers/DemoViewController/Cells">DemoCell</a></p>
<h6>
<a id="if-set-tag--101-for-any-frontviewsubviews-this-view-will-be-hidden-during-the-transition-animation" class="anchor" href="#if-set-tag--101-for-any-frontviewsubviews-this-view-will-be-hidden-during-the-transition-animation" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>If set <code>tag = 101</code> for any <code>FrontView.subviews</code> this view will be hidden during the transition animation</h6>
<h4>
<a id="create-collectionviewcontroller" class="anchor" href="#create-collectionviewcontroller" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Create CollectionViewController</h4>
<p>1) Create a UIViewController inheriting from <code>ExpandingViewController</code></p>
<p>2) Register Cell and set Cell size:</p>
<div class="highlight highlight-source-swift"><pre><span class="pl-k">override</span> <span class="pl-k">func</span> <span class="pl-en">viewDidLoad</span>() {
itemSize <span class="pl-k">=</span> CGSize(width: <span class="pl-c1">214</span>, height: <span class="pl-c1">264</span>)
<span class="pl-k">super</span><span class="pl-k">.</span>viewDidLoad()
<span class="pl-c">// register cell</span>
<span class="pl-k">let</span> nib <span class="pl-k">=</span> UINib(nibName: <span class="pl-s"><span class="pl-pds">"</span>NibName<span class="pl-pds">"</span></span>, bundle: <span class="pl-c1">nil</span>)
collectionView?<span class="pl-k">.</span>registerNib(nib, forCellWithReuseIdentifier: <span class="pl-s"><span class="pl-pds">"</span>CellIdentifier<span class="pl-pds">"</span></span>)
}</pre></div>
<p>3) Add UICollectionViewDataSource methods</p>
<div class="highlight highlight-source-swift"><pre><span class="pl-k">extension</span> YourViewController {
<span class="pl-k">override</span> <span class="pl-k">func</span> <span class="pl-en">collectionView</span>(collectionView: UICollectionView, <span class="pl-en">numberOfItemsInSection</span> <span class="pl-smi">section</span>: <span class="pl-c1">Int</span>) <span class="pl-k">-&gt;</span> <span class="pl-c1">Int</span> {
<span class="pl-k">return</span> items<span class="pl-k">.</span><span class="pl-c1">count</span>
}
<span class="pl-k">override</span> <span class="pl-k">func</span> <span class="pl-en">collectionView</span>(collectionView: UICollectionView, <span class="pl-en">cellForItemAtIndexPath</span> <span class="pl-smi">indexPath</span>: NSIndexPath) <span class="pl-k">-&gt;</span> UICollectionViewCell {
<span class="pl-k">let</span> cell <span class="pl-k">=</span> collectionView<span class="pl-k">.</span>dequeueReusableCellWithReuseIdentifier(<span class="pl-s"><span class="pl-pds">"</span>CellIdentifier<span class="pl-pds">"</span></span>), forIndexPath: indexPath)
<span class="pl-c">// configure cell</span>
<span class="pl-k">return</span> cell
}
}</pre></div>
<p>4) Open Cell animation</p>
<div class="highlight highlight-source-swift"><pre><span class="pl-k">override</span> <span class="pl-k">func</span> <span class="pl-en">viewDidLoad</span>() {
itemSize <span class="pl-k">=</span> CGSize(width: <span class="pl-c1">214</span>, height: <span class="pl-c1">264</span>)
<span class="pl-k">super</span><span class="pl-k">.</span>viewDidLoad()
<span class="pl-c">// register cell</span>
<span class="pl-k">let</span> nib <span class="pl-k">=</span> UINib(nibName: <span class="pl-s"><span class="pl-pds">"</span>CellIdentifier<span class="pl-pds">"</span></span>, bundle: <span class="pl-c1">nil</span>)
collectionView?<span class="pl-k">.</span>registerNib(nib, forCellWithReuseIdentifier: <span class="pl-c1">String</span>(DemoCollectionViewCell))
}</pre></div>
<div class="highlight highlight-source-swift"><pre><span class="pl-k">func</span> <span class="pl-en">collectionView</span>(collectionView: UICollectionView, <span class="pl-en">didSelectItemAtIndexPath</span> <span class="pl-smi">indexPath</span>: NSIndexPath) {
cell<span class="pl-k">.</span>cellIsOpen(<span class="pl-k">!</span>cell<span class="pl-k">.</span>isOpened)
}</pre></div>
<h6>
<a id="if-you-use-this-delegates-method" class="anchor" href="#if-you-use-this-delegates-method" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>if you use this delegates method:</h6>
<div class="highlight highlight-source-swift"><pre><span class="pl-k">func</span> <span class="pl-en">collectionView</span>(collectionView: UICollectionView, <span class="pl-en">willDisplayCell</span> <span class="pl-smi">cell</span>: UICollectionViewCell, <span class="pl-en">forItemAtIndexPath</span> <span class="pl-smi">indexPath</span>: NSIndexPath)
<span class="pl-k">func</span> <span class="pl-en">scrollViewDidEndDecelerating</span>(scrollView: UIScrollView)</pre></div>
<h6>
<a id="must-call-super-method" class="anchor" href="#must-call-super-method" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>must call super method:</h6>
<div class="highlight highlight-source-swift"><pre><span class="pl-k">func</span> <span class="pl-en">collectionView</span>(collectionView: UICollectionView, <span class="pl-en">willDisplayCell</span> <span class="pl-smi">cell</span>: UICollectionViewCell, <span class="pl-en">forItemAtIndexPath</span> <span class="pl-smi">indexPath</span>: NSIndexPath) {
<span class="pl-k">super</span><span class="pl-k">.</span>collectionView(collectionView: collectionView, willDisplayCell cell: cell, forItemAtIndexPath indexPath: indexPath)
<span class="pl-c">// code</span>
}
<span class="pl-k">func</span> <span class="pl-en">scrollViewDidEndDecelerating</span>(scrollView: UIScrollView) {
<span class="pl-k">super</span><span class="pl-k">.</span>scrollViewDidEndDecelerating(scrollView: scrollView)
<span class="pl-c">// code</span>
}</pre></div>
<h4>
<a id="transition-animation" class="anchor" href="#transition-animation" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Transition animation</h4>
<p>1) Create a UITableViewController inheriting from <code>ExpandingTableViewController</code></p>
<p>2) Set header height default 236</p>
<div class="highlight highlight-source-swift"><pre><span class="pl-k">override</span> <span class="pl-k">func</span> <span class="pl-en">viewDidLoad</span>() {
<span class="pl-k">super</span><span class="pl-k">.</span>viewDidLoad()
headerHeight <span class="pl-k">=</span> <span class="pl-k">***</span>
} </pre></div>
<p>3) Call the push method in YourViewController to YourTableViewController</p>
<div class="highlight highlight-source-swift"><pre> <span class="pl-k">if</span> cell<span class="pl-k">.</span>isOpened <span class="pl-k">==</span> <span class="pl-c1">true</span> {
<span class="pl-k">let</span> vc: YourTableViewController <span class="pl-k">=</span> <span class="pl-c">// ... create view controller </span>
pushToViewController(vc)
}</pre></div>
<p>4) For back transition use <code>popTransitionAnimation()</code></p>
<h2>
<a id="license" class="anchor" href="#license" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>License</h2>
<p>Expanding collection is released under the MIT license.
See <a href="./LICENSE">LICENSE</a> for details.</p>
<h2>
<a id="follow-us" class="anchor" href="#follow-us" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Follow us</h2>
<p><a href="https://twitter.com/intent/tweet?text=https://github.com/ramotion/expanding-collection"><img src="https://img.shields.io/twitter/url/http/shields.io.svg?style=social" alt="Twitter URL"></a>
<a href="https://twitter.com/ramotion"><img src="https://img.shields.io/twitter/follow/ramotion.svg?style=social" alt="Twitter Follow"></a></p>
<footer class="site-footer">
<span class="site-footer-owner"><a href="https://github.com/Ramotion/expanding-collection">Expanding-collection</a> is maintained by <a href="https://github.com/Ramotion">Ramotion</a>.</span>
<span class="site-footer-credits">This page was generated by <a href="https://pages.github.com">GitHub Pages</a> using the <a href="https://github.com/jasonlong/cayman-theme">Cayman theme</a> by <a href="https://twitter.com/jasonlong">Jason Long</a>.</span>
</footer>
</section>
</body>
</html>
-6
View File
File diff suppressed because one or more lines are too long
-124
View File
@@ -1,124 +0,0 @@
/*
The MIT License (MIT)
Copyright (c) 2016 GitHub, Inc.
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.
*/
.pl-c /* comment */ {
color: #969896;
}
.pl-c1 /* constant, variable.other.constant, support, meta.property-name, support.constant, support.variable, meta.module-reference, markup.raw, meta.diff.header */,
.pl-s .pl-v /* string variable */ {
color: #0086b3;
}
.pl-e /* entity */,
.pl-en /* entity.name */ {
color: #795da3;
}
.pl-smi /* variable.parameter.function, storage.modifier.package, storage.modifier.import, storage.type.java, variable.other */,
.pl-s .pl-s1 /* string source */ {
color: #333;
}
.pl-ent /* entity.name.tag */ {
color: #63a35c;
}
.pl-k /* keyword, storage, storage.type */ {
color: #a71d5d;
}
.pl-s /* string */,
.pl-pds /* punctuation.definition.string, string.regexp.character-class */,
.pl-s .pl-pse .pl-s1 /* string punctuation.section.embedded source */,
.pl-sr /* string.regexp */,
.pl-sr .pl-cce /* string.regexp constant.character.escape */,
.pl-sr .pl-sre /* string.regexp source.ruby.embedded */,
.pl-sr .pl-sra /* string.regexp string.regexp.arbitrary-repitition */ {
color: #183691;
}
.pl-v /* variable */ {
color: #ed6a43;
}
.pl-id /* invalid.deprecated */ {
color: #b52a1d;
}
.pl-ii /* invalid.illegal */ {
color: #f8f8f8;
background-color: #b52a1d;
}
.pl-sr .pl-cce /* string.regexp constant.character.escape */ {
font-weight: bold;
color: #63a35c;
}
.pl-ml /* markup.list */ {
color: #693a17;
}
.pl-mh /* markup.heading */,
.pl-mh .pl-en /* markup.heading entity.name */,
.pl-ms /* meta.separator */ {
font-weight: bold;
color: #1d3e81;
}
.pl-mq /* markup.quote */ {
color: #008080;
}
.pl-mi /* markup.italic */ {
font-style: italic;
color: #333;
}
.pl-mb /* markup.bold */ {
font-weight: bold;
color: #333;
}
.pl-md /* markup.deleted, meta.diff.header.from-file */ {
color: #bd2c00;
background-color: #ffecec;
}
.pl-mi1 /* markup.inserted, meta.diff.header.to-file */ {
color: #55a532;
background-color: #eaffea;
}
.pl-mdr /* meta.diff.range */ {
font-weight: bold;
color: #795da3;
}
.pl-mo /* meta.output */ {
color: #1d3e81;
}
-424
View File
@@ -1,424 +0,0 @@
/*! normalize.css v3.0.2 | MIT License | git.io/normalize */
/**
* 1. Set default font family to sans-serif.
* 2. Prevent iOS text size adjust after orientation change, without disabling
* user zoom.
*/
html {
font-family: sans-serif; /* 1 */
-ms-text-size-adjust: 100%; /* 2 */
-webkit-text-size-adjust: 100%; /* 2 */
}
/**
* Remove default margin.
*/
body {
margin: 0;
}
/* HTML5 display definitions
========================================================================== */
/**
* Correct `block` display not defined for any HTML5 element in IE 8/9.
* Correct `block` display not defined for `details` or `summary` in IE 10/11
* and Firefox.
* Correct `block` display not defined for `main` in IE 11.
*/
article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
main,
menu,
nav,
section,
summary {
display: block;
}
/**
* 1. Correct `inline-block` display not defined in IE 8/9.
* 2. Normalize vertical alignment of `progress` in Chrome, Firefox, and Opera.
*/
audio,
canvas,
progress,
video {
display: inline-block; /* 1 */
vertical-align: baseline; /* 2 */
}
/**
* Prevent modern browsers from displaying `audio` without controls.
* Remove excess height in iOS 5 devices.
*/
audio:not([controls]) {
display: none;
height: 0;
}
/**
* Address `[hidden]` styling not present in IE 8/9/10.
* Hide the `template` element in IE 8/9/11, Safari, and Firefox < 22.
*/
[hidden],
template {
display: none;
}
/* Links
========================================================================== */
/**
* Remove the gray background color from active links in IE 10.
*/
a {
background-color: transparent;
}
/**
* Improve readability when focused and also mouse hovered in all browsers.
*/
a:active,
a:hover {
outline: 0;
}
/* Text-level semantics
========================================================================== */
/**
* Address styling not present in IE 8/9/10/11, Safari, and Chrome.
*/
abbr[title] {
border-bottom: 1px dotted;
}
/**
* Address style set to `bolder` in Firefox 4+, Safari, and Chrome.
*/
b,
strong {
font-weight: bold;
}
/**
* Address styling not present in Safari and Chrome.
*/
dfn {
font-style: italic;
}
/**
* Address variable `h1` font-size and margin within `section` and `article`
* contexts in Firefox 4+, Safari, and Chrome.
*/
h1 {
font-size: 2em;
margin: 0.67em 0;
}
/**
* Address styling not present in IE 8/9.
*/
mark {
background: #ff0;
color: #000;
}
/**
* Address inconsistent and variable font size in all browsers.
*/
small {
font-size: 80%;
}
/**
* Prevent `sub` and `sup` affecting `line-height` in all browsers.
*/
sub,
sup {
font-size: 75%;
line-height: 0;
position: relative;
vertical-align: baseline;
}
sup {
top: -0.5em;
}
sub {
bottom: -0.25em;
}
/* Embedded content
========================================================================== */
/**
* Remove border when inside `a` element in IE 8/9/10.
*/
img {
border: 0;
}
/**
* Correct overflow not hidden in IE 9/10/11.
*/
svg:not(:root) {
overflow: hidden;
}
/* Grouping content
========================================================================== */
/**
* Address margin not present in IE 8/9 and Safari.
*/
figure {
margin: 1em 40px;
}
/**
* Address differences between Firefox and other browsers.
*/
hr {
box-sizing: content-box;
height: 0;
}
/**
* Contain overflow in all browsers.
*/
pre {
overflow: auto;
}
/**
* Address odd `em`-unit font size rendering in all browsers.
*/
code,
kbd,
pre,
samp {
font-family: monospace, monospace;
font-size: 1em;
}
/* Forms
========================================================================== */
/**
* Known limitation: by default, Chrome and Safari on OS X allow very limited
* styling of `select`, unless a `border` property is set.
*/
/**
* 1. Correct color not being inherited.
* Known issue: affects color of disabled elements.
* 2. Correct font properties not being inherited.
* 3. Address margins set differently in Firefox 4+, Safari, and Chrome.
*/
button,
input,
optgroup,
select,
textarea {
color: inherit; /* 1 */
font: inherit; /* 2 */
margin: 0; /* 3 */
}
/**
* Address `overflow` set to `hidden` in IE 8/9/10/11.
*/
button {
overflow: visible;
}
/**
* Address inconsistent `text-transform` inheritance for `button` and `select`.
* All other form control elements do not inherit `text-transform` values.
* Correct `button` style inheritance in Firefox, IE 8/9/10/11, and Opera.
* Correct `select` style inheritance in Firefox.
*/
button,
select {
text-transform: none;
}
/**
* 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio`
* and `video` controls.
* 2. Correct inability to style clickable `input` types in iOS.
* 3. Improve usability and consistency of cursor style between image-type
* `input` and others.
*/
button,
html input[type="button"], /* 1 */
input[type="reset"],
input[type="submit"] {
-webkit-appearance: button; /* 2 */
cursor: pointer; /* 3 */
}
/**
* Re-set default cursor for disabled elements.
*/
button[disabled],
html input[disabled] {
cursor: default;
}
/**
* Remove inner padding and border in Firefox 4+.
*/
button::-moz-focus-inner,
input::-moz-focus-inner {
border: 0;
padding: 0;
}
/**
* Address Firefox 4+ setting `line-height` on `input` using `!important` in
* the UA stylesheet.
*/
input {
line-height: normal;
}
/**
* It's recommended that you don't attempt to style these elements.
* Firefox's implementation doesn't respect box-sizing, padding, or width.
*
* 1. Address box sizing set to `content-box` in IE 8/9/10.
* 2. Remove excess padding in IE 8/9/10.
*/
input[type="checkbox"],
input[type="radio"] {
box-sizing: border-box; /* 1 */
padding: 0; /* 2 */
}
/**
* Fix the cursor style for Chrome's increment/decrement buttons. For certain
* `font-size` values of the `input`, it causes the cursor style of the
* decrement button to change from `default` to `text`.
*/
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
height: auto;
}
/**
* 1. Address `appearance` set to `searchfield` in Safari and Chrome.
* 2. Address `box-sizing` set to `border-box` in Safari and Chrome
* (include `-moz` to future-proof).
*/
input[type="search"] {
-webkit-appearance: textfield; /* 1 */ /* 2 */
box-sizing: content-box;
}
/**
* Remove inner padding and search cancel button in Safari and Chrome on OS X.
* Safari (but not Chrome) clips the cancel button when the search input has
* padding (and `textfield` appearance).
*/
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration {
-webkit-appearance: none;
}
/**
* Define consistent border, margin, and padding.
*/
fieldset {
border: 1px solid #c0c0c0;
margin: 0 2px;
padding: 0.35em 0.625em 0.75em;
}
/**
* 1. Correct `color` not being inherited in IE 8/9/10/11.
* 2. Remove padding so people aren't caught out if they zero out fieldsets.
*/
legend {
border: 0; /* 1 */
padding: 0; /* 2 */
}
/**
* Remove default vertical scrollbar in IE 8/9/10/11.
*/
textarea {
overflow: auto;
}
/**
* Don't inherit the `font-weight` (applied by a rule above).
* NOTE: the default cannot safely be changed in Chrome and Safari on OS X.
*/
optgroup {
font-weight: bold;
}
/* Tables
========================================================================== */
/**
* Remove most spacing between table cells.
*/
table {
border-collapse: collapse;
border-spacing: 0;
}
td,
th {
padding: 0;
}
-245
View File
@@ -1,245 +0,0 @@
* {
box-sizing: border-box; }
body {
padding: 0;
margin: 0;
font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 16px;
line-height: 1.5;
color: #606c71; }
a {
color: #1e6bb8;
text-decoration: none; }
a:hover {
text-decoration: underline; }
.btn {
display: inline-block;
margin-bottom: 1rem;
color: rgba(255, 255, 255, 0.7);
background-color: rgba(255, 255, 255, 0.08);
border-color: rgba(255, 255, 255, 0.2);
border-style: solid;
border-width: 1px;
border-radius: 0.3rem;
transition: color 0.2s, background-color 0.2s, border-color 0.2s; }
.btn + .btn {
margin-left: 1rem; }
.btn:hover {
color: rgba(255, 255, 255, 0.8);
text-decoration: none;
background-color: rgba(255, 255, 255, 0.2);
border-color: rgba(255, 255, 255, 0.3); }
@media screen and (min-width: 64em) {
.btn {
padding: 0.75rem 1rem; } }
@media screen and (min-width: 42em) and (max-width: 64em) {
.btn {
padding: 0.6rem 0.9rem;
font-size: 0.9rem; } }
@media screen and (max-width: 42em) {
.btn {
display: block;
width: 100%;
padding: 0.75rem;
font-size: 0.9rem; }
.btn + .btn {
margin-top: 1rem;
margin-left: 0; } }
.page-header {
color: #fff;
text-align: center;
background-color: #159957;
background-image: linear-gradient(120deg, #155799, #159957); }
@media screen and (min-width: 64em) {
.page-header {
padding: 5rem 6rem; } }
@media screen and (min-width: 42em) and (max-width: 64em) {
.page-header {
padding: 3rem 4rem; } }
@media screen and (max-width: 42em) {
.page-header {
padding: 2rem 1rem; } }
.project-name {
margin-top: 0;
margin-bottom: 0.1rem; }
@media screen and (min-width: 64em) {
.project-name {
font-size: 3.25rem; } }
@media screen and (min-width: 42em) and (max-width: 64em) {
.project-name {
font-size: 2.25rem; } }
@media screen and (max-width: 42em) {
.project-name {
font-size: 1.75rem; } }
.project-tagline {
margin-bottom: 2rem;
font-weight: normal;
opacity: 0.7; }
@media screen and (min-width: 64em) {
.project-tagline {
font-size: 1.25rem; } }
@media screen and (min-width: 42em) and (max-width: 64em) {
.project-tagline {
font-size: 1.15rem; } }
@media screen and (max-width: 42em) {
.project-tagline {
font-size: 1rem; } }
.main-content :first-child {
margin-top: 0; }
.main-content img {
max-width: 100%; }
.main-content h1, .main-content h2, .main-content h3, .main-content h4, .main-content h5, .main-content h6 {
margin-top: 2rem;
margin-bottom: 1rem;
font-weight: normal;
color: #159957; }
.main-content p {
margin-bottom: 1em; }
.main-content code {
padding: 2px 4px;
font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace;
font-size: 0.9rem;
color: #383e41;
background-color: #f3f6fa;
border-radius: 0.3rem; }
.main-content pre {
padding: 0.8rem;
margin-top: 0;
margin-bottom: 1rem;
font: 1rem Consolas, "Liberation Mono", Menlo, Courier, monospace;
color: #567482;
word-wrap: normal;
background-color: #f3f6fa;
border: solid 1px #dce6f0;
border-radius: 0.3rem; }
.main-content pre > code {
padding: 0;
margin: 0;
font-size: 0.9rem;
color: #567482;
word-break: normal;
white-space: pre;
background: transparent;
border: 0; }
.main-content .highlight {
margin-bottom: 1rem; }
.main-content .highlight pre {
margin-bottom: 0;
word-break: normal; }
.main-content .highlight pre, .main-content pre {
padding: 0.8rem;
overflow: auto;
font-size: 0.9rem;
line-height: 1.45;
border-radius: 0.3rem; }
.main-content pre code, .main-content pre tt {
display: inline;
max-width: initial;
padding: 0;
margin: 0;
overflow: initial;
line-height: inherit;
word-wrap: normal;
background-color: transparent;
border: 0; }
.main-content pre code:before, .main-content pre code:after, .main-content pre tt:before, .main-content pre tt:after {
content: normal; }
.main-content ul, .main-content ol {
margin-top: 0; }
.main-content blockquote {
padding: 0 1rem;
margin-left: 0;
color: #819198;
border-left: 0.3rem solid #dce6f0; }
.main-content blockquote > :first-child {
margin-top: 0; }
.main-content blockquote > :last-child {
margin-bottom: 0; }
.main-content table {
display: block;
width: 100%;
overflow: auto;
word-break: normal;
word-break: keep-all; }
.main-content table th {
font-weight: bold; }
.main-content table th, .main-content table td {
padding: 0.5rem 1rem;
border: 1px solid #e9ebec; }
.main-content dl {
padding: 0; }
.main-content dl dt {
padding: 0;
margin-top: 1rem;
font-size: 1rem;
font-weight: bold; }
.main-content dl dd {
padding: 0;
margin-bottom: 1rem; }
.main-content hr {
height: 2px;
padding: 0;
margin: 1rem 0;
background-color: #eff0f1;
border: 0; }
@media screen and (min-width: 64em) {
.main-content {
max-width: 64rem;
padding: 2rem 6rem;
margin: 0 auto;
font-size: 1.1rem; } }
@media screen and (min-width: 42em) and (max-width: 64em) {
.main-content {
padding: 2rem 4rem;
font-size: 1.1rem; } }
@media screen and (max-width: 42em) {
.main-content {
padding: 2rem 1rem;
font-size: 1rem; } }
.site-footer {
padding-top: 2rem;
margin-top: 2rem;
border-top: solid 1px #eff0f1; }
.site-footer-owner {
display: block;
font-weight: bold; }
.site-footer-credits {
color: #819198; }
@media screen and (min-width: 64em) {
.site-footer {
font-size: 1rem; } }
@media screen and (min-width: 42em) and (max-width: 64em) {
.site-footer {
font-size: 1rem; } }
@media screen and (max-width: 42em) {
.site-footer {
font-size: 0.9rem; } }