Compare commits

...
10 Commits
Author SHA1 Message Date
Alex.k 1ebd9b3e6f Fixes #26 2016-03-09 12:00:55 +03:00
Alex.k b7dc1f1d75 podspec updated 2016-03-09 09:16:43 +03:00
Artem Kyslicyn 21e64f72c1 Merge pull request #24 from Ramotion/develop
upd
2016-02-26 12:07:15 +03:00
Artem Kislitsyn 33dfe08a96 upd 2016-02-26 12:02:34 +03:00
Alex 9d0982e62d Merge pull request #23 from Ramotion/develop
update doc
2016-02-26 11:48:39 +03:00
Artem Kislitsyn b1b564e1e9 update doc 2016-02-26 11:40:55 +03:00
Alex 3ca2172098 Update README.md 2016-02-24 10:22:58 +03:00
Alex.k 9ea71b64eb public properties: itemCount, backViewColor 2016-02-24 10:12:26 +03:00
Alex 306632b484 Update README.md 2016-02-15 14:47:02 +03:00
Alex.k def7ad435b update podspec 2016-02-15 14:45:30 +03:00
5 changed files with 25 additions and 14 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'FoldingCell'
s.version = '0.7'
s.version = '0.7.2'
s.summary = 'UITableViewCell with folding animation.'
s.homepage = 'https://github.com/Ramotion/folding-cell'
s.license = 'MIT'
@@ -225,7 +225,7 @@
TargetAttributes = {
847A58031C294F750028FB84 = {
CreatedOnToolsVersion = 7.2;
DevelopmentTeam = 34MUF9YXTA;
DevelopmentTeam = LEAZS7L33U;
};
8498513B1C5639F9006FA400 = {
CreatedOnToolsVersion = 7.2;
@@ -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="9531" systemVersion="15C50" 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="9532" systemVersion="15D21" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="0cn-rv-Emg">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9529"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9530"/>
</dependencies>
<customFonts key="customFonts">
<mutableArray key="OpenSans-Light.ttf">
@@ -31,9 +31,9 @@ public class FoldingCell: UITableViewCell {
@IBOutlet weak public var foregroundView: RotatedView!
var animationView: UIView?
@IBInspectable var itemCount: NSInteger = 2 //count of folding
@IBInspectable public var itemCount: NSInteger = 2 //count of folding
@IBInspectable var backViewColor: UIColor = UIColor.brownColor()
@IBInspectable public var backViewColor: UIColor = UIColor.brownColor()
var animationItemViews: [RotatedView]?
@@ -120,6 +120,7 @@ public class FoldingCell: UITableViewCell {
}
func createAnimationView() {
let anAnimationView = UIView(frame: containerView.frame)
anAnimationView.layer.cornerRadius = foregroundView.layer.cornerRadius
anAnimationView.backgroundColor = UIColor.clearColor()
@@ -154,9 +155,9 @@ public class FoldingCell: UITableViewCell {
anAnimationView.addConstraint(newConstraint)
}
}
animationView = anAnimationView
}
func addImageItemsToAnimationView() {
containerView.alpha = 1;
@@ -226,6 +227,16 @@ public class FoldingCell: UITableViewCell {
animationItemViews = createAnimationItemView()
}
private func removeImageItemsFromAnimationView() {
guard let animationView = self.animationView else {
return
}
animationView.subviews.forEach({ $0.removeFromSuperview() })
}
// MARK: public
public func selectedAnimation(isSelected: Bool, animated: Bool, completion: CompletionHandler?) {
@@ -288,9 +299,8 @@ public class FoldingCell: UITableViewCell {
func openAnimation(completion completion: CompletionHandler?) {
if animationView?.subviews.count == 0 { // added animation items if need
addImageItemsToAnimationView()
}
removeImageItemsFromAnimationView()
addImageItemsToAnimationView()
guard let animationView = self.animationView else {
return
@@ -341,9 +351,8 @@ public class FoldingCell: UITableViewCell {
func closeAnimation(completion completion: CompletionHandler?) {
if animationView?.subviews.count == 0 { // added animation items if need
addImageItemsToAnimationView()
}
removeImageItemsFromAnimationView()
addImageItemsToAnimationView()
guard let animationItemViews = self.animationItemViews else {
fatalError()
+3 -1
View File
@@ -9,6 +9,8 @@
[shot on dribbble](https://dribbble.com/shots/2121350-Delivery-Card):
![Animation](Screenshots/folding-cell.gif)
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).
## Requirements
- iOS 8.0+
@@ -20,7 +22,7 @@ Just add the FoldingCell.swift file to your project.
or use [CocoaPods](https://cocoapods.org) with Podfile:
``` ruby
pod 'FoldingCell', '~> 0.6'
pod 'FoldingCell', '~> 0.7.2'
```