Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9c6c0b5e25 | ||
|
|
4dbcadd7f4 | ||
|
|
ff188166b7 | ||
|
|
f0a8ebdb79 | ||
|
|
f7fe23006a | ||
|
|
12792d60f6 | ||
|
|
2c84447e89 | ||
|
|
2055f0f737 | ||
|
|
83e3cb88c8 | ||
|
|
836c4f80e5 | ||
|
|
b6525b5dde |
+12
-4
@@ -1,6 +1,14 @@
|
||||
osx_image: xcode7.3
|
||||
osx_image: xcode8
|
||||
language: objective-c
|
||||
|
||||
xcode_project: FoldingCell/FoldingCell.xcodeproj
|
||||
xcode_scheme: FoldingCell
|
||||
xcode_sdk: iphonesimulator
|
||||
env:
|
||||
- DESTINATION="OS=10.0,name=iPhone 6s" SCHEME="FoldingCell" SDK=iphonesimulator10.0
|
||||
before_install:
|
||||
- gem install xcpretty --no-rdoc --no-ri --no-document --quiet
|
||||
script:
|
||||
- set -o pipefail
|
||||
- xcodebuild -version
|
||||
- xcodebuild -project FoldingCell/FoldingCell.xcodeproj -scheme "FoldingCell" -sdk "$SDK" -destination "$DESTINATION"
|
||||
-configuration Debug ONLY_ACTIVE_ARCH=NO build | xcpretty -c
|
||||
- xcodebuild -project FoldingCell/FoldingCell.xcodeproj -scheme "FoldingCell" -sdk "$SDK" -destination "$DESTINATION"
|
||||
-configuration Release ONLY_ACTIVE_ARCH=NO build | xcpretty -c
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
Pod::Spec.new do |s|
|
||||
s.name = 'FoldingCell'
|
||||
s.version = '0.8.7'
|
||||
s.version = '1.0.0'
|
||||
s.summary = 'UITableViewCell with folding animation.'
|
||||
s.homepage = 'https://github.com/Ramotion/folding-cell'
|
||||
s.license = 'MIT'
|
||||
|
||||
@@ -284,20 +284,22 @@
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastSwiftUpdateCheck = 0720;
|
||||
LastUpgradeCheck = 0720;
|
||||
LastUpgradeCheck = 0800;
|
||||
ORGANIZATIONNAME = "Alex K.";
|
||||
TargetAttributes = {
|
||||
847A58031C294F750028FB84 = {
|
||||
CreatedOnToolsVersion = 7.2;
|
||||
DevelopmentTeam = LEAZS7L33U;
|
||||
LastSwiftMigration = 0800;
|
||||
};
|
||||
8498513B1C5639F9006FA400 = {
|
||||
CreatedOnToolsVersion = 7.2;
|
||||
LastSwiftMigration = 0800;
|
||||
TestTargetID = 847A58031C294F750028FB84;
|
||||
};
|
||||
8499D8841D0054A8004B5B37 = {
|
||||
CreatedOnToolsVersion = 7.3.1;
|
||||
DevelopmentTeam = LEAZS7L33U;
|
||||
LastSwiftMigration = 0800;
|
||||
};
|
||||
};
|
||||
};
|
||||
@@ -435,8 +437,10 @@
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
@@ -479,8 +483,10 @@
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
@@ -499,6 +505,7 @@
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 9.2;
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
SDKROOT = iphoneos;
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
|
||||
VALIDATE_PRODUCT = YES;
|
||||
};
|
||||
name = Release;
|
||||
@@ -506,28 +513,32 @@
|
||||
847A58171C294F750028FB84 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CODE_SIGN_IDENTITY = "iPhone Developer";
|
||||
EMBEDDED_CONTENT_CONTAINS_SWIFT = YES;
|
||||
DEVELOPMENT_TEAM = "";
|
||||
INFOPLIST_FILE = FoldingCell/Info.plist;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.ramotion.dev;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_VERSION = 3.0;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
847A58181C294F750028FB84 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CODE_SIGN_IDENTITY = "iPhone Developer";
|
||||
EMBEDDED_CONTENT_CONTAINS_SWIFT = YES;
|
||||
DEVELOPMENT_TEAM = "";
|
||||
INFOPLIST_FILE = FoldingCell/Info.plist;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.ramotion.dev;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_VERSION = 3.0;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
@@ -536,11 +547,13 @@
|
||||
buildSettings = {
|
||||
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||
DEFINES_MODULE = YES;
|
||||
DEVELOPMENT_TEAM = "";
|
||||
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";
|
||||
SWIFT_VERSION = 3.0;
|
||||
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/FoldingCellDemo.app/FoldingCellDemo";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
@@ -549,11 +562,13 @@
|
||||
buildSettings = {
|
||||
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||
DEFINES_MODULE = YES;
|
||||
DEVELOPMENT_TEAM = "";
|
||||
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";
|
||||
SWIFT_VERSION = 3.0;
|
||||
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/FoldingCellDemo.app/FoldingCellDemo";
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
@@ -562,6 +577,7 @@
|
||||
buildSettings = {
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CODE_SIGN_IDENTITY = "iPhone Developer";
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
DEFINES_MODULE = YES;
|
||||
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||
@@ -574,6 +590,7 @@
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.ramotion.FoldingCell;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SKIP_INSTALL = YES;
|
||||
SWIFT_VERSION = 3.0;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
VERSIONING_SYSTEM = "apple-generic";
|
||||
VERSION_INFO_PREFIX = "";
|
||||
@@ -585,6 +602,7 @@
|
||||
buildSettings = {
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CODE_SIGN_IDENTITY = "iPhone Developer";
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
DEFINES_MODULE = YES;
|
||||
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||
@@ -597,6 +615,7 @@
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.ramotion.FoldingCell;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SKIP_INSTALL = YES;
|
||||
SWIFT_VERSION = 3.0;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
VERSIONING_SYSTEM = "apple-generic";
|
||||
VERSION_INFO_PREFIX = "";
|
||||
@@ -640,6 +659,7 @@
|
||||
8499D8901D0054A8004B5B37 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
/* End XCConfigurationList section */
|
||||
};
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0730"
|
||||
LastUpgradeVersion = "0800"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
|
||||
@@ -29,30 +29,30 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
|
||||
var window: UIWindow?
|
||||
|
||||
|
||||
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
|
||||
// Override point for customization after application launch.
|
||||
return true
|
||||
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey : Any]? = nil) -> Bool {
|
||||
// Override point for customization after application launch.
|
||||
return true
|
||||
}
|
||||
|
||||
func applicationWillResignActive(application: UIApplication) {
|
||||
|
||||
func applicationWillResignActive(_ application: UIApplication) {
|
||||
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
|
||||
// Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
|
||||
}
|
||||
|
||||
func applicationDidEnterBackground(application: UIApplication) {
|
||||
func applicationDidEnterBackground(_ application: UIApplication) {
|
||||
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
|
||||
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
|
||||
}
|
||||
|
||||
func applicationWillEnterForeground(application: UIApplication) {
|
||||
func applicationWillEnterForeground(_ application: UIApplication) {
|
||||
// Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
|
||||
}
|
||||
|
||||
func applicationDidBecomeActive(application: UIApplication) {
|
||||
func applicationDidBecomeActive(_ application: UIApplication) {
|
||||
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
|
||||
}
|
||||
|
||||
func applicationWillTerminate(application: UIApplication) {
|
||||
func applicationWillTerminate(_ application: UIApplication) {
|
||||
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
<?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">
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="11198.2" systemVersion="15G31" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
|
||||
<dependencies>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="8122"/>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11161"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<scenes>
|
||||
<!--View Controller-->
|
||||
@@ -13,10 +15,9 @@
|
||||
<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"/>
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<animations/>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
|
||||
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
</view>
|
||||
</viewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="9532" systemVersion="15D21" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="0cn-rv-Emg">
|
||||
<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="0cn-rv-Emg">
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9530"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
|
||||
</dependencies>
|
||||
<customFonts key="customFonts">
|
||||
<mutableArray key="OpenSans-Light.ttf">
|
||||
@@ -50,28 +50,28 @@
|
||||
<!--Main Table View Controller-->
|
||||
<scene sceneID="Q2d-BE-geS">
|
||||
<objects>
|
||||
<tableViewController storyboardIdentifier="MainTableViewController" id="0cn-rv-Emg" customClass="MainTableViewController" customModule="FoldingCell" customModuleProvider="target" sceneMemberID="viewController">
|
||||
<tableViewController storyboardIdentifier="MainTableViewController" id="0cn-rv-Emg" customClass="MainTableViewController" customModule="FoldingCellDemo" 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"/>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
||||
<color key="sectionIndexBackgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
|
||||
<prototypes>
|
||||
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" reuseIdentifier="FoldingCell" rowHeight="667" id="fgm-B1-nUi" customClass="DemoCell" customModule="FoldingCell" customModuleProvider="target">
|
||||
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" reuseIdentifier="FoldingCell" rowHeight="667" id="fgm-B1-nUi" customClass="DemoCell" customModule="FoldingCellDemo" customModuleProvider="target">
|
||||
<rect key="frame" x="0.0" y="28" width="600" height="667"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="fgm-B1-nUi" id="MxP-E5-nua">
|
||||
<rect key="frame" x="0.0" y="0.0" width="600" height="667"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="CQr-i9-7br" userLabel="Foreground" customClass="RotatedView" customModule="FoldingCell" customModuleProvider="target">
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="CQr-i9-7br" userLabel="Foreground" customClass="RotatedView" customModule="FoldingCellDemo" customModuleProvider="target">
|
||||
<rect key="frame" x="20" y="7" width="560" height="165"/>
|
||||
<subviews>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="UhV-pr-kw4" userLabel="LeftView">
|
||||
<rect key="frame" x="0.0" y="0.0" width="88" height="165"/>
|
||||
<subviews>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="£25" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="uWG-zH-Vjo">
|
||||
<rect key="frame" x="19" y="31" width="42" height="33"/>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="#25" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="uWG-zH-Vjo">
|
||||
<rect key="frame" x="19" y="31" width="43" height="33"/>
|
||||
<fontDescription key="fontDescription" name="OpenSans-Light" family="Open Sans" pointSize="24"/>
|
||||
<color key="textColor" red="1" green="1" blue="1" alpha="0.8008604307432432" colorSpace="calibratedRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
@@ -375,7 +375,7 @@
|
||||
<constraint firstItem="O5y-fi-aEI" firstAttribute="leading" secondItem="sdL-VL-QmS" secondAttribute="trailing" constant="1" id="vn1-SH-zt8"/>
|
||||
</constraints>
|
||||
</view>
|
||||
<view tag="1" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="stA-YF-Roj" userLabel="SecondContanerView" customClass="RotatedView" customModule="FoldingCell" customModuleProvider="target">
|
||||
<view tag="1" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="stA-YF-Roj" userLabel="SecondContanerView" customClass="RotatedView" customModule="FoldingCellDemo" customModuleProvider="target">
|
||||
<rect key="frame" x="0.0" y="165" width="560" height="165"/>
|
||||
<subviews>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="SENDER" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="W63-7b-X8w">
|
||||
@@ -518,7 +518,7 @@
|
||||
<constraint firstAttribute="height" constant="165" id="zna-xw-SZ3"/>
|
||||
</constraints>
|
||||
</view>
|
||||
<view tag="2" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="dXA-2m-h6U" userLabel="ThirdContanerView" customClass="RotatedView" customModule="FoldingCell" customModuleProvider="target">
|
||||
<view tag="2" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="dXA-2m-h6U" userLabel="ThirdContanerView" customClass="RotatedView" customModule="FoldingCellDemo" customModuleProvider="target">
|
||||
<rect key="frame" x="0.0" y="330" width="560" height="72"/>
|
||||
<subviews>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="4an-5P-hxw" userLabel="fromView">
|
||||
@@ -596,7 +596,7 @@
|
||||
<constraint firstItem="xej-CM-tIb" firstAttribute="top" secondItem="dXA-2m-h6U" secondAttribute="top" id="xOe-NP-ZG0"/>
|
||||
</constraints>
|
||||
</view>
|
||||
<view tag="3" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="073-FT-8Xc" userLabel="BottomContanerView" customClass="RotatedView" customModule="FoldingCell" customModuleProvider="target">
|
||||
<view tag="3" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="073-FT-8Xc" userLabel="BottomContanerView" customClass="RotatedView" customModule="FoldingCellDemo" customModuleProvider="target">
|
||||
<rect key="frame" x="0.0" y="402" width="560" height="72"/>
|
||||
<subviews>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="7hv-c7-TPM" userLabel="line">
|
||||
@@ -688,8 +688,12 @@
|
||||
</userDefinedRuntimeAttribute>
|
||||
</userDefinedRuntimeAttributes>
|
||||
<connections>
|
||||
<outlet property="closeNumberLabel" destination="uWG-zH-Vjo" id="4Fq-wZ-nFd"/>
|
||||
<outlet property="containerView" destination="CGm-93-iX0" id="gSm-z4-RdG"/>
|
||||
<outlet property="containerViewTop" destination="wys-AY-Zdw" id="Exs-1v-4Jn"/>
|
||||
<outlet property="foregroundView" destination="CQr-i9-7br" id="88q-9Z-PtA"/>
|
||||
<outlet property="foregroundViewTop" destination="9tL-QY-I0e" id="shI-yB-FgY"/>
|
||||
<outlet property="openNumberLabel" destination="7eb-NE-XLS" id="mrT-hs-afw"/>
|
||||
</connections>
|
||||
</tableViewCell>
|
||||
</prototypes>
|
||||
|
||||
@@ -10,16 +10,24 @@ import UIKit
|
||||
|
||||
class DemoCell: FoldingCell {
|
||||
|
||||
@IBOutlet weak var closeNumberLabel: UILabel!
|
||||
@IBOutlet weak var openNumberLabel: UILabel!
|
||||
|
||||
var number: Int = 0 {
|
||||
didSet {
|
||||
closeNumberLabel.text = String(number)
|
||||
openNumberLabel.text = String(number)
|
||||
}
|
||||
}
|
||||
override func awakeFromNib() {
|
||||
|
||||
foregroundView.layer.cornerRadius = 10
|
||||
foregroundView.layer.masksToBounds = true
|
||||
|
||||
|
||||
super.awakeFromNib()
|
||||
}
|
||||
|
||||
override func animationDuration(itemIndex:NSInteger, type:AnimationType)-> NSTimeInterval {
|
||||
override func animationDuration(_ itemIndex:NSInteger, type:AnimationType)-> TimeInterval {
|
||||
|
||||
let durations = [0.26, 0.2, 0.2]
|
||||
return durations[itemIndex]
|
||||
|
||||
@@ -24,20 +24,22 @@
|
||||
import UIKit
|
||||
|
||||
/// UITableViewCell with folding animation
|
||||
public class FoldingCell: UITableViewCell {
|
||||
open class FoldingCell: UITableViewCell {
|
||||
|
||||
/// UIView whitch display when cell open
|
||||
@IBOutlet weak public var containerView: UIView!
|
||||
@IBOutlet weak open var containerView: UIView!
|
||||
@IBOutlet weak open var containerViewTop: NSLayoutConstraint!
|
||||
|
||||
/// UIView whitch display when cell close
|
||||
@IBOutlet weak public var foregroundView: RotatedView!
|
||||
@IBOutlet weak open var foregroundView: RotatedView!
|
||||
@IBOutlet weak open var foregroundViewTop: NSLayoutConstraint!
|
||||
var animationView: UIView?
|
||||
|
||||
/// the number of folding elements. Default 2
|
||||
@IBInspectable public var itemCount: NSInteger = 2
|
||||
@IBInspectable open var itemCount: NSInteger = 2
|
||||
|
||||
/// The color of the back cell
|
||||
@IBInspectable public var backViewColor: UIColor = UIColor.brownColor()
|
||||
@IBInspectable open var backViewColor: UIColor = UIColor.brown
|
||||
|
||||
var animationItemViews: [RotatedView]?
|
||||
|
||||
@@ -48,8 +50,8 @@ public class FoldingCell: UITableViewCell {
|
||||
- Close: Close direction
|
||||
*/
|
||||
public enum AnimationType {
|
||||
case Open
|
||||
case Close
|
||||
case open
|
||||
case close
|
||||
}
|
||||
|
||||
// MARK: life cicle
|
||||
@@ -62,7 +64,7 @@ public class FoldingCell: UITableViewCell {
|
||||
super.init(coder: aDecoder)
|
||||
}
|
||||
|
||||
override public func awakeFromNib() {
|
||||
override open func awakeFromNib() {
|
||||
super.awakeFromNib()
|
||||
|
||||
commonInit()
|
||||
@@ -71,10 +73,10 @@ public class FoldingCell: UITableViewCell {
|
||||
/**
|
||||
Call this method in methods init(style: UITableViewCellStyle, reuseIdentifier: String?) after creating Views
|
||||
*/
|
||||
public func commonInit() {
|
||||
open func commonInit() {
|
||||
configureDefaultState()
|
||||
|
||||
self.selectionStyle = .None
|
||||
self.selectionStyle = .none
|
||||
|
||||
containerView.layer.cornerRadius = foregroundView.layer.cornerRadius
|
||||
containerView.layer.masksToBounds = true
|
||||
@@ -84,25 +86,21 @@ public class FoldingCell: UITableViewCell {
|
||||
// MARK: configure
|
||||
|
||||
func configureDefaultState() {
|
||||
let foregroundTopConstraint = self.contentView.constraints.filter{ $0.identifier == "ForegroundViewTop"}.first
|
||||
let containerViewTopConstraint = self.contentView.constraints.filter{ $0.identifier == "ContainerViewTop"}.first
|
||||
|
||||
guard let foregroundConstraint = foregroundTopConstraint else {
|
||||
fatalError("set identifier")
|
||||
}
|
||||
guard let containerConstraint = containerViewTopConstraint else {
|
||||
fatalError("set identifier")
|
||||
guard let foregroundViewTop = self.foregroundViewTop,
|
||||
let containerViewTop = self.containerViewTop else {
|
||||
fatalError("set constratins outlets")
|
||||
}
|
||||
|
||||
containerConstraint.constant = foregroundConstraint.constant
|
||||
containerViewTop.constant = foregroundViewTop.constant
|
||||
containerView.alpha = 0;
|
||||
|
||||
foregroundView.layer.anchorPoint = CGPoint.init(x: 0.5, y: 1)
|
||||
foregroundConstraint.constant += foregroundView.bounds.height / 2
|
||||
foregroundViewTop.constant += foregroundView.bounds.height / 2
|
||||
foregroundView.layer.transform = foregroundView.transform3d()
|
||||
|
||||
createAnimationView();
|
||||
self.contentView.bringSubviewToFront(foregroundView)
|
||||
self.contentView.bringSubview(toFront: foregroundView)
|
||||
}
|
||||
|
||||
func createAnimationItemView()->[RotatedView] {
|
||||
@@ -113,29 +111,29 @@ public class FoldingCell: UITableViewCell {
|
||||
var items = [RotatedView]()
|
||||
items.append(foregroundView)
|
||||
var rotatedViews = [RotatedView]()
|
||||
for case let itemView as RotatedView in animationView.subviews.filter({$0 is RotatedView}).sort({ $0.tag < $1.tag }){
|
||||
for case let itemView as RotatedView in animationView.subviews.filter({$0 is RotatedView}).sorted(by: {$0.tag < $1.tag}) {
|
||||
rotatedViews.append(itemView)
|
||||
if let backView = itemView.backView {
|
||||
rotatedViews.append(backView)
|
||||
}
|
||||
}
|
||||
items.appendContentsOf(rotatedViews)
|
||||
items.append(contentsOf: rotatedViews)
|
||||
return items
|
||||
}
|
||||
|
||||
func configureAnimationItems(animationType: AnimationType) {
|
||||
func configureAnimationItems(_ animationType: AnimationType) {
|
||||
|
||||
guard let animationViewSuperView = animationView?.subviews else {
|
||||
fatalError()
|
||||
}
|
||||
|
||||
if animationType == .Open {
|
||||
if animationType == .open {
|
||||
for view in animationViewSuperView.filter({$0 is RotatedView}) {
|
||||
view.alpha = 0;
|
||||
}
|
||||
} else { // close
|
||||
for case let view as RotatedView in animationViewSuperView.filter({$0 is RotatedView}) {
|
||||
if animationType == .Open {
|
||||
if animationType == .open {
|
||||
view.alpha = 0
|
||||
} else {
|
||||
view.alpha = 1
|
||||
@@ -149,20 +147,20 @@ public class FoldingCell: UITableViewCell {
|
||||
|
||||
let anAnimationView = UIView(frame: containerView.frame)
|
||||
anAnimationView.layer.cornerRadius = foregroundView.layer.cornerRadius
|
||||
anAnimationView.backgroundColor = UIColor.clearColor()
|
||||
anAnimationView.backgroundColor = UIColor.clear
|
||||
anAnimationView.translatesAutoresizingMaskIntoConstraints = false
|
||||
self.contentView.addSubview(anAnimationView)
|
||||
|
||||
// copy constraints from containerView
|
||||
var newConstraints = [NSLayoutConstraint]()
|
||||
for constraint in self.contentView.constraints {
|
||||
if let item = constraint.firstItem as? UIView where item == containerView {
|
||||
if let item = constraint.firstItem as? UIView , item == containerView {
|
||||
let newConstraint = NSLayoutConstraint( item: anAnimationView, attribute: constraint.firstAttribute,
|
||||
relatedBy: constraint.relation, toItem: constraint.secondItem, attribute: constraint.secondAttribute,
|
||||
multiplier: constraint.multiplier, constant: constraint.constant)
|
||||
|
||||
newConstraints.append(newConstraint)
|
||||
} else if let item: UIView = constraint.secondItem as? UIView where item == containerView {
|
||||
} else if let item: UIView = constraint.secondItem as? UIView , item == containerView {
|
||||
let newConstraint = NSLayoutConstraint(item: constraint.firstItem, attribute: constraint.firstAttribute,
|
||||
relatedBy: constraint.relation, toItem: anAnimationView, attribute: constraint.secondAttribute,
|
||||
multiplier: constraint.multiplier, constant: constraint.constant)
|
||||
@@ -173,7 +171,7 @@ public class FoldingCell: UITableViewCell {
|
||||
self.contentView.addConstraints(newConstraints)
|
||||
|
||||
for constraint in containerView.constraints { // added height constraint
|
||||
if constraint.firstAttribute == .Height {
|
||||
if constraint.firstAttribute == .height {
|
||||
let newConstraint = NSLayoutConstraint(item: anAnimationView, attribute: constraint.firstAttribute,
|
||||
relatedBy: constraint.relation, toItem: nil, attribute: constraint.secondAttribute,
|
||||
multiplier: constraint.multiplier, constant: constraint.constant)
|
||||
@@ -244,7 +242,7 @@ public class FoldingCell: UITableViewCell {
|
||||
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 })
|
||||
for case let contener as RotatedView in animationView.subviews.sorted(by: { $0.tag < $1.tag })
|
||||
where contener.tag > 0 && contener.tag < animationView.subviews.count {
|
||||
previusView?.addBackView(contener.bounds.size.height, color: backViewColor)
|
||||
previusView = contener
|
||||
@@ -253,7 +251,7 @@ public class FoldingCell: UITableViewCell {
|
||||
animationItemViews = createAnimationItemView()
|
||||
}
|
||||
|
||||
private func removeImageItemsFromAnimationView() {
|
||||
fileprivate func removeImageItemsFromAnimationView() {
|
||||
|
||||
guard let animationView = self.animationView else {
|
||||
return
|
||||
@@ -272,13 +270,13 @@ public class FoldingCell: UITableViewCell {
|
||||
- parameter animated: Specify true if you want to animate the change in visibility or false if you want immediately.
|
||||
- parameter completion: A block object to be executed when the animation sequence ends.
|
||||
*/
|
||||
public func selectedAnimation(isSelected: Bool, animated: Bool, completion: (Void -> Void)?) {
|
||||
open func selectedAnimation(_ isSelected: Bool, animated: Bool, completion: ((Void) -> Void)?) {
|
||||
|
||||
if isSelected {
|
||||
|
||||
if animated {
|
||||
containerView.alpha = 0;
|
||||
openAnimation(completion: completion)
|
||||
openAnimation(completion)
|
||||
} else {
|
||||
foregroundView.alpha = 0
|
||||
containerView.alpha = 1;
|
||||
@@ -286,7 +284,7 @@ public class FoldingCell: UITableViewCell {
|
||||
|
||||
} else {
|
||||
if animated {
|
||||
closeAnimation(completion: completion)
|
||||
closeAnimation(completion)
|
||||
} else {
|
||||
foregroundView.alpha = 1;
|
||||
containerView.alpha = 0;
|
||||
@@ -294,16 +292,19 @@ public class FoldingCell: UITableViewCell {
|
||||
}
|
||||
}
|
||||
|
||||
public func isAnimating()->Bool {
|
||||
guard let animationItemViews = self.animationItemViews else {
|
||||
open func isAnimating()->Bool {
|
||||
|
||||
|
||||
guard let /*animationItemViews*/_ = self.animationItemViews else {
|
||||
return false
|
||||
}
|
||||
// I found a bug in Xcode 8 (Beta 6) which will lose the reference to the array afterg guard and therefore this check will crash! Hopefully next beta will solve it.
|
||||
|
||||
for item in animationItemViews {
|
||||
if item.layer.animationKeys()?.count > 0 {
|
||||
return true
|
||||
}
|
||||
}
|
||||
// for item in animationItemViews {
|
||||
// if (item.layer.animationKeys()?.count)! > 0 {
|
||||
// return true
|
||||
// }
|
||||
// }
|
||||
|
||||
if animationView?.alpha == 1 {
|
||||
return true
|
||||
@@ -315,22 +316,22 @@ public class FoldingCell: UITableViewCell {
|
||||
|
||||
// MARK: animations
|
||||
|
||||
public func animationDuration(itemIndex:NSInteger, type:AnimationType)-> NSTimeInterval {
|
||||
open func animationDuration(_ itemIndex:NSInteger, type:AnimationType)-> TimeInterval {
|
||||
assert(false, "added this method to cell")
|
||||
return 0
|
||||
}
|
||||
|
||||
func durationSequence(type: AnimationType)-> [NSTimeInterval] {
|
||||
var durations = [NSTimeInterval]()
|
||||
func durationSequence(_ type: AnimationType)-> [TimeInterval] {
|
||||
var durations = [TimeInterval]()
|
||||
for index in 0..<itemCount-1 {
|
||||
let duration = animationDuration(index, type: .Open)
|
||||
durations.append(NSTimeInterval(duration / 2.0))
|
||||
durations.append(NSTimeInterval(duration / 2.0))
|
||||
let duration = animationDuration(index, type: .open)
|
||||
durations.append(TimeInterval(duration / 2.0))
|
||||
durations.append(TimeInterval(duration / 2.0))
|
||||
}
|
||||
return durations
|
||||
}
|
||||
|
||||
func openAnimation(completion completion: (Void -> Void)?) {
|
||||
func openAnimation(_ completion: ((Void) -> Void)?) {
|
||||
|
||||
removeImageItemsFromAnimationView()
|
||||
addImageItemsToAnimationView()
|
||||
@@ -342,14 +343,14 @@ public class FoldingCell: UITableViewCell {
|
||||
animationView.alpha = 1;
|
||||
containerView.alpha = 0;
|
||||
|
||||
let durations = durationSequence(.Open)
|
||||
let durations = durationSequence(.open)
|
||||
|
||||
var delay: NSTimeInterval = 0
|
||||
var delay: TimeInterval = 0
|
||||
var timing = kCAMediaTimingFunctionEaseIn
|
||||
var from: CGFloat = 0.0;
|
||||
var to: CGFloat = CGFloat(-M_PI / 2)
|
||||
var hidden = true
|
||||
configureAnimationItems(.Open)
|
||||
configureAnimationItems(.open)
|
||||
|
||||
guard let animationItemViews = self.animationItemViews else {
|
||||
return
|
||||
@@ -371,18 +372,18 @@ public class FoldingCell: UITableViewCell {
|
||||
|
||||
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
|
||||
}
|
||||
DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + Double(Int64(durations[0] * Double(NSEC_PER_SEC))) / Double(NSEC_PER_SEC), execute: {
|
||||
first.layer.cornerRadius = 0
|
||||
})
|
||||
}
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, Int64(delay * Double(NSEC_PER_SEC))), dispatch_get_main_queue()) { () -> Void in
|
||||
DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + Double(Int64(delay * Double(NSEC_PER_SEC))) / Double(NSEC_PER_SEC), execute: {
|
||||
self.animationView?.alpha = 0
|
||||
self.containerView.alpha = 1
|
||||
completion?()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
func closeAnimation(completion completion: (Void -> Void)?) {
|
||||
func closeAnimation(_ completion: ((Void) -> Void)?) {
|
||||
|
||||
removeImageItemsFromAnimationView()
|
||||
addImageItemsToAnimationView()
|
||||
@@ -394,20 +395,20 @@ public class FoldingCell: UITableViewCell {
|
||||
animationView?.alpha = 1;
|
||||
containerView.alpha = 0;
|
||||
|
||||
var durations: [NSTimeInterval] = durationSequence(.Close).reverse()
|
||||
var durations: [TimeInterval] = durationSequence(.close).reversed()
|
||||
|
||||
var delay: NSTimeInterval = 0
|
||||
var delay: TimeInterval = 0
|
||||
var timing = kCAMediaTimingFunctionEaseIn
|
||||
var from: CGFloat = 0.0;
|
||||
var to: CGFloat = CGFloat(M_PI / 2)
|
||||
var hidden = true
|
||||
configureAnimationItems(.Close)
|
||||
configureAnimationItems(.close)
|
||||
|
||||
if durations.count < animationItemViews.count {
|
||||
fatalError("wrong override func animationDuration(itemIndex:NSInteger, type:AnimationType)-> NSTimeInterval")
|
||||
}
|
||||
for index in 0..<animationItemViews.count {
|
||||
let animatedView = animationItemViews.reverse()[index]
|
||||
let animatedView = animationItemViews.reversed()[index]
|
||||
|
||||
animatedView.foldingAnimation(timing, from: from, to: to, duration: durations[index], delay: delay, hidden: hidden)
|
||||
|
||||
@@ -417,21 +418,20 @@ public class FoldingCell: UITableViewCell {
|
||||
hidden = !hidden
|
||||
delay += durations[index]
|
||||
}
|
||||
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, Int64(delay * Double(NSEC_PER_SEC))), dispatch_get_main_queue()) { () -> Void in
|
||||
DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + Double(Int64(delay * Double(NSEC_PER_SEC))) / Double(NSEC_PER_SEC), execute: {
|
||||
if let animationView = self.animationView {
|
||||
animationView.alpha = 0
|
||||
}
|
||||
completion?()
|
||||
}
|
||||
})
|
||||
|
||||
if let animationView = self.animationView {
|
||||
let firstItemView = animationView.subviews.filter{$0.tag == 0}.first
|
||||
firstItemView?.layer.cornerRadius = 0
|
||||
if let durationLast = durations.last {
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, Int64((delay - durationLast - durationLast / 2.0) * Double(NSEC_PER_SEC))), dispatch_get_main_queue()) { () -> Void in
|
||||
DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + Double(Int64((delay - durationLast - durationLast / 2.0) * Double(NSEC_PER_SEC))) / Double(NSEC_PER_SEC), execute: {
|
||||
firstItemView?.layer.cornerRadius = self.foregroundView.layer.cornerRadius
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -440,11 +440,11 @@ public class FoldingCell: UITableViewCell {
|
||||
|
||||
// MARK: RotatedView
|
||||
|
||||
public class RotatedView: UIView {
|
||||
open class RotatedView: UIView {
|
||||
var hiddenAfterAnimation = false
|
||||
var backView: RotatedView?
|
||||
|
||||
func addBackView(height: CGFloat, color:UIColor) {
|
||||
func addBackView(_ height: CGFloat, color:UIColor) {
|
||||
let view = RotatedView(frame: CGRect.zero)
|
||||
view.backgroundColor = color
|
||||
view.layer.anchorPoint = CGPoint.init(x: 0.5, y: 1)
|
||||
@@ -453,24 +453,24 @@ public class RotatedView: UIView {
|
||||
self.addSubview(view)
|
||||
backView = view
|
||||
|
||||
view.addConstraint(NSLayoutConstraint(item: view, attribute: .Height, relatedBy: .Equal, toItem: nil,attribute: .Height,
|
||||
view.addConstraint(NSLayoutConstraint(item: view, attribute: .height, relatedBy: .equal, toItem: nil,attribute: .height,
|
||||
multiplier: 1, constant: height))
|
||||
|
||||
self.addConstraints([
|
||||
NSLayoutConstraint(item: view, attribute: .Top, relatedBy: .Equal, toItem: self, attribute: .Top, multiplier: 1,
|
||||
NSLayoutConstraint(item: view, attribute: .top, relatedBy: .equal, toItem: self, attribute: .top, multiplier: 1,
|
||||
constant: self.bounds.size.height - height + height / 2),
|
||||
NSLayoutConstraint(item: view, attribute: .Leading, relatedBy: .Equal, toItem: self, attribute: .Leading,
|
||||
NSLayoutConstraint(item: view, attribute: .leading, relatedBy: .equal, toItem: self, attribute: .leading,
|
||||
multiplier: 1, constant: 0),
|
||||
NSLayoutConstraint(item: view, attribute: .Trailing, relatedBy: .Equal, toItem: self, attribute: .Trailing,
|
||||
NSLayoutConstraint(item: view, attribute: .trailing, relatedBy: .equal, toItem: self, attribute: .trailing,
|
||||
multiplier: 1, constant: 0)
|
||||
])
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
extension RotatedView {
|
||||
extension RotatedView: CAAnimationDelegate {
|
||||
|
||||
func rotatedX(angle : CGFloat) {
|
||||
func rotatedX(_ angle : CGFloat) {
|
||||
var allTransofrom = CATransform3DIdentity;
|
||||
let rotateTransform = CATransform3DMakeRotation(angle, 1, 0, 0)
|
||||
allTransofrom = CATransform3DConcat(allTransofrom, rotateTransform)
|
||||
@@ -486,7 +486,7 @@ extension RotatedView {
|
||||
|
||||
// MARK: animations
|
||||
|
||||
func foldingAnimation(timing: String, from: CGFloat, to: CGFloat, duration: NSTimeInterval, delay:NSTimeInterval, hidden:Bool) {
|
||||
func foldingAnimation(_ timing: String, from: CGFloat, to: CGFloat, duration: TimeInterval, delay:TimeInterval, hidden:Bool) {
|
||||
|
||||
let rotateAnimation = CABasicAnimation(keyPath: "transform.rotation.x")
|
||||
rotateAnimation.timingFunction = CAMediaTimingFunction(name: timing)
|
||||
@@ -495,20 +495,20 @@ extension RotatedView {
|
||||
rotateAnimation.duration = duration
|
||||
rotateAnimation.delegate = self;
|
||||
rotateAnimation.fillMode = kCAFillModeForwards
|
||||
rotateAnimation.removedOnCompletion = false;
|
||||
rotateAnimation.isRemovedOnCompletion = false;
|
||||
rotateAnimation.beginTime = CACurrentMediaTime() + delay
|
||||
|
||||
self.hiddenAfterAnimation = hidden
|
||||
|
||||
self.layer.addAnimation(rotateAnimation, forKey: "rotation.x")
|
||||
self.layer.add(rotateAnimation, forKey: "rotation.x")
|
||||
}
|
||||
|
||||
override public func animationDidStart(anim: CAAnimation) {
|
||||
public func animationDidStart(_ anim: CAAnimation) {
|
||||
self.layer.shouldRasterize = true
|
||||
self.alpha = 1
|
||||
}
|
||||
|
||||
override public func animationDidStop(anim: CAAnimation, finished flag: Bool) {
|
||||
public func animationDidStop(_ anim: CAAnimation, finished flag: Bool) {
|
||||
if hiddenAfterAnimation {
|
||||
self.alpha = 0
|
||||
}
|
||||
@@ -519,20 +519,20 @@ 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)
|
||||
context!.translateBy(x: frame.origin.x * -1, y: frame.origin.y * -1)
|
||||
|
||||
guard let currentContext = UIGraphicsGetCurrentContext() else {
|
||||
return nil
|
||||
}
|
||||
|
||||
self.layer.renderInContext(currentContext)
|
||||
self.layer.render(in: currentContext)
|
||||
let image = UIGraphicsGetImageFromCurrentImageContext()
|
||||
UIGraphicsEndImageContext()
|
||||
|
||||
return image
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,56 +48,59 @@ class MainTableViewController: UITableViewController {
|
||||
|
||||
// MARK: - Table view data source
|
||||
|
||||
override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
|
||||
override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
|
||||
return 10
|
||||
}
|
||||
|
||||
override func tableView(tableView: UITableView, willDisplayCell cell: UITableViewCell, forRowAtIndexPath indexPath: NSIndexPath) {
|
||||
|
||||
if cell is FoldingCell {
|
||||
let foldingCell = cell as! FoldingCell
|
||||
foldingCell.backgroundColor = UIColor.clearColor()
|
||||
|
||||
if cellHeights[indexPath.row] == kCloseCellHeight {
|
||||
foldingCell.selectedAnimation(false, animated: false, completion:nil)
|
||||
} else {
|
||||
foldingCell.selectedAnimation(true, animated: false, completion: nil)
|
||||
}
|
||||
}
|
||||
override func tableView(_ tableView: UITableView, willDisplay cell: UITableViewCell, forRowAt indexPath: IndexPath) {
|
||||
|
||||
guard case let cell as DemoCell = cell else {
|
||||
return
|
||||
}
|
||||
|
||||
cell.backgroundColor = UIColor.clear
|
||||
|
||||
if cellHeights[(indexPath as NSIndexPath).row] == kCloseCellHeight {
|
||||
cell.selectedAnimation(false, animated: false, completion:nil)
|
||||
} else {
|
||||
cell.selectedAnimation(true, animated: false, completion: nil)
|
||||
}
|
||||
|
||||
cell.number = (indexPath as NSIndexPath).row
|
||||
}
|
||||
|
||||
override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
|
||||
let cell = tableView.dequeueReusableCellWithIdentifier("FoldingCell", forIndexPath: indexPath)
|
||||
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
|
||||
let cell = tableView.dequeueReusableCell(withIdentifier: "FoldingCell", for: indexPath)
|
||||
|
||||
return cell
|
||||
}
|
||||
|
||||
override func tableView(tableView: UITableView, heightForRowAtIndexPath indexPath: NSIndexPath) -> CGFloat {
|
||||
return cellHeights[indexPath.row]
|
||||
override func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
|
||||
return cellHeights[(indexPath as NSIndexPath).row]
|
||||
}
|
||||
|
||||
// MARK: Table vie delegate
|
||||
|
||||
override func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
|
||||
override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
|
||||
|
||||
let cell = tableView.cellForRowAtIndexPath(indexPath) as! FoldingCell
|
||||
let cell = tableView.cellForRow(at: indexPath) as! FoldingCell
|
||||
|
||||
if cell.isAnimating() {
|
||||
return
|
||||
}
|
||||
|
||||
var duration = 0.0
|
||||
if cellHeights[indexPath.row] == kCloseCellHeight { // open cell
|
||||
cellHeights[indexPath.row] = kOpenCellHeight
|
||||
if cellHeights[(indexPath as NSIndexPath).row] == kCloseCellHeight { // open cell
|
||||
cellHeights[(indexPath as NSIndexPath).row] = kOpenCellHeight
|
||||
cell.selectedAnimation(true, animated: true, completion: nil)
|
||||
duration = 0.5
|
||||
} else {// close cell
|
||||
cellHeights[indexPath.row] = kCloseCellHeight
|
||||
cellHeights[(indexPath as NSIndexPath).row] = kCloseCellHeight
|
||||
cell.selectedAnimation(false, animated: true, completion: nil)
|
||||
duration = 0.8
|
||||
}
|
||||
|
||||
UIView.animateWithDuration(duration, delay: 0, options: .CurveEaseOut, animations: { () -> Void in
|
||||
UIView.animate(withDuration: duration, delay: 0, options: .curveEaseOut, animations: { () -> Void in
|
||||
tableView.beginUpdates()
|
||||
tableView.endUpdates()
|
||||
}, completion: nil)
|
||||
|
||||
@@ -16,7 +16,7 @@ class FoldingCellTests: XCTestCase {
|
||||
super.setUp()
|
||||
|
||||
let storyboard = UIStoryboard(name: "Main", bundle: nil)
|
||||
viewController = storyboard.instantiateViewControllerWithIdentifier("MainTableViewController") as! UITableViewController
|
||||
viewController = storyboard.instantiateViewController(withIdentifier: "MainTableViewController") as! UITableViewController
|
||||
viewController.beginAppearanceTransition(true, animated: false)
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ class FoldingCellTests: XCTestCase {
|
||||
func testExample() {
|
||||
let tableView = viewController.tableView
|
||||
|
||||
for case let cell as FoldingCell in tableView.visibleCells {
|
||||
for case let cell as FoldingCell in (tableView?.visibleCells)! {
|
||||
XCTAssertTrue(cell.itemCount >= 2)
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ class FoldingCellTests: XCTestCase {
|
||||
|
||||
func testPerformanceExample() {
|
||||
// This is an example of a performance test case.
|
||||
self.measureBlock {
|
||||
self.measure {
|
||||
// Put the code you want to measure the time of here.
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||

|
||||
[](https://business.ramotion.com?utm_source=gthb&utm_medium=special&utm_campaign=foolding-cell-logo)
|
||||
# FoldingCell
|
||||
[](https://cocoapods.org/pods/FoldingCell)
|
||||
[](http://cocoapods.org/pods/FoldingCell)
|
||||
@@ -9,8 +9,11 @@
|
||||
[](https://codebeat.co/projects/github-com-ramotion-folding-cell)
|
||||
[](https://github.com/Carthage/Carthage)
|
||||
|
||||
[shot on dribbble](https://dribbble.com/shots/2121350-Delivery-Card):
|
||||

|
||||
|
||||
## About
|
||||
This project is maintained by Ramotion, an agency specialized in building dedicated engineering teams and developing custom software.<br><br> [Contact our team](https://business.ramotion.com?utm_source=gthb&utm_medium=special&utm_campaign=foolding-cell-contact-us) and we’ll help you work with the best engineers from Eastern Europe.
|
||||
|
||||
[](https://dribbble.com/shots/2121350-Delivery-Card)
|
||||
|
||||
|
||||
The [iPhone mockup](https://store.ramotion.com/product/iphone-6-mockups?utm_source=gthb&utm_medium=special&utm_campaign=folding-cell) available [here](https://store.ramotion.com/product/iphone-6-mockups?utm_source=gthb&utm_medium=special&utm_campaign=folding-cell).
|
||||
@@ -25,7 +28,7 @@ Just add the FoldingCell.swift file to your project.
|
||||
|
||||
or use [CocoaPods](https://cocoapods.org) with Podfile:
|
||||
``` ruby
|
||||
pod 'FoldingCell', '~> 0.8.1'
|
||||
pod 'FoldingCell'
|
||||
```
|
||||
|
||||
or [Carthage](https://github.com/Carthage/Carthage) users can simply add Mantle to their `Cartfile`:
|
||||
@@ -45,15 +48,15 @@ Add constraints from this view to the superview, as in this picture:
|
||||
|
||||

|
||||
|
||||
(constants of constraints may be different). Add the identifier `ForegroundViewTop`
|
||||
for the top constraint. (This view will be shown when the cell is in its normal state).
|
||||
(constants of constraints may be different). Connect the outlet from this top constraint to the cell property `foregroundViewTop`
|
||||
. (This view will be shown when the cell is in its normal state).
|
||||
|
||||
3) Add other UIViews to your cell, connect the outlet from this view to the cell
|
||||
property `containerView`. Add constraints from this view to the superview like in the picture:
|
||||
|
||||

|
||||
|
||||
(constants of constraints may be different). Add the identifier "ContainerViewTop" for the top constraint.
|
||||
(constants of constraints may be different). Connect the outlet from this top constraint to the cell property `containerViewTop`.
|
||||
(This view will be shown when the cell is opened)
|
||||
|
||||
Your result should be something like this picture:
|
||||
@@ -157,9 +160,7 @@ Folding cell is released under the MIT license.
|
||||
See [LICENSE](./LICENSE) for details.
|
||||
|
||||
|
||||
## About
|
||||
The project maintained by [app development agency](https://ramotion.com?utm_source=gthb&utm_medium=special&utm_campaign=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.
|
||||
## Follow Us
|
||||
|
||||
[](https://twitter.com/intent/tweet?text=https://github.com/ramotion/foolding-cell)
|
||||
[](https://twitter.com/ramotion)
|
||||
|
||||
+5
-5
@@ -13,12 +13,12 @@
|
||||
<a title="Classes Reference"></a>
|
||||
<header>
|
||||
<div class="content-wrapper">
|
||||
<p><a href="index.html">FoldingCellDemo Docs</a> (47% documented)</p>
|
||||
<p><a href="index.html">FoldingCell Docs</a> (42% documented)</p>
|
||||
</div>
|
||||
</header>
|
||||
<div class="content-wrapper">
|
||||
<p id="breadcrumbs">
|
||||
<a href="index.html">FoldingCellDemo Reference</a>
|
||||
<a href="index.html">FoldingCell Reference</a>
|
||||
<img id="carat" src="img/carat.png" />
|
||||
Classes Reference
|
||||
</p>
|
||||
@@ -49,9 +49,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:C15FoldingCellDemo11FoldingCell"></a>
|
||||
<a name="/s:C11FoldingCell11FoldingCell"></a>
|
||||
<a name="//apple_ref/swift/Class/FoldingCell" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:C15FoldingCellDemo11FoldingCell">FoldingCell</a>
|
||||
<a class="token" href="#/s:C11FoldingCell11FoldingCell">FoldingCell</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -79,7 +79,7 @@
|
||||
</section>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2016 <a class="link" href="" target="_blank" rel="external">AlexKalinkin</a>. All rights reserved. (Last updated: 2016-06-10)</p>
|
||||
<p>© 2016 <a class="link" href="" target="_blank" rel="external">AlexKalinkin</a>. All rights reserved. (Last updated: 2016-06-15)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.5.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
|
||||
@@ -14,12 +14,12 @@
|
||||
<a title="FoldingCell Class Reference"></a>
|
||||
<header>
|
||||
<div class="content-wrapper">
|
||||
<p><a href="../index.html">FoldingCellDemo Docs</a> (47% documented)</p>
|
||||
<p><a href="../index.html">FoldingCell Docs</a> (42% documented)</p>
|
||||
</div>
|
||||
</header>
|
||||
<div class="content-wrapper">
|
||||
<p id="breadcrumbs">
|
||||
<a href="../index.html">FoldingCellDemo Reference</a>
|
||||
<a href="../index.html">FoldingCell Reference</a>
|
||||
<img id="carat" src="../img/carat.png" />
|
||||
FoldingCell Class Reference
|
||||
</p>
|
||||
@@ -56,9 +56,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:vC15FoldingCellDemo11FoldingCell13containerViewXwGSQCSo6UIView_"></a>
|
||||
<a name="/s:vC11FoldingCell11FoldingCell13containerViewXwGSQCSo6UIView_"></a>
|
||||
<a name="//apple_ref/swift/Property/containerView" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:vC15FoldingCellDemo11FoldingCell13containerViewXwGSQCSo6UIView_">containerView</a>
|
||||
<a class="token" href="#/s:vC11FoldingCell11FoldingCell13containerViewXwGSQCSo6UIView_">containerView</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -83,9 +83,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:vC15FoldingCellDemo11FoldingCell14foregroundViewXwGSQCS_11RotatedView_"></a>
|
||||
<a name="/s:vC11FoldingCell11FoldingCell14foregroundViewXwGSQCS_11RotatedView_"></a>
|
||||
<a name="//apple_ref/swift/Property/foregroundView" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:vC15FoldingCellDemo11FoldingCell14foregroundViewXwGSQCS_11RotatedView_">foregroundView</a>
|
||||
<a class="token" href="#/s:vC11FoldingCell11FoldingCell14foregroundViewXwGSQCS_11RotatedView_">foregroundView</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -110,9 +110,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:vC15FoldingCellDemo11FoldingCell9itemCountSi"></a>
|
||||
<a name="/s:vC11FoldingCell11FoldingCell9itemCountSi"></a>
|
||||
<a name="//apple_ref/swift/Property/itemCount" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:vC15FoldingCellDemo11FoldingCell9itemCountSi">itemCount</a>
|
||||
<a class="token" href="#/s:vC11FoldingCell11FoldingCell9itemCountSi">itemCount</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -137,9 +137,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:vC15FoldingCellDemo11FoldingCell13backViewColorCSo7UIColor"></a>
|
||||
<a name="/s:vC11FoldingCell11FoldingCell13backViewColorCSo7UIColor"></a>
|
||||
<a name="//apple_ref/swift/Property/backViewColor" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:vC15FoldingCellDemo11FoldingCell13backViewColorCSo7UIColor">backViewColor</a>
|
||||
<a class="token" href="#/s:vC11FoldingCell11FoldingCell13backViewColorCSo7UIColor">backViewColor</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -164,9 +164,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:OC15FoldingCellDemo11FoldingCell13AnimationType"></a>
|
||||
<a name="/s:OC11FoldingCell11FoldingCell13AnimationType"></a>
|
||||
<a name="//apple_ref/swift/Enum/AnimationType" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:OC15FoldingCellDemo11FoldingCell13AnimationType">AnimationType</a>
|
||||
<a class="token" href="#/s:OC11FoldingCell11FoldingCell13AnimationType">AnimationType</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -207,9 +207,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FC15FoldingCellDemo11FoldingCell10commonInitFT_T_"></a>
|
||||
<a name="/s:FC11FoldingCell11FoldingCell10commonInitFT_T_"></a>
|
||||
<a name="//apple_ref/swift/Method/commonInit()" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FC15FoldingCellDemo11FoldingCell10commonInitFT_T_">commonInit()</a>
|
||||
<a class="token" href="#/s:FC11FoldingCell11FoldingCell10commonInitFT_T_">commonInit()</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -245,9 +245,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FC15FoldingCellDemo11FoldingCell17selectedAnimationFTSb8animatedSb10completionGSqFT_T___T_"></a>
|
||||
<a name="/s:FC11FoldingCell11FoldingCell17selectedAnimationFTSb8animatedSb10completionGSqFT_T___T_"></a>
|
||||
<a name="//apple_ref/swift/Method/selectedAnimation(_:animated:completion:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FC15FoldingCellDemo11FoldingCell17selectedAnimationFTSb8animatedSb10completionGSqFT_T___T_">selectedAnimation(_:animated:completion:)</a>
|
||||
<a class="token" href="#/s:FC11FoldingCell11FoldingCell17selectedAnimationFTSb8animatedSb10completionGSqFT_T___T_">selectedAnimation(_:animated:completion:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -320,7 +320,7 @@
|
||||
</section>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2016 <a class="link" href="" target="_blank" rel="external">AlexKalinkin</a>. All rights reserved. (Last updated: 2016-06-10)</p>
|
||||
<p>© 2016 <a class="link" href="" target="_blank" rel="external">AlexKalinkin</a>. All rights reserved. (Last updated: 2016-06-15)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.5.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
|
||||
+2
-2
@@ -3,9 +3,9 @@
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>com.jazzy.foldingcelldemo</string>
|
||||
<string>com.jazzy.foldingcell</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>FoldingCellDemo</string>
|
||||
<string>FoldingCell</string>
|
||||
<key>DocSetPlatformFamily</key>
|
||||
<string>jazzy</string>
|
||||
<key>isDashDocset</key>
|
||||
+5
-5
@@ -13,12 +13,12 @@
|
||||
<a title="Classes Reference"></a>
|
||||
<header>
|
||||
<div class="content-wrapper">
|
||||
<p><a href="index.html">FoldingCellDemo Docs</a> (47% documented)</p>
|
||||
<p><a href="index.html">FoldingCell Docs</a> (42% documented)</p>
|
||||
</div>
|
||||
</header>
|
||||
<div class="content-wrapper">
|
||||
<p id="breadcrumbs">
|
||||
<a href="index.html">FoldingCellDemo Reference</a>
|
||||
<a href="index.html">FoldingCell Reference</a>
|
||||
<img id="carat" src="img/carat.png" />
|
||||
Classes Reference
|
||||
</p>
|
||||
@@ -49,9 +49,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:C15FoldingCellDemo11FoldingCell"></a>
|
||||
<a name="/s:C11FoldingCell11FoldingCell"></a>
|
||||
<a name="//apple_ref/swift/Class/FoldingCell" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:C15FoldingCellDemo11FoldingCell">FoldingCell</a>
|
||||
<a class="token" href="#/s:C11FoldingCell11FoldingCell">FoldingCell</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -79,7 +79,7 @@
|
||||
</section>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2016 <a class="link" href="" target="_blank" rel="external">AlexKalinkin</a>. All rights reserved. (Last updated: 2016-06-10)</p>
|
||||
<p>© 2016 <a class="link" href="" target="_blank" rel="external">AlexKalinkin</a>. All rights reserved. (Last updated: 2016-06-15)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.5.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
+17
-17
@@ -14,12 +14,12 @@
|
||||
<a title="FoldingCell Class Reference"></a>
|
||||
<header>
|
||||
<div class="content-wrapper">
|
||||
<p><a href="../index.html">FoldingCellDemo Docs</a> (47% documented)</p>
|
||||
<p><a href="../index.html">FoldingCell Docs</a> (42% documented)</p>
|
||||
</div>
|
||||
</header>
|
||||
<div class="content-wrapper">
|
||||
<p id="breadcrumbs">
|
||||
<a href="../index.html">FoldingCellDemo Reference</a>
|
||||
<a href="../index.html">FoldingCell Reference</a>
|
||||
<img id="carat" src="../img/carat.png" />
|
||||
FoldingCell Class Reference
|
||||
</p>
|
||||
@@ -56,9 +56,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:vC15FoldingCellDemo11FoldingCell13containerViewXwGSQCSo6UIView_"></a>
|
||||
<a name="/s:vC11FoldingCell11FoldingCell13containerViewXwGSQCSo6UIView_"></a>
|
||||
<a name="//apple_ref/swift/Property/containerView" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:vC15FoldingCellDemo11FoldingCell13containerViewXwGSQCSo6UIView_">containerView</a>
|
||||
<a class="token" href="#/s:vC11FoldingCell11FoldingCell13containerViewXwGSQCSo6UIView_">containerView</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -83,9 +83,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:vC15FoldingCellDemo11FoldingCell14foregroundViewXwGSQCS_11RotatedView_"></a>
|
||||
<a name="/s:vC11FoldingCell11FoldingCell14foregroundViewXwGSQCS_11RotatedView_"></a>
|
||||
<a name="//apple_ref/swift/Property/foregroundView" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:vC15FoldingCellDemo11FoldingCell14foregroundViewXwGSQCS_11RotatedView_">foregroundView</a>
|
||||
<a class="token" href="#/s:vC11FoldingCell11FoldingCell14foregroundViewXwGSQCS_11RotatedView_">foregroundView</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -110,9 +110,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:vC15FoldingCellDemo11FoldingCell9itemCountSi"></a>
|
||||
<a name="/s:vC11FoldingCell11FoldingCell9itemCountSi"></a>
|
||||
<a name="//apple_ref/swift/Property/itemCount" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:vC15FoldingCellDemo11FoldingCell9itemCountSi">itemCount</a>
|
||||
<a class="token" href="#/s:vC11FoldingCell11FoldingCell9itemCountSi">itemCount</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -137,9 +137,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:vC15FoldingCellDemo11FoldingCell13backViewColorCSo7UIColor"></a>
|
||||
<a name="/s:vC11FoldingCell11FoldingCell13backViewColorCSo7UIColor"></a>
|
||||
<a name="//apple_ref/swift/Property/backViewColor" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:vC15FoldingCellDemo11FoldingCell13backViewColorCSo7UIColor">backViewColor</a>
|
||||
<a class="token" href="#/s:vC11FoldingCell11FoldingCell13backViewColorCSo7UIColor">backViewColor</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -164,9 +164,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:OC15FoldingCellDemo11FoldingCell13AnimationType"></a>
|
||||
<a name="/s:OC11FoldingCell11FoldingCell13AnimationType"></a>
|
||||
<a name="//apple_ref/swift/Enum/AnimationType" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:OC15FoldingCellDemo11FoldingCell13AnimationType">AnimationType</a>
|
||||
<a class="token" href="#/s:OC11FoldingCell11FoldingCell13AnimationType">AnimationType</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -207,9 +207,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FC15FoldingCellDemo11FoldingCell10commonInitFT_T_"></a>
|
||||
<a name="/s:FC11FoldingCell11FoldingCell10commonInitFT_T_"></a>
|
||||
<a name="//apple_ref/swift/Method/commonInit()" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FC15FoldingCellDemo11FoldingCell10commonInitFT_T_">commonInit()</a>
|
||||
<a class="token" href="#/s:FC11FoldingCell11FoldingCell10commonInitFT_T_">commonInit()</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -245,9 +245,9 @@
|
||||
<li class="item">
|
||||
<div>
|
||||
<code>
|
||||
<a name="/s:FC15FoldingCellDemo11FoldingCell17selectedAnimationFTSb8animatedSb10completionGSqFT_T___T_"></a>
|
||||
<a name="/s:FC11FoldingCell11FoldingCell17selectedAnimationFTSb8animatedSb10completionGSqFT_T___T_"></a>
|
||||
<a name="//apple_ref/swift/Method/selectedAnimation(_:animated:completion:)" class="dashAnchor"></a>
|
||||
<a class="token" href="#/s:FC15FoldingCellDemo11FoldingCell17selectedAnimationFTSb8animatedSb10completionGSqFT_T___T_">selectedAnimation(_:animated:completion:)</a>
|
||||
<a class="token" href="#/s:FC11FoldingCell11FoldingCell17selectedAnimationFTSb8animatedSb10completionGSqFT_T___T_">selectedAnimation(_:animated:completion:)</a>
|
||||
</code>
|
||||
</div>
|
||||
<div class="height-container">
|
||||
@@ -320,7 +320,7 @@
|
||||
</section>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2016 <a class="link" href="" target="_blank" rel="external">AlexKalinkin</a>. All rights reserved. (Last updated: 2016-06-10)</p>
|
||||
<p>© 2016 <a class="link" href="" target="_blank" rel="external">AlexKalinkin</a>. All rights reserved. (Last updated: 2016-06-15)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.5.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
|
Before Width: | Height: | Size: 274 B After Width: | Height: | Size: 274 B |
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
+9
-9
@@ -1,7 +1,7 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>FoldingCellDemo Reference</title>
|
||||
<title>FoldingCell Reference</title>
|
||||
<link rel="stylesheet" type="text/css" href="css/jazzy.css" />
|
||||
<link rel="stylesheet" type="text/css" href="css/highlight.css" />
|
||||
<meta charset='utf-8'>
|
||||
@@ -10,17 +10,17 @@
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<a title="FoldingCellDemo Reference"></a>
|
||||
<a title="FoldingCell Reference"></a>
|
||||
<header>
|
||||
<div class="content-wrapper">
|
||||
<p><a href="index.html">FoldingCellDemo Docs</a> (47% documented)</p>
|
||||
<p><a href="index.html">FoldingCell Docs</a> (42% documented)</p>
|
||||
</div>
|
||||
</header>
|
||||
<div class="content-wrapper">
|
||||
<p id="breadcrumbs">
|
||||
<a href="index.html">FoldingCellDemo Reference</a>
|
||||
<a href="index.html">FoldingCell Reference</a>
|
||||
<img id="carat" src="img/carat.png" />
|
||||
FoldingCellDemo Reference
|
||||
FoldingCell Reference
|
||||
</p>
|
||||
</div>
|
||||
<div class="content-wrapper">
|
||||
@@ -88,15 +88,15 @@ Add constraints from this view to the superview, as in this picture:</p>
|
||||
|
||||
<p><img src="https://raw.githubusercontent.com/Ramotion/folding-cell/master/Tutorial-resources/1.1.png" alt="1.1"></p>
|
||||
|
||||
<p>(constants of constraints may be different). Add the identifier <code>ForegroundViewTop</code>
|
||||
for the top constraint. (This view will be shown when the cell is in its normal state).</p>
|
||||
<p>(constants of constraints may be different). Connect the outlet from this top constraint to the cell property <code>foregroundViewTop</code>
|
||||
. (This view will be shown when the cell is in its normal state).</p>
|
||||
|
||||
<p>3) Add other UIViews to your cell, connect the outlet from this view to the cell
|
||||
property <code>containerView</code>. Add constraints from this view to the superview like in the picture:</p>
|
||||
|
||||
<p><img src="https://raw.githubusercontent.com/Ramotion/folding-cell/master/Tutorial-resources/1.2.png" alt="1.2"></p>
|
||||
|
||||
<p>(constants of constraints may be different). Add the identifier <q>ContainerViewTop</q> for the top constraint.
|
||||
<p>(constants of constraints may be different). Connect the outlet from this top constraint to the cell property <code>containerViewTop</code>.
|
||||
(This view will be shown when the cell is opened)</p>
|
||||
|
||||
<p>Your result should be something like this picture:</p>
|
||||
@@ -206,7 +206,7 @@ See our other [open-source projects](https://github.com/ramotion) or [hire](http
|
||||
</section>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2016 <a class="link" href="" target="_blank" rel="external">AlexKalinkin</a>. All rights reserved. (Last updated: 2016-06-10)</p>
|
||||
<p>© 2016 <a class="link" href="" target="_blank" rel="external">AlexKalinkin</a>. All rights reserved. (Last updated: 2016-06-15)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.5.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
+2
@@ -1,4 +1,6 @@
|
||||
FoldingCell.swift
|
||||
@IBOutlet weak public var containerViewTop: NSLayoutConstraint!
|
||||
@IBOutlet weak public var foregroundViewTop: NSLayoutConstraint!
|
||||
case Open
|
||||
case Close
|
||||
override public init(style: UITableViewCellStyle, reuseIdentifier: String?)
|
||||
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
+9
-9
@@ -1,7 +1,7 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>FoldingCellDemo Reference</title>
|
||||
<title>FoldingCell Reference</title>
|
||||
<link rel="stylesheet" type="text/css" href="css/jazzy.css" />
|
||||
<link rel="stylesheet" type="text/css" href="css/highlight.css" />
|
||||
<meta charset='utf-8'>
|
||||
@@ -10,17 +10,17 @@
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<a title="FoldingCellDemo Reference"></a>
|
||||
<a title="FoldingCell Reference"></a>
|
||||
<header>
|
||||
<div class="content-wrapper">
|
||||
<p><a href="index.html">FoldingCellDemo Docs</a> (47% documented)</p>
|
||||
<p><a href="index.html">FoldingCell Docs</a> (42% documented)</p>
|
||||
</div>
|
||||
</header>
|
||||
<div class="content-wrapper">
|
||||
<p id="breadcrumbs">
|
||||
<a href="index.html">FoldingCellDemo Reference</a>
|
||||
<a href="index.html">FoldingCell Reference</a>
|
||||
<img id="carat" src="img/carat.png" />
|
||||
FoldingCellDemo Reference
|
||||
FoldingCell Reference
|
||||
</p>
|
||||
</div>
|
||||
<div class="content-wrapper">
|
||||
@@ -88,15 +88,15 @@ Add constraints from this view to the superview, as in this picture:</p>
|
||||
|
||||
<p><img src="https://raw.githubusercontent.com/Ramotion/folding-cell/master/Tutorial-resources/1.1.png" alt="1.1"></p>
|
||||
|
||||
<p>(constants of constraints may be different). Add the identifier <code>ForegroundViewTop</code>
|
||||
for the top constraint. (This view will be shown when the cell is in its normal state).</p>
|
||||
<p>(constants of constraints may be different). Connect the outlet from this top constraint to the cell property <code>foregroundViewTop</code>
|
||||
. (This view will be shown when the cell is in its normal state).</p>
|
||||
|
||||
<p>3) Add other UIViews to your cell, connect the outlet from this view to the cell
|
||||
property <code>containerView</code>. Add constraints from this view to the superview like in the picture:</p>
|
||||
|
||||
<p><img src="https://raw.githubusercontent.com/Ramotion/folding-cell/master/Tutorial-resources/1.2.png" alt="1.2"></p>
|
||||
|
||||
<p>(constants of constraints may be different). Add the identifier <q>ContainerViewTop</q> for the top constraint.
|
||||
<p>(constants of constraints may be different). Connect the outlet from this top constraint to the cell property <code>containerViewTop</code>.
|
||||
(This view will be shown when the cell is opened)</p>
|
||||
|
||||
<p>Your result should be something like this picture:</p>
|
||||
@@ -206,7 +206,7 @@ See our other [open-source projects](https://github.com/ramotion) or [hire](http
|
||||
</section>
|
||||
</section>
|
||||
<section id="footer">
|
||||
<p>© 2016 <a class="link" href="" target="_blank" rel="external">AlexKalinkin</a>. All rights reserved. (Last updated: 2016-06-10)</p>
|
||||
<p>© 2016 <a class="link" href="" target="_blank" rel="external">AlexKalinkin</a>. All rights reserved. (Last updated: 2016-06-15)</p>
|
||||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.5.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
|
||||
</section>
|
||||
</article>
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
FoldingCell.swift
|
||||
@IBOutlet weak public var containerViewTop: NSLayoutConstraint!
|
||||
@IBOutlet weak public var foregroundViewTop: NSLayoutConstraint!
|
||||
case Open
|
||||
case Close
|
||||
override public init(style: UITableViewCellStyle, reuseIdentifier: String?)
|
||||
|
||||
Reference in New Issue
Block a user