Compare commits

..
31 Commits
Author SHA1 Message Date
Alex.k e720eaf3f3 common improves 2016-02-04 17:07:20 +03:00
Alex 4c3d646349 Update .travis.yml 2016-02-03 15:41:06 +03:00
Alex.k 4d41164378 changed version 2016-02-03 14:14:27 +03:00
Alex.k aa490544c2 improve isAnimating method 2016-02-03 10:24:43 +03:00
Juri Vasylenko 835ff54cbb Update README.md 2016-02-01 12:12:31 +03:00
Alex f65b92ffdf Merge pull request #1 from Ramotion/docs_update
Docs update
2016-02-01 11:22:42 +03:00
Juri Vasylenko c6d63eb1e4 Update README.md 2016-02-01 11:19:07 +03:00
Juri Vasylenko fa758c23a3 add contributing guide, add badges and update docs 2016-02-01 11:14:28 +03:00
Alex.k 163f297fe9 change travis 2016-01-25 15:51:14 +03:00
Alex 93a228b087 Update .travis.yml 2016-01-25 15:38:18 +03:00
Alex.k b0f92dbe6b Merge branch 'develop' 2016-01-25 15:26:02 +03:00
Alex.k 8d5eff7bfc added unit test 2016-01-25 15:25:42 +03:00
Alex.k 00eee3a352 shared shame 2016-01-25 14:42:49 +03:00
Alex.k 840cc0a1a3 Merge branch 'develop' 2016-01-25 14:38:40 +03:00
Alex.k 7d18125ed5 added travis file 2016-01-25 14:37:52 +03:00
Alex.k a2226608b1 added unit tests 2016-01-25 14:21:44 +03:00
Alex bc0fda8abb Update README.md 2016-01-18 16:41:23 +03:00
Alex 3bfd692759 Update README.md 2016-01-18 16:36:00 +03:00
Alex 230c28ad5e Update README.md 2016-01-18 16:34:05 +03:00
Alex ac1c852b6c Update FoldingCell.podspec 2016-01-14 09:58:00 +03:00
Alex.k 7dc02ae65f Merge branch 'master' into develop 2016-01-13 10:28:38 +03:00
Alex ab4b6f97a4 Update README.md 2016-01-12 16:36:36 +03:00
Alex 8961b01a9a update pod spec 2016-01-12 16:27:38 +03:00
Alex 7922cda3b4 Merge branch 'develop' 2016-01-12 16:22:19 +03:00
Alex 69624db27e small fixed 2016-01-12 16:21:50 +03:00
Alex e4f3ca0679 Update README.md 2016-01-12 16:17:02 +03:00
Alex 5f123c4959 Update README.md 2016-01-12 16:08:38 +03:00
Alex.k a230b36692 Merge branch 'master' of https://github.com/Ramotion/folding-cell 2016-01-12 13:51:31 +03:00
Alex.k 53e9769d0f small fixed 2016-01-12 13:51:14 +03:00
Alex fdf5c80e3b Update README.md 2016-01-12 13:13:36 +03:00
Alex 205858f47a Update FoldingCell.podspec 2016-01-12 13:05:18 +03:00
13 changed files with 458 additions and 214 deletions
+6
View File
@@ -0,0 +1,6 @@
osx_image: xcode7.2
language: objective-c
xcode_project: FoldingCell/FoldingCell.xcodeproj
xcode_scheme: FoldingCell
xcode_sdk: iphonesimulator
View File
+33
View File
@@ -0,0 +1,33 @@
# Contributing to a Project
Now that you’ve found the material for understanding the project, here is how you can take action.
### Create an Issue
If you find a bug in a project you’re using (and you don’t know how to fix it), have trouble following the documentation or have a question about the project – create an issue! There’s nothing to it and whatever issue you’re having, you’re likely not the only one, so others will find your issue helpful, too. For more information on how issues work, check out our Issues guide.
#### Issues Pro Tips
Check existing issues for your issue. Duplicating an issue is slower for both parties so search through open and closed issues to see if what you’re running into has been addressed already.
Be clear about what your problem is: what was the expected outcome, what happened instead? Detail how someone else can recreate the problem.
Link to demos recreating the problem on things like JSFiddle or CodePen.
Include system details like what the browser, library or operating system you’re using and its version.
Paste error output or logs in your issue or in a Gist. If pasting them in the issue, wrap it in three backticks: ``` so that it renders nicely.
### Pull Request
If you’re able to patch the bug or add the feature yourself – fantastic, make a pull request with the code! Be sure you’ve read any documents on contributing, understand the license and have signed a CLA if required. Once you’ve submitted a pull request the maintainer(s) can compare your branch to the existing one and decide whether or not to incorporate (pull in) your changes.
#### Pull Request Pro Tips
Fork the repository and clone it locally. Connect your local to the original ‘upstream’ repository by adding it as a remote. Pull in changes from ‘upstream’ often so that you stay up to date so that when you submit your pull request, merge conflicts will be less likely. See more detailed instructions here.
Create a branch for your edits.
Be clear about what problem is occurring and how someone can recreate that problem or why your feature will help. Then be equally as clear about the steps you took to make your changes.
It’s best to test. Run your changes against any existing tests if they exist and create new ones when needed. Whether tests exist or not, make sure your changes don’t break the existing project.
Include screenshots of the before and after if your changes include differences in HTML/CSS. Drag and drop the images into the body of your pull request.
Contribute in the style of the project to the best of your abilities. This may mean using indents, semi colons or comments differently than you would in your own repository, but makes it easier for the maintainer to merge, others to understand and maintain in the future.
#### Open Pull Requests
Once you’ve opened a pull request a discussion will start around your proposed changes. Other contributors and users may chime in, but ultimately the decision is made by the maintainer(s). You may be asked to make some changes to your pull request, if so, add more commits to your branch and push them – they’ll automatically go into the existing pull request.
If your pull request is merged – great! If it is not, no sweat, it may not be what the project maintainer had in mind, or they were already working on it. This happens, so our recommendation is to take any feedback you’ve received and go forth and pull request again – or create your own open source project.
+1 -1
View File
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'FoldingCell'
s.version = '0.1'
s.version = '0.4'
s.summary = 'UITableViewCell with folding animation.'
s.homepage = 'https://github.com/Ramotion/folding-cell'
s.license = 'MIT'
+99 -111
View File
@@ -7,16 +7,14 @@
objects = {
/* Begin PBXBuildFile section */
840B984C1C33FE660081B926 /* FoldingCellFramework.h in Headers */ = {isa = PBXBuildFile; fileRef = 840B984B1C33FE660081B926 /* FoldingCellFramework.h */; settings = {ATTRIBUTES = (Public, ); }; };
840B98501C33FE660081B926 /* FoldingCellFramework.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 840B98491C33FE660081B926 /* FoldingCellFramework.framework */; };
840B98511C33FE660081B926 /* FoldingCellFramework.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 840B98491C33FE660081B926 /* FoldingCellFramework.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
840B98561C33FE730081B926 /* FoldingCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 847A581A1C294FAB0028FB84 /* FoldingCell.swift */; };
847A58081C294F750028FB84 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 847A58071C294F750028FB84 /* AppDelegate.swift */; };
847A580D1C294F750028FB84 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 847A580B1C294F750028FB84 /* Main.storyboard */; };
847A580F1C294F750028FB84 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 847A580E1C294F750028FB84 /* Assets.xcassets */; };
847A58121C294F750028FB84 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 847A58101C294F750028FB84 /* LaunchScreen.storyboard */; };
847A581B1C294FAB0028FB84 /* FoldingCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 847A581A1C294FAB0028FB84 /* FoldingCell.swift */; };
847A581F1C29500B0028FB84 /* MainTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 847A581E1C29500B0028FB84 /* MainTableViewController.swift */; };
848B463B1C56458C00D49B45 /* FoldingCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 847A581A1C294FAB0028FB84 /* FoldingCell.swift */; };
8498513F1C5639F9006FA400 /* FoldingCellTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8498513E1C5639F9006FA400 /* FoldingCellTests.swift */; };
8499F5DD1C2A83F70027D5D2 /* OpenSans-Bold.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 8499F5D31C2A83F70027D5D2 /* OpenSans-Bold.ttf */; };
8499F5DE1C2A83F70027D5D2 /* OpenSans-BoldItalic.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 8499F5D41C2A83F70027D5D2 /* OpenSans-BoldItalic.ttf */; };
8499F5DF1C2A83F70027D5D2 /* OpenSans-ExtraBold.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 8499F5D51C2A83F70027D5D2 /* OpenSans-ExtraBold.ttf */; };
@@ -31,12 +29,12 @@
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
840B984E1C33FE660081B926 /* PBXContainerItemProxy */ = {
849851411C5639F9006FA400 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 847A57FC1C294F750028FB84 /* Project object */;
proxyType = 1;
remoteGlobalIDString = 840B98481C33FE660081B926;
remoteInfo = FoldingCellFramework;
remoteGlobalIDString = 847A58031C294F750028FB84;
remoteInfo = FoldingCell;
};
/* End PBXContainerItemProxy section */
@@ -47,7 +45,6 @@
dstPath = "";
dstSubfolderSpec = 10;
files = (
840B98511C33FE660081B926 /* FoldingCellFramework.framework in Embed Frameworks */,
);
name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0;
@@ -55,7 +52,6 @@
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
840B98491C33FE660081B926 /* FoldingCellFramework.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = FoldingCellFramework.framework; sourceTree = BUILT_PRODUCTS_DIR; };
840B984B1C33FE660081B926 /* FoldingCellFramework.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FoldingCellFramework.h; sourceTree = "<group>"; };
840B984D1C33FE660081B926 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
847A58041C294F750028FB84 /* FoldingCell.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = FoldingCell.app; sourceTree = BUILT_PRODUCTS_DIR; };
@@ -66,6 +62,9 @@
847A58131C294F750028FB84 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
847A581A1C294FAB0028FB84 /* FoldingCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FoldingCell.swift; sourceTree = "<group>"; };
847A581E1C29500B0028FB84 /* MainTableViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MainTableViewController.swift; sourceTree = "<group>"; };
8498513C1C5639F9006FA400 /* FoldingCellTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = FoldingCellTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
8498513E1C5639F9006FA400 /* FoldingCellTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FoldingCellTests.swift; sourceTree = "<group>"; };
849851401C5639F9006FA400 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
8499F5D31C2A83F70027D5D2 /* OpenSans-Bold.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "OpenSans-Bold.ttf"; sourceTree = "<group>"; };
8499F5D41C2A83F70027D5D2 /* OpenSans-BoldItalic.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "OpenSans-BoldItalic.ttf"; sourceTree = "<group>"; };
8499F5D51C2A83F70027D5D2 /* OpenSans-ExtraBold.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "OpenSans-ExtraBold.ttf"; sourceTree = "<group>"; };
@@ -80,18 +79,17 @@
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
840B98451C33FE660081B926 /* Frameworks */ = {
847A58011C294F750028FB84 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
847A58011C294F750028FB84 /* Frameworks */ = {
849851391C5639F9006FA400 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
840B98501C33FE660081B926 /* FoldingCellFramework.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -112,6 +110,7 @@
children = (
847A58061C294F750028FB84 /* FoldingCell */,
840B984A1C33FE660081B926 /* FoldingCellFramework */,
8498513D1C5639F9006FA400 /* FoldingCellTests */,
847A58051C294F750028FB84 /* Products */,
);
sourceTree = "<group>";
@@ -120,7 +119,7 @@
isa = PBXGroup;
children = (
847A58041C294F750028FB84 /* FoldingCell.app */,
840B98491C33FE660081B926 /* FoldingCellFramework.framework */,
8498513C1C5639F9006FA400 /* FoldingCellTests.xctest */,
);
name = Products;
sourceTree = "<group>";
@@ -149,6 +148,15 @@
path = FoldingCell;
sourceTree = "<group>";
};
8498513D1C5639F9006FA400 /* FoldingCellTests */ = {
isa = PBXGroup;
children = (
8498513E1C5639F9006FA400 /* FoldingCellTests.swift */,
849851401C5639F9006FA400 /* Info.plist */,
);
path = FoldingCellTests;
sourceTree = "<group>";
};
8499F5D21C2A83D90027D5D2 /* Fonts */ = {
isa = PBXGroup;
children = (
@@ -168,36 +176,7 @@
};
/* End PBXGroup section */
/* Begin PBXHeadersBuildPhase section */
840B98461C33FE660081B926 /* Headers */ = {
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
files = (
840B984C1C33FE660081B926 /* FoldingCellFramework.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXHeadersBuildPhase section */
/* Begin PBXNativeTarget section */
840B98481C33FE660081B926 /* FoldingCellFramework */ = {
isa = PBXNativeTarget;
buildConfigurationList = 840B98541C33FE660081B926 /* Build configuration list for PBXNativeTarget "FoldingCellFramework" */;
buildPhases = (
840B98441C33FE660081B926 /* Sources */,
840B98451C33FE660081B926 /* Frameworks */,
840B98461C33FE660081B926 /* Headers */,
840B98471C33FE660081B926 /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = FoldingCellFramework;
productName = FoldingCellFramework;
productReference = 840B98491C33FE660081B926 /* FoldingCellFramework.framework */;
productType = "com.apple.product-type.framework";
};
847A58031C294F750028FB84 /* FoldingCell */ = {
isa = PBXNativeTarget;
buildConfigurationList = 847A58161C294F750028FB84 /* Build configuration list for PBXNativeTarget "FoldingCell" */;
@@ -210,13 +189,30 @@
buildRules = (
);
dependencies = (
840B984F1C33FE660081B926 /* PBXTargetDependency */,
);
name = FoldingCell;
productName = FoldingCell;
productReference = 847A58041C294F750028FB84 /* FoldingCell.app */;
productType = "com.apple.product-type.application";
};
8498513B1C5639F9006FA400 /* FoldingCellTests */ = {
isa = PBXNativeTarget;
buildConfigurationList = 849851431C5639F9006FA400 /* Build configuration list for PBXNativeTarget "FoldingCellTests" */;
buildPhases = (
849851381C5639F9006FA400 /* Sources */,
849851391C5639F9006FA400 /* Frameworks */,
8498513A1C5639F9006FA400 /* Resources */,
);
buildRules = (
);
dependencies = (
849851421C5639F9006FA400 /* PBXTargetDependency */,
);
name = FoldingCellTests;
productName = FoldingCellTests;
productReference = 8498513C1C5639F9006FA400 /* FoldingCellTests.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
@@ -227,11 +223,13 @@
LastUpgradeCheck = 0720;
ORGANIZATIONNAME = "Alex K.";
TargetAttributes = {
840B98481C33FE660081B926 = {
CreatedOnToolsVersion = 7.2;
};
847A58031C294F750028FB84 = {
CreatedOnToolsVersion = 7.2;
DevelopmentTeam = 34MUF9YXTA;
};
8498513B1C5639F9006FA400 = {
CreatedOnToolsVersion = 7.2;
TestTargetID = 847A58031C294F750028FB84;
};
};
};
@@ -249,19 +247,12 @@
projectRoot = "";
targets = (
847A58031C294F750028FB84 /* FoldingCell */,
840B98481C33FE660081B926 /* FoldingCellFramework */,
8498513B1C5639F9006FA400 /* FoldingCellTests */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
840B98471C33FE660081B926 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
847A58021C294F750028FB84 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
@@ -282,17 +273,16 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
840B98441C33FE660081B926 /* Sources */ = {
isa = PBXSourcesBuildPhase;
8498513A1C5639F9006FA400 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
840B98561C33FE730081B926 /* FoldingCell.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
847A58001C294F750028FB84 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
@@ -304,13 +294,22 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
849851381C5639F9006FA400 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
8498513F1C5639F9006FA400 /* FoldingCellTests.swift in Sources */,
848B463B1C56458C00D49B45 /* FoldingCell.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXTargetDependency section */
840B984F1C33FE660081B926 /* PBXTargetDependency */ = {
849851421C5639F9006FA400 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 840B98481C33FE660081B926 /* FoldingCellFramework */;
targetProxy = 840B984E1C33FE660081B926 /* PBXContainerItemProxy */;
target = 847A58031C294F750028FB84 /* FoldingCell */;
targetProxy = 849851411C5639F9006FA400 /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */
@@ -334,46 +333,6 @@
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
840B98521C33FE660081B926 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CURRENT_PROJECT_VERSION = 1;
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = FoldingCellFramework/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.ramotion.FoldingCellFramework;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
TARGETED_DEVICE_FAMILY = "1,2";
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
name = Debug;
};
840B98531C33FE660081B926 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CURRENT_PROJECT_VERSION = 1;
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = FoldingCellFramework/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.ramotion.FoldingCellFramework;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
TARGETED_DEVICE_FAMILY = "1,2";
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
name = Release;
};
847A58141C294F750028FB84 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
@@ -459,6 +418,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_IDENTITY = "iPhone Developer";
EMBEDDED_CONTENT_CONTAINS_SWIFT = YES;
INFOPLIST_FILE = FoldingCell/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
@@ -472,6 +432,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_IDENTITY = "iPhone Developer";
EMBEDDED_CONTENT_CONTAINS_SWIFT = YES;
INFOPLIST_FILE = FoldingCell/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
@@ -481,17 +442,35 @@
};
name = Release;
};
849851441C5639F9006FA400 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
DEFINES_MODULE = YES;
INFOPLIST_FILE = FoldingCellTests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.ramotion.FoldingCellTests;
PRODUCT_NAME = "$(TARGET_NAME)";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/FoldingCell.app/FoldingCell";
};
name = Debug;
};
849851451C5639F9006FA400 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
DEFINES_MODULE = YES;
INFOPLIST_FILE = FoldingCellTests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.ramotion.FoldingCellTests;
PRODUCT_NAME = "$(TARGET_NAME)";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/FoldingCell.app/FoldingCell";
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
840B98541C33FE660081B926 /* Build configuration list for PBXNativeTarget "FoldingCellFramework" */ = {
isa = XCConfigurationList;
buildConfigurations = (
840B98521C33FE660081B926 /* Debug */,
840B98531C33FE660081B926 /* Release */,
);
defaultConfigurationIsVisible = 0;
};
847A57FF1C294F750028FB84 /* Build configuration list for PBXProject "FoldingCell" */ = {
isa = XCConfigurationList;
buildConfigurations = (
@@ -510,6 +489,15 @@
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
849851431C5639F9006FA400 /* Build configuration list for PBXNativeTarget "FoldingCellTests" */ = {
isa = XCConfigurationList;
buildConfigurations = (
849851441C5639F9006FA400 /* Debug */,
849851451C5639F9006FA400 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 847A57FC1C294F750028FB84 /* Project object */;
@@ -0,0 +1,105 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0720"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "847A58031C294F750028FB84"
BuildableName = "FoldingCell.app"
BlueprintName = "FoldingCell"
ReferencedContainer = "container:">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "8498513B1C5639F9006FA400"
BuildableName = "FoldingCellTests.xctest"
BlueprintName = "FoldingCellTests"
ReferencedContainer = "container:">
</BuildableReference>
<LocationScenarioReference
identifier = "com.apple.dt.IDEFoundation.CurrentLocationScenarioIdentifier"
referenceType = "1">
</LocationScenarioReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "847A58031C294F750028FB84"
BuildableName = "FoldingCell.app"
BlueprintName = "FoldingCell"
ReferencedContainer = "container:">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "847A58031C294F750028FB84"
BuildableName = "FoldingCell.app"
BlueprintName = "FoldingCell"
ReferencedContainer = "container:">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "847A58031C294F750028FB84"
BuildableName = "FoldingCell.app"
BlueprintName = "FoldingCell"
ReferencedContainer = "container:">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
@@ -14,9 +14,9 @@
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "840B98481C33FE660081B926"
BuildableName = "FoldingCellFramework.framework"
BlueprintName = "FoldingCellFramework"
BlueprintIdentifier = "847A58031C294F750028FB84"
BuildableName = "FoldingCell.app"
BlueprintName = "FoldingCell"
ReferencedContainer = "container:FoldingCell.xcodeproj">
</BuildableReference>
</BuildActionEntry>
@@ -28,7 +28,26 @@
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "8498513B1C5639F9006FA400"
BuildableName = "FoldingCellTests.xctest"
BlueprintName = "FoldingCellTests"
ReferencedContainer = "container:FoldingCell.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "847A58031C294F750028FB84"
BuildableName = "FoldingCell.app"
BlueprintName = "FoldingCell"
ReferencedContainer = "container:FoldingCell.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
@@ -42,15 +61,16 @@
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "840B98481C33FE660081B926"
BuildableName = "FoldingCellFramework.framework"
BlueprintName = "FoldingCellFramework"
BlueprintIdentifier = "847A58031C294F750028FB84"
BuildableName = "FoldingCell.app"
BlueprintName = "FoldingCell"
ReferencedContainer = "container:FoldingCell.xcodeproj">
</BuildableReference>
</MacroExpansion>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
@@ -60,15 +80,16 @@
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "840B98481C33FE660081B926"
BuildableName = "FoldingCellFramework.framework"
BlueprintName = "FoldingCellFramework"
BlueprintIdentifier = "847A58031C294F750028FB84"
BuildableName = "FoldingCell.app"
BlueprintName = "FoldingCell"
ReferencedContainer = "container:FoldingCell.xcodeproj">
</BuildableReference>
</MacroExpansion>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
@@ -50,7 +50,7 @@
<!--Main Table View Controller-->
<scene sceneID="Q2d-BE-geS">
<objects>
<tableViewController id="0cn-rv-Emg" customClass="MainTableViewController" customModule="FoldingCell" customModuleProvider="target" sceneMemberID="viewController">
<tableViewController storyboardIdentifier="MainTableViewController" id="0cn-rv-Emg" customClass="MainTableViewController" customModule="FoldingCell" customModuleProvider="target" sceneMemberID="viewController">
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" showsHorizontalScrollIndicator="NO" showsVerticalScrollIndicator="NO" dataMode="prototypes" style="plain" separatorStyle="none" showsSelectionImmediatelyOnTouchBegin="NO" rowHeight="667" sectionHeaderHeight="28" sectionFooterHeight="28" id="MwZ-K3-six">
<rect key="frame" x="0.0" y="0.0" width="600" height="695"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
@@ -31,7 +31,7 @@ public class FoldingCell: UITableViewCell {
@IBOutlet weak var foregroundView: RotatedView!
var animationView: UIView?
@IBInspectable var itemCount: NSInteger = 2
@IBInspectable var itemCount: NSInteger = 2 //count of folding
@IBInspectable var backViewColor: UIColor = UIColor.brownColor()
@@ -50,7 +50,6 @@ public class FoldingCell: UITableViewCell {
configureDefaultState()
self.selectionStyle = .None
containerView.backgroundColor = UIColor.clearColor()
containerView.layer.cornerRadius = foregroundView.layer.cornerRadius
containerView.layer.masksToBounds = true
@@ -62,14 +61,18 @@ public class FoldingCell: UITableViewCell {
let foregroundTopConstraint = self.contentView.constraints.filter{ $0.identifier == "ForegroundViewTop"}.first
let containerViewTopConstraint = self.contentView.constraints.filter{ $0.identifier == "ContainerViewTop"}.first
assert(foregroundTopConstraint != nil, "set identifier")
assert(containerViewTopConstraint != nil, "set identifier")
guard let foregroundConstraint = foregroundTopConstraint else {
fatalError("set identifier")
}
guard let containerConstraint = containerViewTopConstraint else {
fatalError("set identifier")
}
containerViewTopConstraint!.constant = foregroundTopConstraint!.constant
containerConstraint.constant = foregroundConstraint.constant
containerView.alpha = 0;
foregroundView.layer.anchorPoint = CGPoint.init(x: 0.5, y: 1)
foregroundTopConstraint!.constant += foregroundView.bounds.height / 2
foregroundConstraint.constant += foregroundView.bounds.height / 2
foregroundView.layer.transform = foregroundView.transform3d()
createAnimationView();
@@ -77,13 +80,17 @@ public class FoldingCell: UITableViewCell {
}
func createAnimationItemView()->[RotatedView] {
guard let animationView = self.animationView else {
fatalError()
}
var items = [RotatedView]()
items.append(foregroundView)
var rotatedViews = [RotatedView]()
for itemView in animationView!.subviews.filter({$0 is RotatedView}).sort({ $0.tag < $1.tag }) as! [RotatedView] {
for case let itemView as RotatedView in animationView.subviews.filter({$0 is RotatedView}).sort({ $0.tag < $1.tag }){
rotatedViews.append(itemView)
if itemView.backView != nil {
rotatedViews.append(itemView.backView!)
if let backView = itemView.backView {
rotatedViews.append(backView)
}
}
items.appendContentsOf(rotatedViews)
@@ -91,12 +98,17 @@ public class FoldingCell: UITableViewCell {
}
func configureAnimationItems(animationType: AnimationType) {
guard let animationViewSuperView = animationView?.subviews else {
fatalError()
}
if animationType == .Open {
for view in animationView!.subviews.filter({$0 is RotatedView}) {
for view in animationViewSuperView.filter({$0 is RotatedView}) {
view.alpha = 0;
}
} else { // close
for view: RotatedView in animationView!.subviews.filter({$0 is RotatedView}) as! [RotatedView] {
for case let view as RotatedView in animationViewSuperView.filter({$0 is RotatedView}) {
if animationType == .Open {
view.alpha = 0
} else {
@@ -228,14 +240,15 @@ public class FoldingCell: UITableViewCell {
}
containerView.alpha = 0;
// added back view
var previusView: RotatedView?
for contener in animationView!.subviews.sort({ $0.tag < $1.tag }) {
if contener is RotatedView && contener.tag > 0 && contener.tag < animationView!.subviews.count {
let rotatedView = contener as! RotatedView
previusView?.addBackView(rotatedView.bounds.size.height, color: backViewColor)
previusView = rotatedView
if let animationView = self.animationView {
// added back view
var previusView: RotatedView?
for case let contener as RotatedView in animationView.subviews.sort({ $0.tag < $1.tag }) {
if contener.tag > 0 && contener.tag < animationView.subviews.count {
previusView?.addBackView(contener.bounds.size.height, color: backViewColor)
previusView = contener
}
}
}
@@ -267,16 +280,20 @@ public class FoldingCell: UITableViewCell {
}
public func isAnimating()->Bool {
guard animationItemViews != nil
else {
guard let animationItemViews = self.animationItemViews else {
return false
}
for item in animationItemViews! {
for item in animationItemViews {
if item.layer.animationKeys()?.count > 0 {
return true
}
}
if animationView?.alpha == 1 {
return true
}
return false
}
@@ -304,7 +321,11 @@ public class FoldingCell: UITableViewCell {
addImageItemsToAnimationView()
}
animationView?.alpha = 1;
guard let animationView = self.animationView else {
return
}
animationView.alpha = 1;
containerView.alpha = 0;
let durations = durationSequence(.Open)
@@ -315,8 +336,13 @@ public class FoldingCell: UITableViewCell {
var to: CGFloat = CGFloat(-M_PI / 2)
var hidden = true
configureAnimationItems(.Open)
for var index = 0; index < animationItemViews?.count; index++ {
let animatedView = animationItemViews![index]
guard let animationItemViews = self.animationItemViews else {
return
}
for var index = 0; index < animationItemViews.count; index++ {
let animatedView = animationItemViews[index]
animatedView.foldingAnimation(timing, from: from, to: to, duration: durations[index], delay: delay, hidden: hidden)
@@ -327,10 +353,13 @@ public class FoldingCell: UITableViewCell {
delay += durations[index]
}
let firstItemView = animationView!.subviews.filter{$0.tag == 0}.first
firstItemView!.layer.masksToBounds = true
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, Int64(durations[0] * Double(NSEC_PER_SEC))), dispatch_get_main_queue()) { () -> Void in
firstItemView!.layer.cornerRadius = 0
let firstItemView = animationView.subviews.filter{$0.tag == 0}.first
if let first = firstItemView {
first.layer.masksToBounds = true
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, Int64(durations[0] * Double(NSEC_PER_SEC))), dispatch_get_main_queue()) { () -> Void in
first.layer.cornerRadius = 0
}
}
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, Int64(delay * Double(NSEC_PER_SEC))), dispatch_get_main_queue()) { () -> Void in
self.animationView?.alpha = 0
@@ -358,9 +387,12 @@ public class FoldingCell: UITableViewCell {
var hidden = true
configureAnimationItems(.Close)
for var index = 0; index < animationItemViews?.count; index++ {
let animatedView = animationItemViews?.reverse()[index]
guard let animatedView = animationItemViews?.reverse()[index] else {
continue
}
animatedView!.foldingAnimation(timing, from: from, to: to, duration: durations[index], delay: delay, hidden: hidden)
animatedView.foldingAnimation(timing, from: from, to: to, duration: durations[index], delay: delay, hidden: hidden)
to = to == 0.0 ? CGFloat(M_PI / 2) : 0.0;
from = from == 0.0 ? CGFloat(-M_PI / 2) : 0.0;
@@ -370,14 +402,20 @@ public class FoldingCell: UITableViewCell {
}
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, Int64(delay * Double(NSEC_PER_SEC))), dispatch_get_main_queue()) { () -> Void in
self.animationView!.alpha = 0
if let animationView = self.animationView {
animationView.alpha = 0
}
completion?()
}
let firstItemView = animationView!.subviews.filter{$0.tag == 0}.first
firstItemView!.layer.masksToBounds = false
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, Int64((delay - durations.last! * 1.5) * Double(NSEC_PER_SEC))), dispatch_get_main_queue()) { () -> Void in
firstItemView!.layer.cornerRadius = self.foregroundView.layer.cornerRadius
if let animationView = self.animationView {
let firstItemView = animationView.subviews.filter{$0.tag == 0}.first
firstItemView?.layer.masksToBounds = false
if let durationLast = durations.last {
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, Int64((delay - durationLast * 1.5) * Double(NSEC_PER_SEC))), dispatch_get_main_queue()) { () -> Void in
firstItemView?.layer.cornerRadius = self.foregroundView.layer.cornerRadius
}
}
}
}
}
@@ -466,13 +504,17 @@ extension RotatedView {
}
extension UIView {
func pb_takeSnapshot(frame: CGRect) -> UIImage {
func pb_takeSnapshot(frame: CGRect) -> UIImage? {
UIGraphicsBeginImageContextWithOptions(frame.size, false, 0.0);
let context = UIGraphicsGetCurrentContext();
CGContextTranslateCTM(context, frame.origin.x * -1, frame.origin.y * -1);
self.layer.renderInContext(UIGraphicsGetCurrentContext()!);
guard let currentContext = UIGraphicsGetCurrentContext() else {
return nil
}
self.layer.renderInContext(currentContext);
let image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
@@ -30,7 +30,7 @@ class MainTableViewController: UITableViewController {
let kRowsCount = 10
var cellHeights: [CGFloat]?
var cellHeights = [CGFloat]()
override func viewDidLoad() {
super.viewDidLoad()
@@ -41,9 +41,8 @@ class MainTableViewController: UITableViewController {
// MARK: configure
func createCellHeightsArray() {
cellHeights = Array()
for _ in 0...kRowsCount {
cellHeights?.append(kCloseCellHeight)
cellHeights.append(kCloseCellHeight)
}
}
@@ -59,7 +58,7 @@ class MainTableViewController: UITableViewController {
let foldingCell = cell as! FoldingCell
foldingCell.backgroundColor = UIColor.clearColor()
if cellHeights![indexPath.row] == kCloseCellHeight {
if cellHeights[indexPath.row] == kCloseCellHeight {
foldingCell.selectedAnimation(false, animated: false, completion:nil)
} else {
foldingCell.selectedAnimation(true, animated: false, completion: nil)
@@ -74,7 +73,7 @@ class MainTableViewController: UITableViewController {
}
override func tableView(tableView: UITableView, heightForRowAtIndexPath indexPath: NSIndexPath) -> CGFloat {
return cellHeights![indexPath.row]
return cellHeights[indexPath.row]
}
// MARK: Table vie delegate
@@ -88,12 +87,12 @@ class MainTableViewController: UITableViewController {
}
var duration = 0.0
if cellHeights![indexPath.row] == kCloseCellHeight { // open cell
cellHeights![indexPath.row] = kOpenCellHeight
if cellHeights[indexPath.row] == kCloseCellHeight { // open cell
cellHeights[indexPath.row] = kOpenCellHeight
cell.selectedAnimation(true, animated: true, completion: nil)
duration = 0.5
} else {// close cell
cellHeights![indexPath.row] = kCloseCellHeight
cellHeights[indexPath.row] = kCloseCellHeight
cell.selectedAnimation(false, animated: true, completion: nil)
duration = 1.1
}
@@ -0,0 +1,45 @@
//
// FoldingCellTests.swift
// FoldingCellTests
//
// Created by Alex K. on 25/01/16.
// Copyright © 2016 Alex K. All rights reserved.
//
import XCTest
class FoldingCellTests: XCTestCase {
var viewController : UITableViewController!
override func setUp() {
super.setUp()
let storyboard = UIStoryboard(name: "Main", bundle: nil)
viewController = storyboard.instantiateViewControllerWithIdentifier("MainTableViewController") as! UITableViewController
viewController.beginAppearanceTransition(true, animated: false)
}
override func tearDown() {
viewController.endAppearanceTransition()
super.tearDown()
}
func testExample() {
let tableView = viewController.tableView
for case let cell as FoldingCell in tableView.visibleCells {
XCTAssertTrue(cell.itemCount >= 2)
}
}
func testPerformanceExample() {
// This is an example of a performance test case.
self.measureBlock {
// Put the code you want to measure the time of here.
}
}
}
+24
View File
@@ -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>
+23 -42
View File
@@ -1,4 +1,8 @@
# FoldingCell
[![CocoaPods](https://img.shields.io/cocoapods/p/FoldingCell.svg)](https://cocoapods.org/pods/FoldingCell)
[![CocoaPods](https://img.shields.io/cocoapods/v/FoldingCell.svg)](http://cocoapods.org/pods/FoldingCell)
[![Twitter](https://img.shields.io/badge/Twitter-@Ramotion-blue.svg?style=flat)](http://twitter.com/Ramotion)
[![Travis](https://img.shields.io/travis/Ramotion/folding-cell.svg)](https://travis-ci.org/Ramotion/folding-cell)
[shot on dribbble](https://dribbble.com/shots/2121350-Delivery-Card):
![Animation](Screenshots/folding-cell.gif)
@@ -14,7 +18,7 @@ Just add the FoldingCell.swift file to your project.
or use [CocoaPods](https://cocoapods.org) with Podfile:
``` ruby
pod 'FoldingCell', '~> 0.1'
pod 'FoldingCell', '~> 0.3'
```
@@ -43,36 +47,7 @@ property `containerView`. Add constraints from this view to the superview like i
Your result should be something like this picture:
![1.3](/Tutorial-resources/1.3.png)
4) Now lets add folding views
4.1) Add a UIView to `containerView` (where `ContainerView` is the UIView which you've added on step 3)
Add constraints from this view to `containerView` as in the picture:
![1.4](/Tutorial-resources/1.4.png)
For correct animation, the height constraint constant should be equal to `foregroundView`'s height constraint constant.
Result:
![1.5](/Tutorial-resources/1.5.png)
4.2) Add a `UIView` to `containerView` inheriting from `RotatedView`. Add constraints from
this view to `containerView` as in the picture:
![1.6](/Tutorial-resources/1.6.png).
For correct animation, the height constraint constant must be equal to `foregroundView`'s height constraint constant.
Add the identifier "yPosition" for the top constraint. **The tag must be equal to 1**
Result:
![1.7](/Tutorial-resources/1.7.png)
The following steps are optional (you can add as many views as you want).
4.3) repeat 4.2, but **increasing the tag by one**. (For the correct animation, height of the view
must be less than or equal to that of the previous view).
The height of `containerView` must be equal to the sum of the heights of its subviews:
![1.8](/Tutorial-resources/1.8.png)
4) Set ``` @IBInspectable var itemCount: NSInteger ``` property is a count of folding (it IBInspectable you can set in storyborad). range 2 or greater. Default value is 2
Ok, we've finished configuring the cell.
@@ -86,7 +61,7 @@ Ok, we've finished configuring the cell.
5.2) Add property
``` swift
var cellHeights: [CGFloat]?
var cellHeights = [CGFloat]()
```
create in viewDidLoad:
@@ -95,7 +70,7 @@ Ok, we've finished configuring the cell.
super.viewDidLoad()
for _ in 0...kRowsCount {
cellHeights?.append(kCloseCellHeight)
cellHeights.append(kCloseCellHeight)
}
}
```
@@ -103,7 +78,7 @@ Ok, we've finished configuring the cell.
5.3) Override method:
``` swift
override func tableView(tableView: UITableView, heightForRowAtIndexPath indexPath: NSIndexPath) -> CGFloat {
return cellHeights![indexPath.row]
return cellHeights[indexPath.row]
}
```
@@ -113,12 +88,12 @@ Ok, we've finished configuring the cell.
let cell = tableView.cellForRowAtIndexPath(indexPath) as! FoldingCell
var duration = 0.0
if cellHeights![indexPath.row] == kCloseCellHeight { // open cell
cellHeights![indexPath.row] = kOpenCellHeight
if cellHeights[indexPath.row] == kCloseCellHeight { // open cell
cellHeights[indexPath.row] = kOpenCellHeight
cell.selectedAnimation(true, animated: true, completion: nil)
duration = 0.5
} else {// close cell
cellHeights![indexPath.row] = kCloseCellHeight
cellHeights[indexPath.row] = kCloseCellHeight
cell.selectedAnimation(false, animated: true, completion: nil)
duration = 1.1
}
@@ -149,15 +124,21 @@ Ok, we've finished configuring the cell.
``` swift
override func animationDuration(itemIndex:NSInteger, type:AnimationType)-> NSTimeInterval {
// durations count equal containerView.subViews.count - 1
// durations count equal it itemCount
let durations = [0.33, 0.26, 0.26] // timing animation for each view
return durations[itemIndex]
}
```
## [About Us](http://ramotion.com?utm_source=gthb&utm_medium=special&utm_campaign=folding-cell)
## Licence
[Ramotion - digital product design agency](http://ramotion.com?utm_source=gthb&utm_medium=special&utm_campaign=folding-cell)
We are ready for new interesting iOS app development projects.
Adaptive tab bar is released under the MIT license.
See [LICENSE](./LICENSE) for details.
Follow us on [Twitter](http://twitter.com/ramotion).
## About
The project maintained by [app development agency](https://ramotion.com?utm_source=gthb&utm_medium=special&utm_campaign=foolding-cell) [Ramotion Inc.](https://ramotion.com?utm_source=gthb&utm_medium=special&utm_campaign=foolding-cell)
See our other [open-source projects](https://github.com/ramotion) or [hire](https://ramotion.com?utm_source=gthb&utm_medium=special&utm_campaign=foolding-cell) us to design, develop, and grow your product.
[![Twitter URL](https://img.shields.io/twitter/url/http/shields.io.svg?style=social)](https://twitter.com/intent/tweet?text=https://github.com/ramotion/foolding-cell)
[![Twitter Follow](https://img.shields.io/twitter/follow/ramotion.svg?style=social)](https://twitter.com/ramotion)