Repository: Ramotion/folding-cell Branch: master Commit: 620eda3030ff Files: 68 Total size: 386.6 KB Directory structure: gitextract_zzqwrinj/ ├── .gitignore ├── .swift-version ├── .travis.yml ├── CHANGELOG.md ├── CONTRIBUTING.md ├── FoldingCell/ │ ├── FoldingCell/ │ │ ├── FoldingCell.h │ │ ├── FoldingCell.swift │ │ └── Info.plist │ ├── FoldingCell-Demo/ │ │ ├── AppDelegate.swift │ │ ├── Assets.xcassets/ │ │ │ ├── AppIcon.appiconset/ │ │ │ │ └── Contents.json │ │ │ ├── Contents.json │ │ │ ├── arrow.imageset/ │ │ │ │ └── Contents.json │ │ │ ├── background.imageset/ │ │ │ │ └── Contents.json │ │ │ ├── burger.imageset/ │ │ │ │ └── Contents.json │ │ │ ├── dots.imageset/ │ │ │ │ └── Contents.json │ │ │ ├── image.imageset/ │ │ │ │ └── Contents.json │ │ │ ├── photo.imageset/ │ │ │ │ └── Contents.json │ │ │ └── stars.imageset/ │ │ │ └── Contents.json │ │ ├── Base.lproj/ │ │ │ ├── LaunchScreen.storyboard │ │ │ └── Main.storyboard │ │ ├── DemoCell.swift │ │ ├── Info.plist │ │ └── TableViewController.swift │ ├── FoldingCell-DemoObjc/ │ │ ├── AppDelegate.h │ │ ├── AppDelegate.m │ │ ├── Assets.xcassets/ │ │ │ ├── AppIcon.appiconset/ │ │ │ │ └── Contents.json │ │ │ ├── Contents.json │ │ │ ├── arrow.imageset/ │ │ │ │ └── Contents.json │ │ │ ├── background.imageset/ │ │ │ │ └── Contents.json │ │ │ ├── burger.imageset/ │ │ │ │ └── Contents.json │ │ │ ├── dots.imageset/ │ │ │ │ └── Contents.json │ │ │ ├── image.imageset/ │ │ │ │ └── Contents.json │ │ │ ├── photo.imageset/ │ │ │ │ └── Contents.json │ │ │ └── stars.imageset/ │ │ │ └── Contents.json │ │ ├── Base.lproj/ │ │ │ ├── LaunchScreen.storyboard │ │ │ └── Main.storyboard │ │ ├── Info.plist │ │ ├── TableViewController.h │ │ ├── TableViewController.m │ │ └── main.m │ ├── FoldingCell.xcodeproj/ │ │ ├── project.pbxproj │ │ ├── project.xcworkspace/ │ │ │ ├── contents.xcworkspacedata │ │ │ └── xcshareddata/ │ │ │ └── IDEWorkspaceChecks.plist │ │ └── xcshareddata/ │ │ └── xcschemes/ │ │ └── FoldingCell.xcscheme │ └── FoldingCellDemoTests/ │ ├── FoldingCellDemoTests.swift │ ├── Info.plist │ └── RotationViewTests.swift ├── FoldingCell.podspec ├── LICENSE ├── Package.swift ├── README.md └── docs/ ├── Classes/ │ └── FoldingCell.html ├── Classes.html ├── css/ │ ├── highlight.css │ └── jazzy.css ├── docsets/ │ ├── FoldingCell.docset/ │ │ └── Contents/ │ │ ├── Info.plist │ │ └── Resources/ │ │ ├── Documents/ │ │ │ ├── Classes/ │ │ │ │ └── FoldingCell.html │ │ │ ├── Classes.html │ │ │ ├── css/ │ │ │ │ ├── highlight.css │ │ │ │ └── jazzy.css │ │ │ ├── index.html │ │ │ ├── js/ │ │ │ │ └── jazzy.js │ │ │ └── undocumented.txt │ │ └── docSet.dsidx │ └── FoldingCell.tgz ├── index.html ├── js/ │ └── jazzy.js └── undocumented.txt ================================================ FILE CONTENTS ================================================ ================================================ FILE: .gitignore ================================================ # Xcode # build/ *.pbxuser !default.pbxuser *.mode1v3 !default.mode1v3 *.mode2v3 !default.mode2v3 *.perspectivev3 !default.perspectivev3 xcuserdata *.xccheckout *.moved-aside DerivedData *.hmap *.ipa *.xcuserstate # CocoaPods # # We recommend against adding the Pods directory to your .gitignore. However # you should judge for yourself, the pros and cons are mentioned at: # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control # # Pods/ # Carthage # # Add this line if you want to avoid checking in source code from Carthage dependencies. # Carthage/Checkouts Carthage/Build ================================================ FILE: .swift-version ================================================ 4.2 ================================================ FILE: .travis.yml ================================================ osx_image: xcode10.2 language: objective-c xcode_project: FoldingCell/FoldingCell.xcodeproj xcode_scheme: FoldingCell xcode_sdk: iphonesimulator12.2 # whitelist branches: only: - master ================================================ FILE: CHANGELOG.md ================================================ ================================================ FILE: CONTRIBUTING.md ================================================ # 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. ================================================ FILE: FoldingCell/FoldingCell/FoldingCell.h ================================================ // // FoldingCell.h // FoldingCell // // Created by Alex K. on 02/06/16. // Copyright © 2016 Alex K. All rights reserved. // #import //! Project version number for FoldingCell. FOUNDATION_EXPORT double FoldingCellVersionNumber; //! Project version string for FoldingCell. FOUNDATION_EXPORT const unsigned char FoldingCellVersionString[]; // In this header, you should import all the public headers of your framework using statements like #import ================================================ FILE: FoldingCell/FoldingCell/FoldingCell.swift ================================================ // // FoldingCell.swift // // Copyright (c) 21/12/15. Ramotion Inc. (http://ramotion.com) // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. import UIKit /// UITableViewCell with folding animation open class FoldingCell: UITableViewCell { @objc open var isUnfolded = false /// UIView is displayed when cell open @IBOutlet open var containerView: UIView! @IBOutlet open var containerViewTop: NSLayoutConstraint! /// UIView whitch display when cell close @IBOutlet open var foregroundView: RotatedView! @IBOutlet open var foregroundViewTop: NSLayoutConstraint! var animationView: UIView? /// the number of folding elements. Default 2 @IBInspectable open var itemCount: NSInteger = 2 /// The color of the back cell @IBInspectable open var backViewColor: UIColor = UIColor.brown var animationItemViews: [RotatedView]? /** Folding animation types - Open: Open direction - Close: Close direction */ @objc public enum AnimationType : Int { case open case close } // MARK: Life Cycle open override func awakeFromNib() { super.awakeFromNib() commonInit() } /** Call this method in methods init(style: UITableViewCellStyle, reuseIdentifier: String?) after creating Views */ @objc open func commonInit() { configureDefaultState() selectionStyle = .none containerView.layer.cornerRadius = foregroundView.layer.cornerRadius containerView.layer.masksToBounds = true } // MARK: configure private func configureDefaultState() { guard let foregroundViewTop = self.foregroundViewTop, let containerViewTop = self.containerViewTop else { fatalError("set foregroundViewTop or containerViewTop outlets in storyboard") } containerViewTop.constant = foregroundViewTop.constant containerView.alpha = 0 if let height = (foregroundView.constraints.filter { $0.firstAttribute == .height && $0.secondItem == nil }).first?.constant { foregroundView.layer.anchorPoint = CGPoint(x: 0.5, y: 1) foregroundViewTop.constant += height / 2 } foregroundView.layer.transform = foregroundView.transform3d() createAnimationView() contentView.bringSubviewToFront(foregroundView) } private func createAnimationItemView() -> [RotatedView] { var items = [RotatedView]() items.append(foregroundView) var rotatedViews = [RotatedView]() animationView?.subviews .lazy .compactMap({ $0 as? RotatedView }) .sorted(by: { $0.tag < $1.tag }) .forEach { itemView in rotatedViews.append(itemView) if let backView = itemView.backView { rotatedViews.append(backView) } } items.append(contentsOf: rotatedViews) return items } func configureAnimationItems(_ animationType: AnimationType) { if animationType == .open { animationView?.subviews .lazy .compactMap { $0 as? RotatedView } .forEach { $0.alpha = 0 } } else { animationView?.subviews .lazy .compactMap { $0 as? RotatedView } .forEach { $0.alpha = animationType == .open ? 0 : 1 if animationType != .open { $0.backView?.alpha = 0 } } } } func createAnimationView() { animationView = UIView(frame: containerView.frame) animationView?.layer.cornerRadius = foregroundView.layer.cornerRadius animationView?.backgroundColor = .clear animationView?.translatesAutoresizingMaskIntoConstraints = false animationView?.alpha = 0 guard let animationView = self.animationView else { return } self.contentView.addSubview(animationView) // copy constraints from containerView var newConstraints = [NSLayoutConstraint]() for constraint in self.contentView.constraints { if let item = constraint.firstItem as? UIView, item == containerView { let newConstraint = NSLayoutConstraint(item: animationView, attribute: constraint.firstAttribute, relatedBy: constraint.relation, toItem: constraint.secondItem, attribute: constraint.secondAttribute, multiplier: constraint.multiplier, constant: constraint.constant) newConstraints.append(newConstraint) } else if let firstItem = constraint.firstItem as? UIView, let secondItem: UIView = constraint.secondItem as? UIView, secondItem == containerView { let newConstraint = NSLayoutConstraint(item: firstItem, attribute: constraint.firstAttribute, relatedBy: constraint.relation, toItem: animationView, attribute: constraint.secondAttribute, multiplier: constraint.multiplier, constant: constraint.constant) newConstraints.append(newConstraint) } } self.contentView.addConstraints(newConstraints) for constraint in containerView.constraints { // added height constraint if constraint.firstAttribute == .height, let item: UIView = constraint.firstItem as? UIView, item == containerView { let newConstraint = NSLayoutConstraint(item: animationView, attribute: constraint.firstAttribute, relatedBy: constraint.relation, toItem: nil, attribute: constraint.secondAttribute, multiplier: constraint.multiplier, constant: constraint.constant) animationView.addConstraint(newConstraint) } } } func addImageItemsToAnimationView() { containerView.alpha = 1 let containerViewSize = containerView.bounds.size let foregroundViewSize = foregroundView.bounds.size // added first item var image = containerView.takeSnapshot(CGRect(x: 0, y: 0, width: containerViewSize.width, height: foregroundViewSize.height)) var imageView = UIImageView(image: image) imageView.tag = 0 imageView.layer.cornerRadius = foregroundView.layer.cornerRadius animationView?.addSubview(imageView) // added secod item image = containerView.takeSnapshot(CGRect(x: 0, y: foregroundViewSize.height, width: containerViewSize.width, height: foregroundViewSize.height)) imageView = UIImageView(image: image) let rotatedView = RotatedView(frame: imageView.frame) rotatedView.tag = 1 rotatedView.layer.anchorPoint = CGPoint(x: 0.5, y: 0) rotatedView.layer.transform = rotatedView.transform3d() rotatedView.addSubview(imageView) animationView?.addSubview(rotatedView) rotatedView.frame = CGRect(x: imageView.frame.origin.x, y: foregroundViewSize.height, width: containerViewSize.width, height: foregroundViewSize.height) // added other views let itemHeight = (containerViewSize.height - 2 * foregroundViewSize.height) / CGFloat(itemCount - 2) if itemCount == 2 { // decrease containerView height or increase itemCount assert(containerViewSize.height - 2 * foregroundViewSize.height == 0, "contanerView.height too high") } else { // decrease containerView height or increase itemCount assert(containerViewSize.height - 2 * foregroundViewSize.height >= itemHeight, "contanerView.height too high") } var yPosition = 2 * foregroundViewSize.height var tag = 2 for _ in 2 ..< itemCount { image = containerView.takeSnapshot(CGRect(x: 0, y: yPosition, width: containerViewSize.width, height: itemHeight)) imageView = UIImageView(image: image) let rotatedView = RotatedView(frame: imageView.frame) rotatedView.addSubview(imageView) rotatedView.layer.anchorPoint = CGPoint(x: 0.5, y: 0) rotatedView.layer.transform = rotatedView.transform3d() animationView?.addSubview(rotatedView) rotatedView.frame = CGRect(x: 0, y: yPosition, width: rotatedView.bounds.size.width, height: itemHeight) rotatedView.tag = tag yPosition += itemHeight tag += 1 } containerView.alpha = 0 if let animationView = self.animationView { // added back view var previuosView: RotatedView? for case let container as RotatedView in animationView.subviews.sorted(by: { $0.tag < $1.tag }) where container.tag > 0 && container.tag < animationView.subviews.count { previuosView?.addBackView(container.bounds.size.height, color: backViewColor) previuosView = container } } animationItemViews = createAnimationItemView() } fileprivate func removeImageItemsFromAnimationView() { guard let animationView = self.animationView else { return } animationView.subviews.forEach({ $0.removeFromSuperview() }) } // MARK: public /// Unfold cell. /// /// - Parameters: /// - value: unfold = true; collapse = false. /// - animated: animate changes. /// - completion: A block object to be executed when the animation sequence ends. @objc open func unfold(_ value: Bool, animated: Bool = true, completion: (() -> Void)? = nil) { if animated { value ? openAnimation(completion) : closeAnimation(completion) } else { foregroundView.alpha = value ? 0 : 1 containerView.alpha = value ? 1 : 0 } } @objc open func isAnimating() -> Bool { return animationView?.alpha == 1 ? true : false } // MARK: Animations @objc open dynamic func animationDuration(_ itemIndex: NSInteger, type: AnimationType) -> TimeInterval { return type == .close ? durationsForCollapsedState[itemIndex] : durationsForExpandedState[itemIndex] } @objc open var durationsForExpandedState: [TimeInterval] = [] @objc open var durationsForCollapsedState: [TimeInterval] = [] func durationSequence(_ type: AnimationType) -> [TimeInterval] { var durations = [TimeInterval]() for i in 0 ..< itemCount - 1 { let duration = animationDuration(i, type: type) durations.append(TimeInterval(duration / 2.0)) durations.append(TimeInterval(duration / 2.0)) } return durations } func openAnimation(_ completion: (() -> Void)?) { isUnfolded = true removeImageItemsFromAnimationView() addImageItemsToAnimationView() animationView?.alpha = 1 containerView.alpha = 0 let durations = durationSequence(.open) var delay: TimeInterval = 0 var timing = convertFromCAMediaTimingFunctionName(CAMediaTimingFunctionName.easeIn) var from: CGFloat = 0.0 var to: CGFloat = -CGFloat.pi / 2 var hidden = true configureAnimationItems(.open) guard let animationItemViews = self.animationItemViews else { return } for index in 0 ..< animationItemViews.count { let animatedView = animationItemViews[index] animatedView.foldingAnimation(timing, from: from, to: to, duration: durations[index], delay: delay, hidden: hidden) from = from == 0.0 ? CGFloat.pi / 2 : 0.0 to = to == 0.0 ? -CGFloat.pi / 2 : 0.0 timing = timing == convertFromCAMediaTimingFunctionName(CAMediaTimingFunctionName.easeIn) ? convertFromCAMediaTimingFunctionName(CAMediaTimingFunctionName.easeOut) : convertFromCAMediaTimingFunctionName(CAMediaTimingFunctionName.easeIn) hidden = !hidden delay += durations[index] } let firstItemView = animationView?.subviews.filter { $0.tag == 0 }.first firstItemView?.layer.masksToBounds = true DispatchQueue.main.asyncAfter(deadline: .now() + durations[0], execute: { firstItemView?.layer.cornerRadius = 0 }) DispatchQueue.main.asyncAfter(deadline: .now() + delay) { self.animationView?.alpha = 0 self.containerView.alpha = 1 completion?() } } func closeAnimation(_ completion: (() -> Void)?) { isUnfolded = false removeImageItemsFromAnimationView() addImageItemsToAnimationView() guard let animationItemViews = self.animationItemViews else { fatalError() } animationView?.alpha = 1 containerView.alpha = 0 let durations: [TimeInterval] = durationSequence(.close).reversed() var delay: TimeInterval = 0 var timing = convertFromCAMediaTimingFunctionName(CAMediaTimingFunctionName.easeIn) var from: CGFloat = 0.0 var to: CGFloat = CGFloat.pi / 2 var hidden = true 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.reversed()[index] animatedView.foldingAnimation(timing, from: from, to: to, duration: durations[index], delay: delay, hidden: hidden) to = to == 0.0 ? CGFloat.pi / 2 : 0.0 from = from == 0.0 ? -CGFloat.pi / 2 : 0.0 timing = timing == convertFromCAMediaTimingFunctionName(CAMediaTimingFunctionName.easeIn) ? convertFromCAMediaTimingFunctionName(CAMediaTimingFunctionName.easeOut) : convertFromCAMediaTimingFunctionName(CAMediaTimingFunctionName.easeIn) hidden = !hidden delay += durations[index] } DispatchQueue.main.asyncAfter(deadline: .now() + delay, execute: { self.animationView?.alpha = 0 completion?() }) let firstItemView = animationView?.subviews.filter { $0.tag == 0 }.first firstItemView?.layer.cornerRadius = 0 firstItemView?.layer.masksToBounds = true if let durationFirst = durations.first { DispatchQueue.main.asyncAfter(deadline: .now() + delay - durationFirst * 2, execute: { firstItemView?.layer.cornerRadius = self.foregroundView.layer.cornerRadius firstItemView?.setNeedsDisplay() firstItemView?.setNeedsLayout() }) } } } // MARK: RotatedView open class RotatedView: UIView { private enum Const { static let rotationX = "rotation.x" static let transformRotationX = "transform.rotation.x" } var hiddenAfterAnimation = false var backView: RotatedView? func addBackView(_ height: CGFloat, color: UIColor) { let view = RotatedView(frame: CGRect.zero) view.backgroundColor = color view.layer.anchorPoint = CGPoint(x: 0.5, y: 1) view.layer.transform = view.transform3d() view.translatesAutoresizingMaskIntoConstraints = false self.addSubview(view) backView = view 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, constant: self.bounds.size.height - height + height / 2), 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, multiplier: 1, constant: 0), ]) } } extension RotatedView: CAAnimationDelegate { func rotatedX(_ angle: CGFloat) { var allTransofrom = CATransform3DIdentity let rotateTransform = CATransform3DMakeRotation(angle, 1, 0, 0) allTransofrom = CATransform3DConcat(allTransofrom, rotateTransform) allTransofrom = CATransform3DConcat(allTransofrom, transform3d()) self.layer.transform = allTransofrom } func transform3d() -> CATransform3D { var transform = CATransform3DIdentity transform.m34 = 2.5 / -2000 return transform } // MARK: animations func foldingAnimation(_ timing: String, from: CGFloat, to: CGFloat, duration: TimeInterval, delay: TimeInterval, hidden: Bool) { let rotateAnimation = CABasicAnimation(keyPath: Const.transformRotationX) rotateAnimation.timingFunction = CAMediaTimingFunction(name: convertToCAMediaTimingFunctionName(timing)) rotateAnimation.fromValue = from rotateAnimation.toValue = to rotateAnimation.duration = duration rotateAnimation.delegate = self rotateAnimation.fillMode = CAMediaTimingFillMode.forwards rotateAnimation.isRemovedOnCompletion = false rotateAnimation.beginTime = CACurrentMediaTime() + delay self.hiddenAfterAnimation = hidden self.layer.add(rotateAnimation, forKey: Const.rotationX) } public func animationDidStart(_: CAAnimation) { self.layer.shouldRasterize = true self.alpha = 1 } public func animationDidStop(_: CAAnimation, finished _: Bool) { if hiddenAfterAnimation { self.alpha = 0 } self.layer.removeAllAnimations() self.layer.shouldRasterize = false self.rotatedX(CGFloat(0)) } } // MARK: UIView + extension private extension UIView { func takeSnapshot(_ frame: CGRect) -> UIImage? { UIGraphicsBeginImageContextWithOptions(frame.size, false, 0) guard let context = UIGraphicsGetCurrentContext() else { return nil } context.translateBy(x: frame.origin.x * -1, y: frame.origin.y * -1) layer.render(in: context) let image = UIGraphicsGetImageFromCurrentImageContext() UIGraphicsEndImageContext() return image } } // Helper function inserted by Swift 4.2 migrator. fileprivate func convertFromCAMediaTimingFunctionName(_ input: CAMediaTimingFunctionName) -> String { return input.rawValue } // Helper function inserted by Swift 4.2 migrator. fileprivate func convertToCAMediaTimingFunctionName(_ input: String) -> CAMediaTimingFunctionName { return CAMediaTimingFunctionName(rawValue: input) } ================================================ FILE: FoldingCell/FoldingCell/Info.plist ================================================ CFBundleDevelopmentRegion en CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName $(PRODUCT_NAME) CFBundlePackageType FMWK CFBundleShortVersionString 1.0 CFBundleSignature ???? CFBundleVersion $(CURRENT_PROJECT_VERSION) NSPrincipalClass UILaunchStoryboardName LaunchScreen UIMainStoryboardFile Main ================================================ FILE: FoldingCell/FoldingCell-Demo/AppDelegate.swift ================================================ // // AppDelegate.swift // // Copyright (c) 21/12/15. Ramotion Inc. (http://ramotion.com) // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. import UIKit @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? func application(_: UIApplication, didFinishLaunchingWithOptions _: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool { return true } } ================================================ FILE: FoldingCell/FoldingCell-Demo/Assets.xcassets/AppIcon.appiconset/Contents.json ================================================ { "images" : [ { "idiom" : "iphone", "size" : "20x20", "scale" : "2x" }, { "idiom" : "iphone", "size" : "20x20", "scale" : "3x" }, { "idiom" : "iphone", "size" : "29x29", "scale" : "2x" }, { "idiom" : "iphone", "size" : "29x29", "scale" : "3x" }, { "idiom" : "iphone", "size" : "40x40", "scale" : "2x" }, { "idiom" : "iphone", "size" : "40x40", "scale" : "3x" }, { "idiom" : "iphone", "size" : "60x60", "scale" : "2x" }, { "idiom" : "iphone", "size" : "60x60", "scale" : "3x" }, { "idiom" : "ios-marketing", "size" : "1024x1024", "scale" : "1x" } ], "info" : { "version" : 1, "author" : "xcode" } } ================================================ FILE: FoldingCell/FoldingCell-Demo/Assets.xcassets/Contents.json ================================================ { "info" : { "version" : 1, "author" : "xcode" } } ================================================ FILE: FoldingCell/FoldingCell-Demo/Assets.xcassets/arrow.imageset/Contents.json ================================================ { "images" : [ { "idiom" : "iphone", "scale" : "1x" }, { "idiom" : "iphone", "filename" : "arrow.pdf", "scale" : "2x" }, { "idiom" : "iphone", "scale" : "3x" } ], "info" : { "version" : 1, "author" : "xcode" } } ================================================ FILE: FoldingCell/FoldingCell-Demo/Assets.xcassets/background.imageset/Contents.json ================================================ { "images" : [ { "idiom" : "universal", "scale" : "1x" }, { "idiom" : "universal", "filename" : "background.png", "scale" : "2x" }, { "idiom" : "universal", "scale" : "3x" } ], "info" : { "version" : 1, "author" : "xcode" } } ================================================ FILE: FoldingCell/FoldingCell-Demo/Assets.xcassets/burger.imageset/Contents.json ================================================ { "images" : [ { "idiom" : "iphone", "scale" : "1x" }, { "idiom" : "iphone", "filename" : "burger.pdf", "scale" : "2x" }, { "idiom" : "iphone", "scale" : "3x" } ], "info" : { "version" : 1, "author" : "xcode" } } ================================================ FILE: FoldingCell/FoldingCell-Demo/Assets.xcassets/dots.imageset/Contents.json ================================================ { "images" : [ { "idiom" : "iphone" }, { "idiom" : "iphone", "scale" : "1x" }, { "idiom" : "iphone", "filename" : "dots.pdf", "scale" : "2x" }, { "idiom" : "iphone", "scale" : "3x" } ], "info" : { "version" : 1, "author" : "xcode" } } ================================================ FILE: FoldingCell/FoldingCell-Demo/Assets.xcassets/image.imageset/Contents.json ================================================ { "images" : [ { "idiom" : "universal", "scale" : "1x" }, { "idiom" : "universal", "filename" : "image.png", "scale" : "2x" }, { "idiom" : "universal", "scale" : "3x" } ], "info" : { "version" : 1, "author" : "xcode" } } ================================================ FILE: FoldingCell/FoldingCell-Demo/Assets.xcassets/photo.imageset/Contents.json ================================================ { "images" : [ { "idiom" : "iphone" }, { "idiom" : "iphone", "scale" : "1x" }, { "idiom" : "iphone", "filename" : "photo.pdf", "scale" : "2x" }, { "idiom" : "iphone", "scale" : "3x" } ], "info" : { "version" : 1, "author" : "xcode" } } ================================================ FILE: FoldingCell/FoldingCell-Demo/Assets.xcassets/stars.imageset/Contents.json ================================================ { "images" : [ { "idiom" : "iphone" }, { "idiom" : "iphone", "scale" : "1x" }, { "idiom" : "iphone", "filename" : "stars.pdf", "scale" : "2x" }, { "idiom" : "iphone", "scale" : "3x" } ], "info" : { "version" : 1, "author" : "xcode" } } ================================================ FILE: FoldingCell/FoldingCell-Demo/Base.lproj/LaunchScreen.storyboard ================================================ ================================================ FILE: FoldingCell/FoldingCell-Demo/Base.lproj/Main.storyboard ================================================ OpenSans-Light OpenSans OpenSans-Semibold ================================================ FILE: FoldingCell/FoldingCell-Demo/DemoCell.swift ================================================ // // DemoCell.swift // FoldingCell // // Created by Alex K. on 25/12/15. // Copyright © 2015 Alex K. All rights reserved. // import FoldingCell import UIKit class DemoCell: FoldingCell { @IBOutlet var closeNumberLabel: UILabel! @IBOutlet 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 _: FoldingCell.AnimationType) -> TimeInterval { let durations = [0.26, 0.2, 0.2] return durations[itemIndex] } } // MARK: - Actions ⚡️ extension DemoCell { @IBAction func buttonHandler(_: AnyObject) { print("tap") } } ================================================ FILE: FoldingCell/FoldingCell-Demo/Info.plist ================================================ CFBundleDevelopmentRegion en CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName $(PRODUCT_NAME) CFBundlePackageType APPL CFBundleShortVersionString 1.0 CFBundleVersion 1 LSRequiresIPhoneOS UILaunchStoryboardName LaunchScreen UIMainStoryboardFile Main UIRequiredDeviceCapabilities armv7 UISupportedInterfaceOrientations UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight ================================================ FILE: FoldingCell/FoldingCell-Demo/TableViewController.swift ================================================ // // TableViewController.swift // // Copyright (c) 21/12/15. Ramotion Inc. (http://ramotion.com) // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. import FoldingCell import UIKit class TableViewController: UITableViewController { enum Const { static let closeCellHeight: CGFloat = 179 static let openCellHeight: CGFloat = 488 static let rowsCount = 10 } var cellHeights: [CGFloat] = [] // MARK: Life Cycle override func viewDidLoad() { super.viewDidLoad() setup() } // MARK: Helpers private func setup() { cellHeights = Array(repeating: Const.closeCellHeight, count: Const.rowsCount) tableView.estimatedRowHeight = Const.closeCellHeight tableView.rowHeight = UITableView.automaticDimension tableView.backgroundColor = UIColor(patternImage: #imageLiteral(resourceName: "background")) if #available(iOS 10.0, *) { tableView.refreshControl = UIRefreshControl() tableView.refreshControl?.addTarget(self, action: #selector(refreshHandler), for: .valueChanged) } } // MARK: Actions @objc func refreshHandler() { let deadlineTime = DispatchTime.now() + .seconds(1) DispatchQueue.main.asyncAfter(deadline: deadlineTime, execute: { [weak self] in if #available(iOS 10.0, *) { self?.tableView.refreshControl?.endRefreshing() } self?.tableView.reloadData() }) } } // MARK: - TableView extension TableViewController { override func tableView(_: UITableView, numberOfRowsInSection _: Int) -> Int { return 10 } override func tableView(_: UITableView, willDisplay cell: UITableViewCell, forRowAt indexPath: IndexPath) { guard case let cell as DemoCell = cell else { return } cell.backgroundColor = .clear if cellHeights[indexPath.row] == Const.closeCellHeight { cell.unfold(false, animated: false, completion: nil) } else { cell.unfold(true, animated: false, completion: nil) } cell.number = indexPath.row } override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let cell = tableView.dequeueReusableCell(withIdentifier: "FoldingCell", for: indexPath) as! FoldingCell let durations: [TimeInterval] = [0.26, 0.2, 0.2] cell.durationsForExpandedState = durations cell.durationsForCollapsedState = durations return cell } override func tableView(_: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { return cellHeights[indexPath.row] } override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { let cell = tableView.cellForRow(at: indexPath) as! FoldingCell if cell.isAnimating() { return } var duration = 0.0 let cellIsCollapsed = cellHeights[indexPath.row] == Const.closeCellHeight if cellIsCollapsed { cellHeights[indexPath.row] = Const.openCellHeight cell.unfold(true, animated: true, completion: nil) duration = 0.5 } else { cellHeights[indexPath.row] = Const.closeCellHeight cell.unfold(false, animated: true, completion: nil) duration = 0.8 } UIView.animate(withDuration: duration, delay: 0, options: .curveEaseOut, animations: { () -> Void in tableView.beginUpdates() tableView.endUpdates() // fix https://github.com/Ramotion/folding-cell/issues/169 if cell.frame.maxY > tableView.frame.maxY { tableView.scrollToRow(at: indexPath, at: UITableView.ScrollPosition.bottom, animated: true) } }, completion: nil) } } ================================================ FILE: FoldingCell/FoldingCell-DemoObjc/AppDelegate.h ================================================ // // AppDelegate.h // DemoApp-Objc // // Created by Abdurahim Jauzee on 30/05/2017. // Copyright © 2017 Abdurahim Jauzee. All rights reserved. // #import @interface AppDelegate : UIResponder @property (strong, nonatomic) UIWindow *window; @end ================================================ FILE: FoldingCell/FoldingCell-DemoObjc/AppDelegate.m ================================================ // // AppDelegate.m // DemoApp-Objc // // Created by Abdurahim Jauzee on 30/05/2017. // Copyright © 2017 Abdurahim Jauzee. All rights reserved. // #import "AppDelegate.h" @interface AppDelegate () @end @implementation AppDelegate - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { return YES; } @end ================================================ FILE: FoldingCell/FoldingCell-DemoObjc/Assets.xcassets/AppIcon.appiconset/Contents.json ================================================ { "images" : [ { "idiom" : "iphone", "size" : "20x20", "scale" : "2x" }, { "idiom" : "iphone", "size" : "20x20", "scale" : "3x" }, { "idiom" : "iphone", "size" : "29x29", "scale" : "2x" }, { "idiom" : "iphone", "size" : "29x29", "scale" : "3x" }, { "idiom" : "iphone", "size" : "40x40", "scale" : "2x" }, { "idiom" : "iphone", "size" : "40x40", "scale" : "3x" }, { "idiom" : "iphone", "size" : "60x60", "scale" : "2x" }, { "idiom" : "iphone", "size" : "60x60", "scale" : "3x" } ], "info" : { "version" : 1, "author" : "xcode" } } ================================================ FILE: FoldingCell/FoldingCell-DemoObjc/Assets.xcassets/Contents.json ================================================ { "info" : { "version" : 1, "author" : "xcode" } } ================================================ FILE: FoldingCell/FoldingCell-DemoObjc/Assets.xcassets/arrow.imageset/Contents.json ================================================ { "images" : [ { "idiom" : "iphone", "scale" : "1x" }, { "idiom" : "iphone", "filename" : "arrow.pdf", "scale" : "2x" }, { "idiom" : "iphone", "scale" : "3x" } ], "info" : { "version" : 1, "author" : "xcode" } } ================================================ FILE: FoldingCell/FoldingCell-DemoObjc/Assets.xcassets/background.imageset/Contents.json ================================================ { "images" : [ { "idiom" : "universal", "scale" : "1x" }, { "idiom" : "universal", "filename" : "background.png", "scale" : "2x" }, { "idiom" : "universal", "scale" : "3x" } ], "info" : { "version" : 1, "author" : "xcode" } } ================================================ FILE: FoldingCell/FoldingCell-DemoObjc/Assets.xcassets/burger.imageset/Contents.json ================================================ { "images" : [ { "idiom" : "iphone", "scale" : "1x" }, { "idiom" : "iphone", "filename" : "burger.pdf", "scale" : "2x" }, { "idiom" : "iphone", "scale" : "3x" } ], "info" : { "version" : 1, "author" : "xcode" } } ================================================ FILE: FoldingCell/FoldingCell-DemoObjc/Assets.xcassets/dots.imageset/Contents.json ================================================ { "images" : [ { "idiom" : "iphone" }, { "idiom" : "iphone", "scale" : "1x" }, { "idiom" : "iphone", "filename" : "dots.pdf", "scale" : "2x" }, { "idiom" : "iphone", "scale" : "3x" } ], "info" : { "version" : 1, "author" : "xcode" } } ================================================ FILE: FoldingCell/FoldingCell-DemoObjc/Assets.xcassets/image.imageset/Contents.json ================================================ { "images" : [ { "idiom" : "universal", "scale" : "1x" }, { "idiom" : "universal", "filename" : "image.png", "scale" : "2x" }, { "idiom" : "universal", "scale" : "3x" } ], "info" : { "version" : 1, "author" : "xcode" } } ================================================ FILE: FoldingCell/FoldingCell-DemoObjc/Assets.xcassets/photo.imageset/Contents.json ================================================ { "images" : [ { "idiom" : "iphone" }, { "idiom" : "iphone", "scale" : "1x" }, { "idiom" : "iphone", "filename" : "photo.pdf", "scale" : "2x" }, { "idiom" : "iphone", "scale" : "3x" } ], "info" : { "version" : 1, "author" : "xcode" } } ================================================ FILE: FoldingCell/FoldingCell-DemoObjc/Assets.xcassets/stars.imageset/Contents.json ================================================ { "images" : [ { "idiom" : "iphone" }, { "idiom" : "iphone", "scale" : "1x" }, { "idiom" : "iphone", "filename" : "stars.pdf", "scale" : "2x" }, { "idiom" : "iphone", "scale" : "3x" } ], "info" : { "version" : 1, "author" : "xcode" } } ================================================ FILE: FoldingCell/FoldingCell-DemoObjc/Base.lproj/LaunchScreen.storyboard ================================================ ================================================ FILE: FoldingCell/FoldingCell-DemoObjc/Base.lproj/Main.storyboard ================================================ OpenSans-Light OpenSans OpenSans-Semibold ================================================ FILE: FoldingCell/FoldingCell-DemoObjc/Info.plist ================================================ CFBundleDevelopmentRegion en CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName $(PRODUCT_NAME) CFBundlePackageType APPL CFBundleShortVersionString 1.0 CFBundleVersion 1 LSRequiresIPhoneOS UILaunchStoryboardName LaunchScreen UIMainStoryboardFile Main UIRequiredDeviceCapabilities armv7 UIRequiresFullScreen UIStatusBarHidden UISupportedInterfaceOrientations UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight ================================================ FILE: FoldingCell/FoldingCell-DemoObjc/TableViewController.h ================================================ // // TableViewController.h // folding-cell-test // // Created by Abdurahim Jauzee on 30/05/2017. // Copyright © 2017 Abdurahim Jauzee. All rights reserved. // #import @interface TableViewController : UITableViewController @end ================================================ FILE: FoldingCell/FoldingCell-DemoObjc/TableViewController.m ================================================ // // TableViewController.m // folding-cell-test // // Created by Abdurahim Jauzee on 30/05/2017. // Copyright © 2017 Abdurahim Jauzee. All rights reserved. // #import "TableViewController.h" #import @interface TableViewController () @property (atomic) float kCloseCellHeight; @property (atomic) float kOpenCellHeight; @property (atomic) int kRowsCount; @property (atomic) NSMutableArray* cellHeights; @end @implementation TableViewController - (void)viewDidLoad { [super viewDidLoad]; self.kCloseCellHeight = 179; self.kOpenCellHeight = 488; self.kRowsCount = 10; self.cellHeights = [NSMutableArray array]; for (int i = 0; i < 10; i++) { [self.cellHeights addObject:[NSNumber numberWithFloat:self.kCloseCellHeight]]; } self.tableView.estimatedRowHeight = self.kCloseCellHeight; self.tableView.rowHeight = UITableViewAutomaticDimension; UIImage *patternImage = [UIImage imageNamed:@"background"]; UIColor *patternColor = [UIColor colorWithPatternImage:patternImage]; self.tableView.backgroundColor = patternColor; self.tableView.contentInset = UIEdgeInsetsMake(16, 0, 0, 0); } - (void) viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; [self.tableView reloadData]; } #pragma mark - TableView - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { return self.kRowsCount; } - (void) tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath { cell.backgroundColor = [UIColor clearColor]; NSNumber *height = [self.cellHeights objectAtIndex:indexPath.row]; bool cellIsCollapsed = height.floatValue == self.kCloseCellHeight; if (cellIsCollapsed) { [(FoldingCell *)cell unfold:NO animated:NO completion:nil]; //[(FoldingCell *) cell selectedAnimation:false animated:false completion: nil]; } else { [(FoldingCell *)cell unfold:YES animated:NO completion:nil]; //[(FoldingCell *) cell selectedAnimation:true animated:false completion: nil]; } UIView *backgroundTopView = [cell viewWithTag:11]; CALayer *backgroundTopViewLayer = backgroundTopView.layer; backgroundTopViewLayer.cornerRadius = 10; backgroundTopViewLayer.masksToBounds = YES; UILabel *closeNumberlabel = [cell viewWithTag:12]; UILabel *openNumberLabel = [cell viewWithTag:13]; NSString *text = [NSString stringWithFormat:@"%ld", (long)indexPath.row]; closeNumberlabel.text = text; openNumberLabel.text = text; } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { FoldingCell *cell = [tableView dequeueReusableCellWithIdentifier:@"FoldingCell"]; cell.backgroundColor = [UIColor clearColor]; CALayer *layer = ((FoldingCell *) cell).foregroundView.layer; layer.cornerRadius = 10; layer.masksToBounds = YES; NSArray *durations = @[@0.26, @0.2, @0.2]; [cell setDurationsForExpandedState:durations]; [cell setDurationsForCollapsedState:durations]; return cell; } - (CGFloat) tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { NSNumber *height = self.cellHeights[indexPath.row]; return height.floatValue; } - (void) tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { FoldingCell *cell = [tableView cellForRowAtIndexPath:indexPath]; if (cell.isAnimating) { return; } double duration = 0; NSNumber *height = [self.cellHeights objectAtIndex:indexPath.row]; bool cellIsCollapsed = height.floatValue == self.kCloseCellHeight; if (cellIsCollapsed) { [self.cellHeights setObject:[NSNumber numberWithFloat:self.kOpenCellHeight] atIndexedSubscript:indexPath.row]; //[cell selectedAnimation:true animated:true completion: nil]; [cell unfold:YES animated:YES completion:nil]; duration = 0.5; } else { [self.cellHeights setObject:[NSNumber numberWithFloat:self.kCloseCellHeight] atIndexedSubscript:indexPath.row]; //[cell selectedAnimation:false animated:true completion: nil]; [cell unfold:NO animated:YES completion:nil]; duration = 0.8; } [UIView animateWithDuration:duration delay:0 options:0 animations:^{ [tableView beginUpdates]; [tableView endUpdates]; } completion:nil]; } @end ================================================ FILE: FoldingCell/FoldingCell-DemoObjc/main.m ================================================ // // main.m // DemoApp-Objc // // Created by Abdurahim Jauzee on 30/05/2017. // Copyright © 2017 Abdurahim Jauzee. All rights reserved. // #import #import "AppDelegate.h" int main(int argc, char * argv[]) { @autoreleasepool { return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); } } ================================================ FILE: FoldingCell/FoldingCell.xcodeproj/project.pbxproj ================================================ // !$*UTF8*$! { archiveVersion = 1; classes = { }; objectVersion = 46; objects = { /* Begin PBXBuildFile section */ 5A0E1C3021414940006A0374 /* FoldingCellDemoTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5A0E1C2F21414940006A0374 /* FoldingCellDemoTests.swift */; }; 5A1225D821B65E8E005BBB26 /* RotationViewTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5A1225D721B65E8E005BBB26 /* RotationViewTests.swift */; }; 8499D8881D0054A8004B5B37 /* FoldingCell.h in Headers */ = {isa = PBXBuildFile; fileRef = 8499D8871D0054A8004B5B37 /* FoldingCell.h */; settings = {ATTRIBUTES = (Public, ); }; }; 9D57F31F1EDC7A6F0004599F /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9D57F31E1EDC7A6F0004599F /* AppDelegate.swift */; }; 9D57F3241EDC7A6F0004599F /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 9D57F3221EDC7A6F0004599F /* Main.storyboard */; }; 9D57F3261EDC7A6F0004599F /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 9D57F3251EDC7A6F0004599F /* Assets.xcassets */; }; 9D57F3291EDC7A6F0004599F /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 9D57F3271EDC7A6F0004599F /* LaunchScreen.storyboard */; }; 9D57F32F1EDC7A850004599F /* TableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9D57F32E1EDC7A850004599F /* TableViewController.swift */; }; 9D57F3311EDC7AAD0004599F /* DemoCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9D57F3301EDC7AAD0004599F /* DemoCell.swift */; }; 9D57F3331EDC7ACF0004599F /* FoldingCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9D57F3321EDC7ACF0004599F /* FoldingCell.swift */; }; 9D57F3341EDC7AD80004599F /* FoldingCell.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8499D8851D0054A8004B5B37 /* FoldingCell.framework */; }; 9D57F3351EDC7AD80004599F /* FoldingCell.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 8499D8851D0054A8004B5B37 /* FoldingCell.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 9DAA51581EDDBAD700DFC539 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DAA51571EDDBAD700DFC539 /* main.m */; }; 9DAA515B1EDDBAD700DFC539 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DAA515A1EDDBAD700DFC539 /* AppDelegate.m */; }; 9DAA51611EDDBAD700DFC539 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 9DAA515F1EDDBAD700DFC539 /* Main.storyboard */; }; 9DAA51631EDDBAD700DFC539 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 9DAA51621EDDBAD700DFC539 /* Assets.xcassets */; }; 9DAA51661EDDBAD700DFC539 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 9DAA51641EDDBAD700DFC539 /* LaunchScreen.storyboard */; }; 9DAA516D1EDDBAF900DFC539 /* TableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DAA516C1EDDBAF900DFC539 /* TableViewController.m */; }; 9DAA516E1EDDBB3200DFC539 /* FoldingCell.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8499D8851D0054A8004B5B37 /* FoldingCell.framework */; }; 9DAA51701EDDBB4800DFC539 /* FoldingCell.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 8499D8851D0054A8004B5B37 /* FoldingCell.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ 5A0E1C3221414940006A0374 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 847A57FC1C294F750028FB84 /* Project object */; proxyType = 1; remoteGlobalIDString = 9D57F31B1EDC7A6F0004599F; remoteInfo = "FoldingCell-Demo"; }; 9D57F3361EDC7AD80004599F /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 847A57FC1C294F750028FB84 /* Project object */; proxyType = 1; remoteGlobalIDString = 8499D8841D0054A8004B5B37; remoteInfo = FoldingCell; }; 9DAA51711EDDBB4800DFC539 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 847A57FC1C294F750028FB84 /* Project object */; proxyType = 1; remoteGlobalIDString = 8499D8841D0054A8004B5B37; remoteInfo = FoldingCell; }; /* End PBXContainerItemProxy section */ /* Begin PBXCopyFilesBuildPhase section */ 9D57F3381EDC7AD80004599F /* Embed Frameworks */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; dstPath = ""; dstSubfolderSpec = 10; files = ( 9D57F3351EDC7AD80004599F /* FoldingCell.framework in Embed Frameworks */, ); name = "Embed Frameworks"; runOnlyForDeploymentPostprocessing = 0; }; 9DAA51731EDDBB4800DFC539 /* Embed Frameworks */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; dstPath = ""; dstSubfolderSpec = 10; files = ( 9DAA51701EDDBB4800DFC539 /* FoldingCell.framework in Embed Frameworks */, ); name = "Embed Frameworks"; runOnlyForDeploymentPostprocessing = 0; }; /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ 5A0E1C2D21414940006A0374 /* FoldingCellDemoTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = FoldingCellDemoTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 5A0E1C2F21414940006A0374 /* FoldingCellDemoTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FoldingCellDemoTests.swift; sourceTree = ""; }; 5A0E1C3121414940006A0374 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 5A1225D721B65E8E005BBB26 /* RotationViewTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RotationViewTests.swift; sourceTree = ""; }; 8499D8851D0054A8004B5B37 /* FoldingCell.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = FoldingCell.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 8499D8871D0054A8004B5B37 /* FoldingCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FoldingCell.h; sourceTree = ""; }; 8499D8891D0054A8004B5B37 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 9D57F31C1EDC7A6F0004599F /* FoldingCell-Demo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "FoldingCell-Demo.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 9D57F31E1EDC7A6F0004599F /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 9D57F3231EDC7A6F0004599F /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 9D57F3251EDC7A6F0004599F /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 9D57F3281EDC7A6F0004599F /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 9D57F32A1EDC7A6F0004599F /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 9D57F32E1EDC7A850004599F /* TableViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TableViewController.swift; sourceTree = ""; }; 9D57F3301EDC7AAD0004599F /* DemoCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DemoCell.swift; sourceTree = ""; }; 9D57F3321EDC7ACF0004599F /* FoldingCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FoldingCell.swift; sourceTree = ""; }; 9DAA51541EDDBAD700DFC539 /* FoldingCell-DemoObjc.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "FoldingCell-DemoObjc.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 9DAA51571EDDBAD700DFC539 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 9DAA51591EDDBAD700DFC539 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 9DAA515A1EDDBAD700DFC539 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 9DAA51601EDDBAD700DFC539 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 9DAA51621EDDBAD700DFC539 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 9DAA51651EDDBAD700DFC539 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 9DAA51671EDDBAD700DFC539 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 9DAA516B1EDDBAF900DFC539 /* TableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TableViewController.h; sourceTree = ""; }; 9DAA516C1EDDBAF900DFC539 /* TableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TableViewController.m; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ 5A0E1C2A21414940006A0374 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( ); runOnlyForDeploymentPostprocessing = 0; }; 8499D8811D0054A8004B5B37 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( ); runOnlyForDeploymentPostprocessing = 0; }; 9D57F3191EDC7A6F0004599F /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( 9D57F3341EDC7AD80004599F /* FoldingCell.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; 9DAA51511EDDBAD700DFC539 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( 9DAA516E1EDDBB3200DFC539 /* FoldingCell.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ 5A0E1C2E21414940006A0374 /* FoldingCellDemoTests */ = { isa = PBXGroup; children = ( 5A0E1C2F21414940006A0374 /* FoldingCellDemoTests.swift */, 5A0E1C3121414940006A0374 /* Info.plist */, 5A1225D721B65E8E005BBB26 /* RotationViewTests.swift */, ); path = FoldingCellDemoTests; sourceTree = ""; }; 847A57FB1C294F750028FB84 = { isa = PBXGroup; children = ( 8499D8861D0054A8004B5B37 /* FoldingCell */, 9D57F31D1EDC7A6F0004599F /* FoldingCell-Demo */, 9DAA51551EDDBAD700DFC539 /* FoldingCell-DemoObjc */, 5A0E1C2E21414940006A0374 /* FoldingCellDemoTests */, 847A58051C294F750028FB84 /* Products */, ); sourceTree = ""; }; 847A58051C294F750028FB84 /* Products */ = { isa = PBXGroup; children = ( 8499D8851D0054A8004B5B37 /* FoldingCell.framework */, 9D57F31C1EDC7A6F0004599F /* FoldingCell-Demo.app */, 9DAA51541EDDBAD700DFC539 /* FoldingCell-DemoObjc.app */, 5A0E1C2D21414940006A0374 /* FoldingCellDemoTests.xctest */, ); name = Products; sourceTree = ""; }; 8499D8861D0054A8004B5B37 /* FoldingCell */ = { isa = PBXGroup; children = ( 9D57F3321EDC7ACF0004599F /* FoldingCell.swift */, 8499D8871D0054A8004B5B37 /* FoldingCell.h */, 8499D8891D0054A8004B5B37 /* Info.plist */, ); path = FoldingCell; sourceTree = ""; }; 9D57F31D1EDC7A6F0004599F /* FoldingCell-Demo */ = { isa = PBXGroup; children = ( 9D57F31E1EDC7A6F0004599F /* AppDelegate.swift */, 9D57F3301EDC7AAD0004599F /* DemoCell.swift */, 9D57F32E1EDC7A850004599F /* TableViewController.swift */, 9D57F3221EDC7A6F0004599F /* Main.storyboard */, 9D57F3251EDC7A6F0004599F /* Assets.xcassets */, 9D57F3271EDC7A6F0004599F /* LaunchScreen.storyboard */, 9D57F32A1EDC7A6F0004599F /* Info.plist */, ); path = "FoldingCell-Demo"; sourceTree = ""; }; 9DAA51551EDDBAD700DFC539 /* FoldingCell-DemoObjc */ = { isa = PBXGroup; children = ( 9DAA51591EDDBAD700DFC539 /* AppDelegate.h */, 9DAA515A1EDDBAD700DFC539 /* AppDelegate.m */, 9DAA515F1EDDBAD700DFC539 /* Main.storyboard */, 9DAA51621EDDBAD700DFC539 /* Assets.xcassets */, 9DAA51641EDDBAD700DFC539 /* LaunchScreen.storyboard */, 9DAA51671EDDBAD700DFC539 /* Info.plist */, 9DAA516B1EDDBAF900DFC539 /* TableViewController.h */, 9DAA516C1EDDBAF900DFC539 /* TableViewController.m */, 9DAA51561EDDBAD700DFC539 /* Supporting Files */, ); path = "FoldingCell-DemoObjc"; sourceTree = ""; }; 9DAA51561EDDBAD700DFC539 /* Supporting Files */ = { isa = PBXGroup; children = ( 9DAA51571EDDBAD700DFC539 /* main.m */, ); name = "Supporting Files"; sourceTree = ""; }; /* End PBXGroup section */ /* Begin PBXHeadersBuildPhase section */ 8499D8821D0054A8004B5B37 /* Headers */ = { isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( 8499D8881D0054A8004B5B37 /* FoldingCell.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXHeadersBuildPhase section */ /* Begin PBXNativeTarget section */ 5A0E1C2C21414940006A0374 /* FoldingCellDemoTests */ = { isa = PBXNativeTarget; buildConfigurationList = 5A0E1C3421414940006A0374 /* Build configuration list for PBXNativeTarget "FoldingCellDemoTests" */; buildPhases = ( 5A0E1C2921414940006A0374 /* Sources */, 5A0E1C2A21414940006A0374 /* Frameworks */, 5A0E1C2B21414940006A0374 /* Resources */, ); buildRules = ( ); dependencies = ( 5A0E1C3321414940006A0374 /* PBXTargetDependency */, ); name = FoldingCellDemoTests; productName = FoldingCellDemoTests; productReference = 5A0E1C2D21414940006A0374 /* FoldingCellDemoTests.xctest */; productType = "com.apple.product-type.bundle.unit-test"; }; 8499D8841D0054A8004B5B37 /* FoldingCell */ = { isa = PBXNativeTarget; buildConfigurationList = 8499D88E1D0054A8004B5B37 /* Build configuration list for PBXNativeTarget "FoldingCell" */; buildPhases = ( 8499D8801D0054A8004B5B37 /* Sources */, 8499D8811D0054A8004B5B37 /* Frameworks */, 8499D8821D0054A8004B5B37 /* Headers */, 8499D8831D0054A8004B5B37 /* Resources */, ); buildRules = ( ); dependencies = ( ); name = FoldingCell; productName = FoldingCell; productReference = 8499D8851D0054A8004B5B37 /* FoldingCell.framework */; productType = "com.apple.product-type.framework"; }; 9D57F31B1EDC7A6F0004599F /* FoldingCell-Demo */ = { isa = PBXNativeTarget; buildConfigurationList = 9D57F32D1EDC7A6F0004599F /* Build configuration list for PBXNativeTarget "FoldingCell-Demo" */; buildPhases = ( 9D57F3181EDC7A6F0004599F /* Sources */, 9D57F3191EDC7A6F0004599F /* Frameworks */, 9D57F31A1EDC7A6F0004599F /* Resources */, 9D57F3381EDC7AD80004599F /* Embed Frameworks */, ); buildRules = ( ); dependencies = ( 9D57F3371EDC7AD80004599F /* PBXTargetDependency */, ); name = "FoldingCell-Demo"; productName = "FoldingCell-Demo"; productReference = 9D57F31C1EDC7A6F0004599F /* FoldingCell-Demo.app */; productType = "com.apple.product-type.application"; }; 9DAA51531EDDBAD700DFC539 /* FoldingCell-DemoObjc */ = { isa = PBXNativeTarget; buildConfigurationList = 9DAA516A1EDDBAD700DFC539 /* Build configuration list for PBXNativeTarget "FoldingCell-DemoObjc" */; buildPhases = ( 9DAA51501EDDBAD700DFC539 /* Sources */, 9DAA51511EDDBAD700DFC539 /* Frameworks */, 9DAA51521EDDBAD700DFC539 /* Resources */, 9DAA51731EDDBB4800DFC539 /* Embed Frameworks */, ); buildRules = ( ); dependencies = ( 9DAA51721EDDBB4800DFC539 /* PBXTargetDependency */, ); name = "FoldingCell-DemoObjc"; productName = "FoldingCell-DemoObjc"; productReference = 9DAA51541EDDBAD700DFC539 /* FoldingCell-DemoObjc.app */; productType = "com.apple.product-type.application"; }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ 847A57FC1C294F750028FB84 /* Project object */ = { isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0940; LastUpgradeCheck = 1110; ORGANIZATIONNAME = "Alex K."; TargetAttributes = { 5A0E1C2C21414940006A0374 = { CreatedOnToolsVersion = 9.4; LastSwiftMigration = 1020; ProvisioningStyle = Automatic; TestTargetID = 9D57F31B1EDC7A6F0004599F; }; 8499D8841D0054A8004B5B37 = { CreatedOnToolsVersion = 7.3.1; DevelopmentTeam = LEAZS7L33U; LastSwiftMigration = 1020; }; 9D57F31B1EDC7A6F0004599F = { CreatedOnToolsVersion = 8.3.2; DevelopmentTeam = LEAZS7L33U; LastSwiftMigration = 1020; ProvisioningStyle = Automatic; }; 9DAA51531EDDBAD700DFC539 = { CreatedOnToolsVersion = 8.3.2; DevelopmentTeam = 2VFCBFYPFW; ProvisioningStyle = Automatic; }; }; }; buildConfigurationList = 847A57FF1C294F750028FB84 /* Build configuration list for PBXProject "FoldingCell" */; compatibilityVersion = "Xcode 3.2"; developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( en, Base, ); mainGroup = 847A57FB1C294F750028FB84; productRefGroup = 847A58051C294F750028FB84 /* Products */; projectDirPath = ""; projectRoot = ""; targets = ( 8499D8841D0054A8004B5B37 /* FoldingCell */, 9D57F31B1EDC7A6F0004599F /* FoldingCell-Demo */, 9DAA51531EDDBAD700DFC539 /* FoldingCell-DemoObjc */, 5A0E1C2C21414940006A0374 /* FoldingCellDemoTests */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ 5A0E1C2B21414940006A0374 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( ); runOnlyForDeploymentPostprocessing = 0; }; 8499D8831D0054A8004B5B37 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( ); runOnlyForDeploymentPostprocessing = 0; }; 9D57F31A1EDC7A6F0004599F /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( 9D57F3291EDC7A6F0004599F /* LaunchScreen.storyboard in Resources */, 9D57F3261EDC7A6F0004599F /* Assets.xcassets in Resources */, 9D57F3241EDC7A6F0004599F /* Main.storyboard in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; 9DAA51521EDDBAD700DFC539 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( 9DAA51661EDDBAD700DFC539 /* LaunchScreen.storyboard in Resources */, 9DAA51631EDDBAD700DFC539 /* Assets.xcassets in Resources */, 9DAA51611EDDBAD700DFC539 /* Main.storyboard in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ 5A0E1C2921414940006A0374 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( 5A1225D821B65E8E005BBB26 /* RotationViewTests.swift in Sources */, 5A0E1C3021414940006A0374 /* FoldingCellDemoTests.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; 8499D8801D0054A8004B5B37 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( 9D57F3331EDC7ACF0004599F /* FoldingCell.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; 9D57F3181EDC7A6F0004599F /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( 9D57F32F1EDC7A850004599F /* TableViewController.swift in Sources */, 9D57F31F1EDC7A6F0004599F /* AppDelegate.swift in Sources */, 9D57F3311EDC7AAD0004599F /* DemoCell.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; 9DAA51501EDDBAD700DFC539 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( 9DAA515B1EDDBAD700DFC539 /* AppDelegate.m in Sources */, 9DAA516D1EDDBAF900DFC539 /* TableViewController.m in Sources */, 9DAA51581EDDBAD700DFC539 /* main.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ 5A0E1C3321414940006A0374 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = 9D57F31B1EDC7A6F0004599F /* FoldingCell-Demo */; targetProxy = 5A0E1C3221414940006A0374 /* PBXContainerItemProxy */; }; 9D57F3371EDC7AD80004599F /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = 8499D8841D0054A8004B5B37 /* FoldingCell */; targetProxy = 9D57F3361EDC7AD80004599F /* PBXContainerItemProxy */; }; 9DAA51721EDDBB4800DFC539 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = 8499D8841D0054A8004B5B37 /* FoldingCell */; targetProxy = 9DAA51711EDDBB4800DFC539 /* PBXContainerItemProxy */; }; /* End PBXTargetDependency section */ /* Begin PBXVariantGroup section */ 9D57F3221EDC7A6F0004599F /* Main.storyboard */ = { isa = PBXVariantGroup; children = ( 9D57F3231EDC7A6F0004599F /* Base */, ); name = Main.storyboard; sourceTree = ""; }; 9D57F3271EDC7A6F0004599F /* LaunchScreen.storyboard */ = { isa = PBXVariantGroup; children = ( 9D57F3281EDC7A6F0004599F /* Base */, ); name = LaunchScreen.storyboard; sourceTree = ""; }; 9DAA515F1EDDBAD700DFC539 /* Main.storyboard */ = { isa = PBXVariantGroup; children = ( 9DAA51601EDDBAD700DFC539 /* Base */, ); name = Main.storyboard; sourceTree = ""; }; 9DAA51641EDDBAD700DFC539 /* LaunchScreen.storyboard */ = { isa = PBXVariantGroup; children = ( 9DAA51651EDDBAD700DFC539 /* Base */, ); name = LaunchScreen.storyboard; sourceTree = ""; }; /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ 5A0E1C3521414940006A0374 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; CLANG_ENABLE_OBJC_WEAK = YES; CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CODE_SIGN_IDENTITY = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; GCC_C_LANGUAGE_STANDARD = gnu11; INFOPLIST_FILE = FoldingCellDemoTests/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.ramotion.FoldingCellDemoTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/FoldingCell-Demo.app/FoldingCell-Demo"; }; name = Debug; }; 5A0E1C3621414940006A0374 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; CLANG_ENABLE_OBJC_WEAK = YES; CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CODE_SIGN_IDENTITY = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; GCC_C_LANGUAGE_STANDARD = gnu11; INFOPLIST_FILE = FoldingCellDemoTests/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.ramotion.FoldingCellDemoTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/FoldingCell-Demo.app/FoldingCell-Demo"; }; name = Release; }; 847A58141C294F750028FB84 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 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_NON_LITERAL_NULL_CONVERSION = YES; CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = dwarf; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_NO_COMMON_BLOCKS = YES; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", ); GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 12.2; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; }; name = Debug; }; 847A58151C294F750028FB84 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 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_NON_LITERAL_NULL_CONVERSION = YES; CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_NO_COMMON_BLOCKS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 12.2; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; VALIDATE_PRODUCT = YES; }; name = Release; }; 8499D88F1D0054A8004B5B37 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { CLANG_ANALYZER_NONNULL = YES; CLANG_ENABLE_MODULES = YES; CODE_SIGN_IDENTITY = ""; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; CURRENT_PROJECT_VERSION = 1; DEFINES_MODULE = YES; DEVELOPMENT_TEAM = LEAZS7L33U; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; INFOPLIST_FILE = FoldingCell/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.ramotion.FoldingCell; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; name = Debug; }; 8499D8901D0054A8004B5B37 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { CLANG_ANALYZER_NONNULL = YES; CLANG_ENABLE_MODULES = YES; CODE_SIGN_IDENTITY = ""; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; CURRENT_PROJECT_VERSION = 1; DEFINES_MODULE = YES; DEVELOPMENT_TEAM = LEAZS7L33U; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; INFOPLIST_FILE = FoldingCell/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.ramotion.FoldingCell; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; name = Release; }; 9D57F32B1EDC7A6F0004599F /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; DEVELOPMENT_TEAM = LEAZS7L33U; INFOPLIST_FILE = "FoldingCell-Demo/Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "ramotion.com.FoldingCell-Demo-ser"; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_VERSION = 5.0; }; name = Debug; }; 9D57F32C1EDC7A6F0004599F /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; DEVELOPMENT_TEAM = LEAZS7L33U; INFOPLIST_FILE = "FoldingCell-Demo/Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "ramotion.com.FoldingCell-Demo-ser"; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_VERSION = 5.0; }; name = Release; }; 9DAA51681EDDBAD700DFC539 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; DEVELOPMENT_TEAM = 2VFCBFYPFW; INFOPLIST_FILE = "FoldingCell-DemoObjc/Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "ramotion.com.FoldingCell-DemoObjc"; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; }; name = Debug; }; 9DAA51691EDDBAD700DFC539 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; DEVELOPMENT_TEAM = 2VFCBFYPFW; INFOPLIST_FILE = "FoldingCell-DemoObjc/Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "ramotion.com.FoldingCell-DemoObjc"; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; }; name = Release; }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ 5A0E1C3421414940006A0374 /* Build configuration list for PBXNativeTarget "FoldingCellDemoTests" */ = { isa = XCConfigurationList; buildConfigurations = ( 5A0E1C3521414940006A0374 /* Debug */, 5A0E1C3621414940006A0374 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; 847A57FF1C294F750028FB84 /* Build configuration list for PBXProject "FoldingCell" */ = { isa = XCConfigurationList; buildConfigurations = ( 847A58141C294F750028FB84 /* Debug */, 847A58151C294F750028FB84 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; 8499D88E1D0054A8004B5B37 /* Build configuration list for PBXNativeTarget "FoldingCell" */ = { isa = XCConfigurationList; buildConfigurations = ( 8499D88F1D0054A8004B5B37 /* Debug */, 8499D8901D0054A8004B5B37 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; 9D57F32D1EDC7A6F0004599F /* Build configuration list for PBXNativeTarget "FoldingCell-Demo" */ = { isa = XCConfigurationList; buildConfigurations = ( 9D57F32B1EDC7A6F0004599F /* Debug */, 9D57F32C1EDC7A6F0004599F /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; 9DAA516A1EDDBAD700DFC539 /* Build configuration list for PBXNativeTarget "FoldingCell-DemoObjc" */ = { isa = XCConfigurationList; buildConfigurations = ( 9DAA51681EDDBAD700DFC539 /* Debug */, 9DAA51691EDDBAD700DFC539 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; rootObject = 847A57FC1C294F750028FB84 /* Project object */; } ================================================ FILE: FoldingCell/FoldingCell.xcodeproj/project.xcworkspace/contents.xcworkspacedata ================================================ ================================================ FILE: FoldingCell/FoldingCell.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist ================================================ IDEDidComputeMac32BitWarning ================================================ FILE: FoldingCell/FoldingCell.xcodeproj/xcshareddata/xcschemes/FoldingCell.xcscheme ================================================ ================================================ FILE: FoldingCell/FoldingCellDemoTests/FoldingCellDemoTests.swift ================================================ import XCTest import UIKit @testable import FoldingCell @testable import FoldingCell_Demo class FoldingCellDemoTests: XCTestCase { var foldingCell: FoldingCell! override func setUp() { super.setUp() let storyboard = UIStoryboard(name: "Main", bundle: nil) let vc = storyboard.instantiateViewController(withIdentifier: "MainTableViewController") as! MainTableViewController _ = vc.view foldingCell = vc.tableView.dequeueReusableCell(withIdentifier: "FoldingCell", for: IndexPath(row: 0, section: 0)) as? FoldingCell } func testCreateFoldingCell() { XCTAssertNotNil(foldingCell) } func testUnfold() { XCTAssertEqual(foldingCell.isUnfolded, false) foldingCell.unfold(true) XCTAssertEqual(foldingCell.isUnfolded, true) foldingCell.unfold(false) XCTAssertEqual(foldingCell.isUnfolded, false) } } ================================================ FILE: FoldingCell/FoldingCellDemoTests/Info.plist ================================================ CFBundleDevelopmentRegion $(DEVELOPMENT_LANGUAGE) CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName $(PRODUCT_NAME) CFBundlePackageType BNDL CFBundleShortVersionString 1.0 CFBundleVersion 1 ================================================ FILE: FoldingCell/FoldingCellDemoTests/RotationViewTests.swift ================================================ import XCTest import UIKit @testable import FoldingCell class RotationViewTests: XCTestCase { var rotationView: RotatedView! override func setUp() { rotationView = RotatedView() } func testCreateRotationView() { XCTAssertNotNil(rotationView) } func testAddBackView() { XCTAssertNil(rotationView.backView) let color = UIColor.red rotationView.addBackView(100, color: color) XCTAssertNotNil(rotationView.backView) XCTAssertEqual(rotationView.backView?.backgroundColor, color) } func testRotateX() { let key = "layer.transform.rotation.x" let startX = (rotationView.value(forKeyPath: key) as? NSNumber)?.floatValue XCTAssertEqual(startX, 0) let angel: CGFloat = 0.5 rotationView.rotatedX(angel) let x = (rotationView.value(forKeyPath: key) as? NSNumber)?.floatValue XCTAssertEqual(x, Float(angel)) } } ================================================ FILE: FoldingCell.podspec ================================================ Pod::Spec.new do |s| s.name = 'FoldingCell' s.version = '5.0.2' s.summary = 'UITableViewCell with folding animation.' s.homepage = 'https://github.com/Ramotion/folding-cell' s.license = 'MIT' s.authors = { 'Juri Vasylenko' => 'juri.v@ramotion.com' } s.ios.deployment_target = '8.0' s.source = { :git => 'https://github.com/Ramotion/folding-cell.git', :tag => s.version.to_s } s.source_files = 'FoldingCell/FoldingCell/*.swift' end ================================================ FILE: LICENSE ================================================ The MIT License (MIT) Copyright (c) 2015 Ramotion Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================ FILE: Package.swift ================================================ // swift-tools-version:5.1 // // Package.swift // // Copyright (c) Ramotion Inc. (https://www.ramotion.com/) // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. // import PackageDescription let package = Package( name: "FoldingCell", platforms: [ .iOS(.v8) ], products: [ .library(name: "FoldingCell", targets: ["FoldingCell"]), ], targets: [ .target(name: "FoldingCell", path: "FoldingCell/FoldingCell") ], swiftLanguageVersions: [.v5] ) ================================================ FILE: README.md ================================================

FOLDING CELL

Expanding content cell with animation inspired by folding paper card material design.

___

We specialize in the designing and coding of custom UI for Mobile Apps and Websites.

Stay tuned for the latest updates:


[![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) [![codebeat badge](https://codebeat.co/badges/6f67da5d-c416-4bac-9fb7-c2dc938feedc)](https://codebeat.co/projects/github-com-ramotion-folding-cell) [![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) [![Swift 4.0](https://img.shields.io/badge/Swift-5.0-green.svg?style=flat)](https://developer.apple.com/swift/) [![Analytics](https://ga-beacon.appspot.com/UA-84973210-1/ramotion/folding-cell)](https://github.com/igrigorik/ga-beacon) [![Donate](https://img.shields.io/badge/Donate-PayPal-blue.svg)](https://paypal.me/Ramotion) ## Requirements - iOS 8.0+ - Xcode 10.2 ## Installation Just add the FoldingCell.swift file to your project. or use [CocoaPods](https://cocoapods.org) with Podfile: ``` pod 'FoldingCell' ``` or [Carthage](https://github.com/Carthage/Carthage) users can simply add Mantle to their `Cartfile`: ``` github "Ramotion/folding-cell" ``` or [Swift Package Manager](https://swift.org/package-manager/) by adding: ``` dependencies: [ .package(url: "https://github.com/Ramotion/folding-cell.git", from: "5.0.2") ] ``` to `Package.swift` or just drag and drop FoldingCell.swift file to your project ## Solution ![Solution](https://raw.githubusercontent.com/Ramotion/folding-cell/master/Tutorial-resources/Solution.png) ## Usage 1) Create a new cell inheriting from `FoldingCell` 2) Add a UIView to your cell in your storyboard or nib file, inheriting from `RotatedView`. Connect the outlet from this view to the cell property `foregroundView`. Add constraints from this view to the superview, as in this picture: ![1.1](https://raw.githubusercontent.com/Ramotion/folding-cell/master/Tutorial-resources/1.1.png) (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: ![1.2](https://raw.githubusercontent.com/Ramotion/folding-cell/master/Tutorial-resources/1.2.png) (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: ![1.3](https://raw.githubusercontent.com/Ramotion/folding-cell/master/Tutorial-resources/1.3.png) 4) Set ``` @IBInspectable var itemCount: NSInteger ``` property is a count of folding (it IBInspectable you can set in storyboard). range 2 or greater. Default value is 2 Ok, we've finished configuring the cell. 5) Adding code to your UITableViewController 5.1) Add constants: ``` swift fileprivate struct C { struct CellHeight { static let close: CGFloat = *** // equal or greater foregroundView height static let open: CGFloat = *** // equal or greater containerView height } } ``` 5.2) Add property for calculate cells height ``` swift var cellHeights = (0.. CGFloat { return cellHeights[indexPath.row] } ``` 5.4) Added code to method: ``` swift override func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) { guard case let cell as FoldingCell = tableView.cellForRowAtIndexPath(indexPath) else { return } var duration = 0.0 if cellIsCollapsed { cellHeights[indexPath.row] = Const.openCellHeight cell.unfold(true, animated: true, completion: nil) duration = 0.5 } else { cellHeights[indexPath.row] = Const.closeCellHeight cell.unfold(false, animated: true, completion: nil) duration = 0.8 } UIView.animateWithDuration(duration, delay: 0, options: .CurveEaseOut, animations: { _ in tableView.beginUpdates() tableView.endUpdates() }, completion: nil) } ``` 5.5) Control if the cell is open or closed ``` swift override func tableView(tableView: UITableView, willDisplayCell cell: UITableViewCell, forRowAtIndexPath indexPath: NSIndexPath) { if case let cell as FoldingCell = cell { if cellHeights![indexPath.row] == C.cellHeights.close { foldingCell.selectedAnimation(false, animated: false, completion:nil) } else { foldingCell.selectedAnimation(true, animated: false, completion: nil) } } } ``` 6) Add this code to your new cell class ``` swift override func animationDuration(itemIndex:NSInteger, type:AnimationType)-> NSTimeInterval { // durations count equal it itemCount let durations = [0.33, 0.26, 0.26] // timing animation for each view return durations[itemIndex] } ``` ## if don't use storyboard and xib files Create foregroundView and containerView from code (steps 2 - 3) look example: [Folding-cell-programmatically](https://github.com/ober01/Folding-cell-programmatically) ## 🗂 Check this library on other language: ## 📄 License Folding cell is released under the MIT license. See [LICENSE](./LICENSE) for details. This library is a part of a selection of our best UI open-source projects. If you use the open-source library in your project, please make sure to credit and backlink to https://www.ramotion.com/ ## 📱 Get the Showroom App for iOS to give it a try Try this UI component and more like this in our iOS app. Contact us if interested. ================================================ FILE: docs/Classes/FoldingCell.html ================================================ FoldingCell Class Reference

FoldingCell Docs (42% documented)

FoldingCell

public class FoldingCell: UITableViewCell

UITableViewCell with folding animation

  • UIView whitch display when cell open

    Declaration

    Swift

    @IBOutlet weak public var containerView: UIView!
  • UIView whitch display when cell close

    Declaration

    Swift

    @IBOutlet weak public var foregroundView: RotatedView!
  • the number of folding elements. Default 2

    Declaration

    Swift

    @IBInspectable public var itemCount: NSInteger = 2
  • The color of the back cell

    Declaration

    Swift

    @IBInspectable public var backViewColor: UIColor = UIColor.brownColor()
  • Folding animation types

    • Open: Open direction
    • Close: Close direction

    Declaration

    Swift

    public enum AnimationType
  • Call this method in methods init(style: UITableViewCellStyle, reuseIdentifier: String?) after creating Views

    Declaration

    Swift

    public func commonInit()
  • Open or close cell

    Declaration

    Swift

    public func selectedAnimation(isSelected: Bool, animated: Bool, completion: (Void -> Void)?)

    Parameters

    isSelected

    Specify true if you want to open cell or false if you close cell.

    animated

    Specify true if you want to animate the change in visibility or false if you want immediately.

    completion

    A block object to be executed when the animation sequence ends.

================================================ FILE: docs/Classes.html ================================================ Classes Reference

FoldingCell Docs (42% documented)

Classes

The following classes are available globally.

  • UITableViewCell with folding animation

    See more

    Declaration

    Swift

    public class FoldingCell: UITableViewCell
================================================ FILE: docs/css/highlight.css ================================================ /* Credit to https://gist.github.com/wataru420/2048287 */ .highlight { /* Comment */ /* Error */ /* Keyword */ /* Operator */ /* Comment.Multiline */ /* Comment.Preproc */ /* Comment.Single */ /* Comment.Special */ /* Generic.Deleted */ /* Generic.Deleted.Specific */ /* Generic.Emph */ /* Generic.Error */ /* Generic.Heading */ /* Generic.Inserted */ /* Generic.Inserted.Specific */ /* Generic.Output */ /* Generic.Prompt */ /* Generic.Strong */ /* Generic.Subheading */ /* Generic.Traceback */ /* Keyword.Constant */ /* Keyword.Declaration */ /* Keyword.Pseudo */ /* Keyword.Reserved */ /* Keyword.Type */ /* Literal.Number */ /* Literal.String */ /* Name.Attribute */ /* Name.Builtin */ /* Name.Class */ /* Name.Constant */ /* Name.Entity */ /* Name.Exception */ /* Name.Function */ /* Name.Namespace */ /* Name.Tag */ /* Name.Variable */ /* Operator.Word */ /* Text.Whitespace */ /* Literal.Number.Float */ /* Literal.Number.Hex */ /* Literal.Number.Integer */ /* Literal.Number.Oct */ /* Literal.String.Backtick */ /* Literal.String.Char */ /* Literal.String.Doc */ /* Literal.String.Double */ /* Literal.String.Escape */ /* Literal.String.Heredoc */ /* Literal.String.Interpol */ /* Literal.String.Other */ /* Literal.String.Regex */ /* Literal.String.Single */ /* Literal.String.Symbol */ /* Name.Builtin.Pseudo */ /* Name.Variable.Class */ /* Name.Variable.Global */ /* Name.Variable.Instance */ /* Literal.Number.Integer.Long */ } .highlight .c { color: #999988; font-style: italic; } .highlight .err { color: #a61717; background-color: #e3d2d2; } .highlight .k { color: #000000; font-weight: bold; } .highlight .o { color: #000000; font-weight: bold; } .highlight .cm { color: #999988; font-style: italic; } .highlight .cp { color: #999999; font-weight: bold; } .highlight .c1 { color: #999988; font-style: italic; } .highlight .cs { color: #999999; font-weight: bold; font-style: italic; } .highlight .gd { color: #000000; background-color: #ffdddd; } .highlight .gd .x { color: #000000; background-color: #ffaaaa; } .highlight .ge { color: #000000; font-style: italic; } .highlight .gr { color: #aa0000; } .highlight .gh { color: #999999; } .highlight .gi { color: #000000; background-color: #ddffdd; } .highlight .gi .x { color: #000000; background-color: #aaffaa; } .highlight .go { color: #888888; } .highlight .gp { color: #555555; } .highlight .gs { font-weight: bold; } .highlight .gu { color: #aaaaaa; } .highlight .gt { color: #aa0000; } .highlight .kc { color: #000000; font-weight: bold; } .highlight .kd { color: #000000; font-weight: bold; } .highlight .kp { color: #000000; font-weight: bold; } .highlight .kr { color: #000000; font-weight: bold; } .highlight .kt { color: #445588; } .highlight .m { color: #009999; } .highlight .s { color: #d14; } .highlight .na { color: #008080; } .highlight .nb { color: #0086B3; } .highlight .nc { color: #445588; font-weight: bold; } .highlight .no { color: #008080; } .highlight .ni { color: #800080; } .highlight .ne { color: #990000; font-weight: bold; } .highlight .nf { color: #990000; } .highlight .nn { color: #555555; } .highlight .nt { color: #000080; } .highlight .nv { color: #008080; } .highlight .ow { color: #000000; font-weight: bold; } .highlight .w { color: #bbbbbb; } .highlight .mf { color: #009999; } .highlight .mh { color: #009999; } .highlight .mi { color: #009999; } .highlight .mo { color: #009999; } .highlight .sb { color: #d14; } .highlight .sc { color: #d14; } .highlight .sd { color: #d14; } .highlight .s2 { color: #d14; } .highlight .se { color: #d14; } .highlight .sh { color: #d14; } .highlight .si { color: #d14; } .highlight .sx { color: #d14; } .highlight .sr { color: #009926; } .highlight .s1 { color: #d14; } .highlight .ss { color: #990073; } .highlight .bp { color: #999999; } .highlight .vc { color: #008080; } .highlight .vg { color: #008080; } .highlight .vi { color: #008080; } .highlight .il { color: #009999; } ================================================ FILE: docs/css/jazzy.css ================================================ html, body, div, span, h1, h3, h4, p, a, code, em, img, ul, li, table, tbody, tr, td { background: transparent; border: 0; margin: 0; outline: 0; padding: 0; vertical-align: baseline; } body { background-color: #f2f2f2; font-family: Helvetica, freesans, Arial, sans-serif; font-size: 14px; -webkit-font-smoothing: subpixel-antialiased; word-wrap: break-word; } h1, h2, h3 { margin-top: 0.8em; margin-bottom: 0.3em; font-weight: 100; color: black; } h1 { font-size: 2.5em; } h2 { font-size: 2em; border-bottom: 1px solid #e2e2e2; } h4 { font-size: 13px; line-height: 1.5; margin-top: 21px; } h5 { font-size: 1.1em; } h6 { font-size: 1.1em; color: #777; } .section-name { color: gray; display: block; font-family: Helvetica; font-size: 22px; font-weight: 100; margin-bottom: 15px; } pre, code { font: 0.95em Menlo, monospace; color: #777; word-wrap: normal; } p code, li code { background-color: #eee; padding: 2px 4px; border-radius: 4px; } a { color: #0088cc; text-decoration: none; } ul { padding-left: 15px; } li { line-height: 1.8em; } img { max-width: 100%; } blockquote { margin-left: 0; padding: 0 10px; border-left: 4px solid #ccc; } .content-wrapper { margin: 0 auto; width: 980px; } header { font-size: 0.85em; line-height: 26px; background-color: #414141; position: fixed; width: 100%; z-index: 1; } header img { padding-right: 6px; vertical-align: -4px; height: 16px; } header a { color: #fff; } header p { float: left; color: #999; } header .header-right { float: right; margin-left: 16px; } #breadcrumbs { background-color: #f2f2f2; height: 27px; padding-top: 17px; position: fixed; width: 100%; z-index: 1; margin-top: 26px; } #breadcrumbs #carat { height: 10px; margin: 0 5px; } .sidebar { background-color: #f9f9f9; border: 1px solid #e2e2e2; overflow-y: auto; overflow-x: hidden; position: fixed; top: 70px; bottom: 0; width: 230px; word-wrap: normal; } .nav-groups { list-style-type: none; background: #fff; padding-left: 0; } .nav-group-name { border-bottom: 1px solid #e2e2e2; font-size: 1.1em; font-weight: 100; padding: 15px 0 15px 20px; } .nav-group-name > a { color: #333; } .nav-group-tasks { margin-top: 5px; } .nav-group-task { font-size: 0.9em; list-style-type: none; } .nav-group-task a { color: #888; } .main-content { background-color: #fff; border: 1px solid #e2e2e2; margin-left: 246px; position: absolute; overflow: hidden; padding-bottom: 60px; top: 70px; width: 734px; } .main-content p, .main-content a, .main-content code, .main-content em, .main-content ul, .main-content table, .main-content blockquote { margin-bottom: 1em; } .main-content p { line-height: 1.8em; } .main-content section .section:first-child { margin-top: 0; padding-top: 0; } .main-content section .task-group-section .task-group:first-of-type { padding-top: 10px; } .main-content section .task-group-section .task-group:first-of-type .section-name { padding-top: 15px; } .section { padding: 0 25px; } .highlight { background-color: #eee; padding: 10px 12px; border: 1px solid #e2e2e2; border-radius: 4px; overflow-x: auto; } .declaration .highlight { overflow-x: initial; padding: 0 40px 40px 0; margin-bottom: -25px; background-color: transparent; border: none; } .section-name { margin: 0; margin-left: 18px; } .task-group-section { padding-left: 6px; border-top: 1px solid #e2e2e2; } .task-group { padding-top: 0px; } .task-name-container a[name]:before { content: ""; display: block; padding-top: 70px; margin: -70px 0 0; } .item { padding-top: 8px; width: 100%; list-style-type: none; } .item a[name]:before { content: ""; display: block; padding-top: 70px; margin: -70px 0 0; } .item code { background-color: transparent; padding: 0; } .item .token { padding-left: 3px; margin-left: 15px; font-size: 11.9px; } .item .declaration-note { font-size: .85em; color: gray; font-style: italic; } .pointer-container { border-bottom: 1px solid #e2e2e2; left: -23px; padding-bottom: 13px; position: relative; width: 110%; } .pointer { background: #f9f9f9; border-left: 1px solid #e2e2e2; border-top: 1px solid #e2e2e2; height: 12px; left: 21px; top: -7px; -webkit-transform: rotate(45deg); -moz-transform: rotate(45deg); -o-transform: rotate(45deg); transform: rotate(45deg); position: absolute; width: 12px; } .height-container { display: none; left: -25px; padding: 0 25px; position: relative; width: 100%; overflow: hidden; } .height-container .section { background: #f9f9f9; border-bottom: 1px solid #e2e2e2; left: -25px; position: relative; width: 100%; padding-top: 10px; padding-bottom: 5px; } .aside, .language { padding: 6px 12px; margin: 12px 0; border-left: 5px solid #dddddd; overflow-y: hidden; } .aside .aside-title, .language .aside-title { font-size: 9px; letter-spacing: 2px; text-transform: uppercase; padding-bottom: 0; margin: 0; color: #aaa; -webkit-user-select: none; } .aside p:last-child, .language p:last-child { margin-bottom: 0; } .language { border-left: 5px solid #cde9f4; } .language .aside-title { color: #4b8afb; } .aside-warning { border-left: 5px solid #ff6666; } .aside-warning .aside-title { color: #ff0000; } .graybox { border-collapse: collapse; width: 100%; } .graybox p { margin: 0; word-break: break-word; min-width: 50px; } .graybox td { border: 1px solid #e2e2e2; padding: 5px 25px 5px 10px; vertical-align: middle; } .graybox tr td:first-of-type { text-align: right; padding: 7px; vertical-align: top; word-break: normal; width: 40px; } .slightly-smaller { font-size: 0.9em; } #footer { position: absolute; bottom: 10px; margin-left: 25px; } #footer p { margin: 0; color: #aaa; font-size: 0.8em; } html.dash header, html.dash #breadcrumbs, html.dash .sidebar { display: none; } html.dash .main-content { width: 980px; margin-left: 0; border: none; width: 100%; top: 0; padding-bottom: 0; } html.dash .height-container { display: block; } html.dash .item .token { margin-left: 0; } html.dash .content-wrapper { width: auto; } html.dash #footer { position: static; } ================================================ FILE: docs/docsets/FoldingCell.docset/Contents/Info.plist ================================================ CFBundleIdentifier com.jazzy.foldingcell CFBundleName FoldingCell DocSetPlatformFamily jazzy isDashDocset dashIndexFilePath index.html isJavaScriptEnabled DashDocSetFamily dashtoc ================================================ FILE: docs/docsets/FoldingCell.docset/Contents/Resources/Documents/Classes/FoldingCell.html ================================================ FoldingCell Class Reference

FoldingCell Docs (42% documented)

FoldingCell

public class FoldingCell: UITableViewCell

UITableViewCell with folding animation

  • UIView whitch display when cell open

    Declaration

    Swift

    @IBOutlet weak public var containerView: UIView!
  • UIView whitch display when cell close

    Declaration

    Swift

    @IBOutlet weak public var foregroundView: RotatedView!
  • the number of folding elements. Default 2

    Declaration

    Swift

    @IBInspectable public var itemCount: NSInteger = 2
  • The color of the back cell

    Declaration

    Swift

    @IBInspectable public var backViewColor: UIColor = UIColor.brownColor()
  • Folding animation types

    • Open: Open direction
    • Close: Close direction

    Declaration

    Swift

    public enum AnimationType
  • Call this method in methods init(style: UITableViewCellStyle, reuseIdentifier: String?) after creating Views

    Declaration

    Swift

    public func commonInit()
  • Open or close cell

    Declaration

    Swift

    public func selectedAnimation(isSelected: Bool, animated: Bool, completion: (Void -> Void)?)

    Parameters

    isSelected

    Specify true if you want to open cell or false if you close cell.

    animated

    Specify true if you want to animate the change in visibility or false if you want immediately.

    completion

    A block object to be executed when the animation sequence ends.

================================================ FILE: docs/docsets/FoldingCell.docset/Contents/Resources/Documents/Classes.html ================================================ Classes Reference

FoldingCell Docs (42% documented)

Classes

The following classes are available globally.

  • UITableViewCell with folding animation

    See more

    Declaration

    Swift

    public class FoldingCell: UITableViewCell
================================================ FILE: docs/docsets/FoldingCell.docset/Contents/Resources/Documents/css/highlight.css ================================================ /* Credit to https://gist.github.com/wataru420/2048287 */ .highlight { /* Comment */ /* Error */ /* Keyword */ /* Operator */ /* Comment.Multiline */ /* Comment.Preproc */ /* Comment.Single */ /* Comment.Special */ /* Generic.Deleted */ /* Generic.Deleted.Specific */ /* Generic.Emph */ /* Generic.Error */ /* Generic.Heading */ /* Generic.Inserted */ /* Generic.Inserted.Specific */ /* Generic.Output */ /* Generic.Prompt */ /* Generic.Strong */ /* Generic.Subheading */ /* Generic.Traceback */ /* Keyword.Constant */ /* Keyword.Declaration */ /* Keyword.Pseudo */ /* Keyword.Reserved */ /* Keyword.Type */ /* Literal.Number */ /* Literal.String */ /* Name.Attribute */ /* Name.Builtin */ /* Name.Class */ /* Name.Constant */ /* Name.Entity */ /* Name.Exception */ /* Name.Function */ /* Name.Namespace */ /* Name.Tag */ /* Name.Variable */ /* Operator.Word */ /* Text.Whitespace */ /* Literal.Number.Float */ /* Literal.Number.Hex */ /* Literal.Number.Integer */ /* Literal.Number.Oct */ /* Literal.String.Backtick */ /* Literal.String.Char */ /* Literal.String.Doc */ /* Literal.String.Double */ /* Literal.String.Escape */ /* Literal.String.Heredoc */ /* Literal.String.Interpol */ /* Literal.String.Other */ /* Literal.String.Regex */ /* Literal.String.Single */ /* Literal.String.Symbol */ /* Name.Builtin.Pseudo */ /* Name.Variable.Class */ /* Name.Variable.Global */ /* Name.Variable.Instance */ /* Literal.Number.Integer.Long */ } .highlight .c { color: #999988; font-style: italic; } .highlight .err { color: #a61717; background-color: #e3d2d2; } .highlight .k { color: #000000; font-weight: bold; } .highlight .o { color: #000000; font-weight: bold; } .highlight .cm { color: #999988; font-style: italic; } .highlight .cp { color: #999999; font-weight: bold; } .highlight .c1 { color: #999988; font-style: italic; } .highlight .cs { color: #999999; font-weight: bold; font-style: italic; } .highlight .gd { color: #000000; background-color: #ffdddd; } .highlight .gd .x { color: #000000; background-color: #ffaaaa; } .highlight .ge { color: #000000; font-style: italic; } .highlight .gr { color: #aa0000; } .highlight .gh { color: #999999; } .highlight .gi { color: #000000; background-color: #ddffdd; } .highlight .gi .x { color: #000000; background-color: #aaffaa; } .highlight .go { color: #888888; } .highlight .gp { color: #555555; } .highlight .gs { font-weight: bold; } .highlight .gu { color: #aaaaaa; } .highlight .gt { color: #aa0000; } .highlight .kc { color: #000000; font-weight: bold; } .highlight .kd { color: #000000; font-weight: bold; } .highlight .kp { color: #000000; font-weight: bold; } .highlight .kr { color: #000000; font-weight: bold; } .highlight .kt { color: #445588; } .highlight .m { color: #009999; } .highlight .s { color: #d14; } .highlight .na { color: #008080; } .highlight .nb { color: #0086B3; } .highlight .nc { color: #445588; font-weight: bold; } .highlight .no { color: #008080; } .highlight .ni { color: #800080; } .highlight .ne { color: #990000; font-weight: bold; } .highlight .nf { color: #990000; } .highlight .nn { color: #555555; } .highlight .nt { color: #000080; } .highlight .nv { color: #008080; } .highlight .ow { color: #000000; font-weight: bold; } .highlight .w { color: #bbbbbb; } .highlight .mf { color: #009999; } .highlight .mh { color: #009999; } .highlight .mi { color: #009999; } .highlight .mo { color: #009999; } .highlight .sb { color: #d14; } .highlight .sc { color: #d14; } .highlight .sd { color: #d14; } .highlight .s2 { color: #d14; } .highlight .se { color: #d14; } .highlight .sh { color: #d14; } .highlight .si { color: #d14; } .highlight .sx { color: #d14; } .highlight .sr { color: #009926; } .highlight .s1 { color: #d14; } .highlight .ss { color: #990073; } .highlight .bp { color: #999999; } .highlight .vc { color: #008080; } .highlight .vg { color: #008080; } .highlight .vi { color: #008080; } .highlight .il { color: #009999; } ================================================ FILE: docs/docsets/FoldingCell.docset/Contents/Resources/Documents/css/jazzy.css ================================================ html, body, div, span, h1, h3, h4, p, a, code, em, img, ul, li, table, tbody, tr, td { background: transparent; border: 0; margin: 0; outline: 0; padding: 0; vertical-align: baseline; } body { background-color: #f2f2f2; font-family: Helvetica, freesans, Arial, sans-serif; font-size: 14px; -webkit-font-smoothing: subpixel-antialiased; word-wrap: break-word; } h1, h2, h3 { margin-top: 0.8em; margin-bottom: 0.3em; font-weight: 100; color: black; } h1 { font-size: 2.5em; } h2 { font-size: 2em; border-bottom: 1px solid #e2e2e2; } h4 { font-size: 13px; line-height: 1.5; margin-top: 21px; } h5 { font-size: 1.1em; } h6 { font-size: 1.1em; color: #777; } .section-name { color: gray; display: block; font-family: Helvetica; font-size: 22px; font-weight: 100; margin-bottom: 15px; } pre, code { font: 0.95em Menlo, monospace; color: #777; word-wrap: normal; } p code, li code { background-color: #eee; padding: 2px 4px; border-radius: 4px; } a { color: #0088cc; text-decoration: none; } ul { padding-left: 15px; } li { line-height: 1.8em; } img { max-width: 100%; } blockquote { margin-left: 0; padding: 0 10px; border-left: 4px solid #ccc; } .content-wrapper { margin: 0 auto; width: 980px; } header { font-size: 0.85em; line-height: 26px; background-color: #414141; position: fixed; width: 100%; z-index: 1; } header img { padding-right: 6px; vertical-align: -4px; height: 16px; } header a { color: #fff; } header p { float: left; color: #999; } header .header-right { float: right; margin-left: 16px; } #breadcrumbs { background-color: #f2f2f2; height: 27px; padding-top: 17px; position: fixed; width: 100%; z-index: 1; margin-top: 26px; } #breadcrumbs #carat { height: 10px; margin: 0 5px; } .sidebar { background-color: #f9f9f9; border: 1px solid #e2e2e2; overflow-y: auto; overflow-x: hidden; position: fixed; top: 70px; bottom: 0; width: 230px; word-wrap: normal; } .nav-groups { list-style-type: none; background: #fff; padding-left: 0; } .nav-group-name { border-bottom: 1px solid #e2e2e2; font-size: 1.1em; font-weight: 100; padding: 15px 0 15px 20px; } .nav-group-name > a { color: #333; } .nav-group-tasks { margin-top: 5px; } .nav-group-task { font-size: 0.9em; list-style-type: none; } .nav-group-task a { color: #888; } .main-content { background-color: #fff; border: 1px solid #e2e2e2; margin-left: 246px; position: absolute; overflow: hidden; padding-bottom: 60px; top: 70px; width: 734px; } .main-content p, .main-content a, .main-content code, .main-content em, .main-content ul, .main-content table, .main-content blockquote { margin-bottom: 1em; } .main-content p { line-height: 1.8em; } .main-content section .section:first-child { margin-top: 0; padding-top: 0; } .main-content section .task-group-section .task-group:first-of-type { padding-top: 10px; } .main-content section .task-group-section .task-group:first-of-type .section-name { padding-top: 15px; } .section { padding: 0 25px; } .highlight { background-color: #eee; padding: 10px 12px; border: 1px solid #e2e2e2; border-radius: 4px; overflow-x: auto; } .declaration .highlight { overflow-x: initial; padding: 0 40px 40px 0; margin-bottom: -25px; background-color: transparent; border: none; } .section-name { margin: 0; margin-left: 18px; } .task-group-section { padding-left: 6px; border-top: 1px solid #e2e2e2; } .task-group { padding-top: 0px; } .task-name-container a[name]:before { content: ""; display: block; padding-top: 70px; margin: -70px 0 0; } .item { padding-top: 8px; width: 100%; list-style-type: none; } .item a[name]:before { content: ""; display: block; padding-top: 70px; margin: -70px 0 0; } .item code { background-color: transparent; padding: 0; } .item .token { padding-left: 3px; margin-left: 15px; font-size: 11.9px; } .item .declaration-note { font-size: .85em; color: gray; font-style: italic; } .pointer-container { border-bottom: 1px solid #e2e2e2; left: -23px; padding-bottom: 13px; position: relative; width: 110%; } .pointer { background: #f9f9f9; border-left: 1px solid #e2e2e2; border-top: 1px solid #e2e2e2; height: 12px; left: 21px; top: -7px; -webkit-transform: rotate(45deg); -moz-transform: rotate(45deg); -o-transform: rotate(45deg); transform: rotate(45deg); position: absolute; width: 12px; } .height-container { display: none; left: -25px; padding: 0 25px; position: relative; width: 100%; overflow: hidden; } .height-container .section { background: #f9f9f9; border-bottom: 1px solid #e2e2e2; left: -25px; position: relative; width: 100%; padding-top: 10px; padding-bottom: 5px; } .aside, .language { padding: 6px 12px; margin: 12px 0; border-left: 5px solid #dddddd; overflow-y: hidden; } .aside .aside-title, .language .aside-title { font-size: 9px; letter-spacing: 2px; text-transform: uppercase; padding-bottom: 0; margin: 0; color: #aaa; -webkit-user-select: none; } .aside p:last-child, .language p:last-child { margin-bottom: 0; } .language { border-left: 5px solid #cde9f4; } .language .aside-title { color: #4b8afb; } .aside-warning { border-left: 5px solid #ff6666; } .aside-warning .aside-title { color: #ff0000; } .graybox { border-collapse: collapse; width: 100%; } .graybox p { margin: 0; word-break: break-word; min-width: 50px; } .graybox td { border: 1px solid #e2e2e2; padding: 5px 25px 5px 10px; vertical-align: middle; } .graybox tr td:first-of-type { text-align: right; padding: 7px; vertical-align: top; word-break: normal; width: 40px; } .slightly-smaller { font-size: 0.9em; } #footer { position: absolute; bottom: 10px; margin-left: 25px; } #footer p { margin: 0; color: #aaa; font-size: 0.8em; } html.dash header, html.dash #breadcrumbs, html.dash .sidebar { display: none; } html.dash .main-content { width: 980px; margin-left: 0; border: none; width: 100%; top: 0; padding-bottom: 0; } html.dash .height-container { display: block; } html.dash .item .token { margin-left: 0; } html.dash .content-wrapper { width: auto; } html.dash #footer { position: static; } ================================================ FILE: docs/docsets/FoldingCell.docset/Contents/Resources/Documents/index.html ================================================ FoldingCell Reference

FoldingCell Docs (42% documented)

header

FoldingCell

CocoaPods CocoaPods CocoaPods Carthage compatible Twitter Travis codebeat badge Carthage compatible

shot on dribbble: Animation

The iPhone mockup available here.

Requirements

  • iOS 8.0+
  • Xcode 7.3

Installation

Just add the FoldingCell.swift file to your project.

or use CocoaPods with Podfile: ruby pod 'FoldingCell', '~> 0.8.1'

or Carthage users can simply add Mantle to their Cartfile: github "Ramotion/folding-cell"

Solution

Solution

Usage

1) Create a new cell inheriting from FoldingCell

2) Add a UIView to your cell in your storyboard or nib file, inheriting from RotatedView. Connect the outlet from this view to the cell property foregroundView. Add constraints from this view to the superview, as in this picture:

1.1

(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:

1.2

(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:

1.3

Demonstration adding constraints for foregroundView, containerView

4) Set @IBInspectable var itemCount: NSInteger property is a count of folding (it IBInspectable you can set in storyboard). range 2 or greater. Default value is 2

Ok, we’ve finished configuring the cell.

5) Adding code to your UITableViewController

5.1) Add constants: swift let kCloseCellHeight: CGFloat = *** // equal or greater foregroundView height let kOpenCellHeight: CGFloat = *** // equal or greater containerView height 5.2) Add property

     var cellHeights = [CGFloat]()
 create in viewDidLoad:
     override func viewDidLoad() {
        super.viewDidLoad()

        for _ in 0...kRowsCount {
            cellHeights.append(kCloseCellHeight)
        }
    }

5.3) Override method: swift override func tableView(tableView: UITableView, heightForRowAtIndexPath indexPath: NSIndexPath) -> CGFloat { return cellHeights[indexPath.row] }

5.4) Added code to method: “` swift override func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) { let cell = tableView.cellForRowAtIndexPath(indexPath) as! FoldingCell

    var duration = 0.0
    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
        cell.selectedAnimation(false, animated: true, completion: nil)
        duration = 1.1
    }

    UIView.animateWithDuration(duration, delay: 0, options: .CurveEaseOut, animations: { () -> Void in
        tableView.beginUpdates()
        tableView.endUpdates()
    }, completion: nil)
}
5.5) Control if the cell is open or closed
``` swift
  override func tableView(tableView: UITableView, willDisplayCell cell: UITableViewCell, forRowAtIndexPath indexPath: NSIndexPath) {

        if cell is FoldingCell {
            let foldingCell = cell as! FoldingCell

            if cellHeights![indexPath.row] == kCloseCellHeight {
                foldingCell.selectedAnimation(false, animated: false, completion:nil)
            } else {
                foldingCell.selectedAnimation(true, animated: false, completion: nil)
            }
        }
    }

6) Add this code to your new cell class ”` swift override func animationDuration(itemIndex:NSInteger, type:AnimationType)-> NSTimeInterval {

    // durations count equal it itemCount
    let durations = [0.33, 0.26, 0.26] // timing animation for each view
    return durations[itemIndex]
}


#### if don't use storyboard and xib files

Create foregroundView and containerView from code (steps 2 - 3) look example:
[Folding-cell-programmatically](https://github.com/ober01/Folding-cell-programmatically)

## Licence

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.

[![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)
================================================ FILE: docs/docsets/FoldingCell.docset/Contents/Resources/Documents/js/jazzy.js ================================================ window.jazzy = {'docset': false} if (typeof window.dash != 'undefined') { document.documentElement.className += ' dash' window.jazzy.docset = true } if (navigator.userAgent.match(/xcode/i)) { document.documentElement.className += ' xcode' window.jazzy.docset = true } // On doc load, toggle the URL hash discussion if present $(document).ready(function() { if (!window.jazzy.docset) { var linkToHash = $('a[href="' + window.location.hash +'"]'); linkToHash.trigger("click"); } }); // On token click, toggle its discussion and animate token.marginLeft $(".token").click(function(event) { if (window.jazzy.docset) { return; } var link = $(this); var animationDuration = 300; var tokenOffset = "15px"; var original = link.css('marginLeft') == tokenOffset; link.animate({'margin-left':original ? "0px" : tokenOffset}, animationDuration); $content = link.parent().parent().next(); $content.slideToggle(animationDuration); // Keeps the document from jumping to the hash. var href = $(this).attr('href'); if (history.pushState) { history.pushState({}, '', href); } else { location.hash = href; } event.preventDefault(); }); ================================================ FILE: docs/docsets/FoldingCell.docset/Contents/Resources/Documents/undocumented.txt ================================================ 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?) required public init?(coder aDecoder: NSCoder) override public func awakeFromNib() public func isAnimating()->Bool public func animationDuration(itemIndex:NSInteger, type:AnimationType)-> NSTimeInterval public class RotatedView: UIView public class RotatedView : UIView ================================================ FILE: docs/index.html ================================================ FoldingCell Reference

FoldingCell Docs (42% documented)

header

FoldingCell

CocoaPods CocoaPods CocoaPods Carthage compatible Twitter Travis codebeat badge Carthage compatible

shot on dribbble: Animation

The iPhone mockup available here.

Requirements

  • iOS 8.0+
  • Xcode 7.3

Installation

Just add the FoldingCell.swift file to your project.

or use CocoaPods with Podfile: ruby pod 'FoldingCell', '~> 0.8.1'

or Carthage users can simply add Mantle to their Cartfile: github "Ramotion/folding-cell"

Solution

Solution

Usage

1) Create a new cell inheriting from FoldingCell

2) Add a UIView to your cell in your storyboard or nib file, inheriting from RotatedView. Connect the outlet from this view to the cell property foregroundView. Add constraints from this view to the superview, as in this picture:

1.1

(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:

1.2

(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:

1.3

Demonstration adding constraints for foregroundView, containerView

4) Set @IBInspectable var itemCount: NSInteger property is a count of folding (it IBInspectable you can set in storyboard). range 2 or greater. Default value is 2

Ok, we’ve finished configuring the cell.

5) Adding code to your UITableViewController

5.1) Add constants: swift let kCloseCellHeight: CGFloat = *** // equal or greater foregroundView height let kOpenCellHeight: CGFloat = *** // equal or greater containerView height 5.2) Add property

     var cellHeights = [CGFloat]()
 create in viewDidLoad:
     override func viewDidLoad() {
        super.viewDidLoad()

        for _ in 0...kRowsCount {
            cellHeights.append(kCloseCellHeight)
        }
    }

5.3) Override method: swift override func tableView(tableView: UITableView, heightForRowAtIndexPath indexPath: NSIndexPath) -> CGFloat { return cellHeights[indexPath.row] }

5.4) Added code to method: “` swift override func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) { let cell = tableView.cellForRowAtIndexPath(indexPath) as! FoldingCell

    var duration = 0.0
    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
        cell.selectedAnimation(false, animated: true, completion: nil)
        duration = 1.1
    }

    UIView.animateWithDuration(duration, delay: 0, options: .CurveEaseOut, animations: { () -> Void in
        tableView.beginUpdates()
        tableView.endUpdates()
    }, completion: nil)
}
5.5) Control if the cell is open or closed
``` swift
  override func tableView(tableView: UITableView, willDisplayCell cell: UITableViewCell, forRowAtIndexPath indexPath: NSIndexPath) {

        if cell is FoldingCell {
            let foldingCell = cell as! FoldingCell

            if cellHeights![indexPath.row] == kCloseCellHeight {
                foldingCell.selectedAnimation(false, animated: false, completion:nil)
            } else {
                foldingCell.selectedAnimation(true, animated: false, completion: nil)
            }
        }
    }

6) Add this code to your new cell class ”` swift override func animationDuration(itemIndex:NSInteger, type:AnimationType)-> NSTimeInterval {

    // durations count equal it itemCount
    let durations = [0.33, 0.26, 0.26] // timing animation for each view
    return durations[itemIndex]
}


#### if don't use storyboard and xib files

Create foregroundView and containerView from code (steps 2 - 3) look example:
[Folding-cell-programmatically](https://github.com/ober01/Folding-cell-programmatically)

## Licence

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.

[![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)
================================================ FILE: docs/js/jazzy.js ================================================ window.jazzy = {'docset': false} if (typeof window.dash != 'undefined') { document.documentElement.className += ' dash' window.jazzy.docset = true } if (navigator.userAgent.match(/xcode/i)) { document.documentElement.className += ' xcode' window.jazzy.docset = true } // On doc load, toggle the URL hash discussion if present $(document).ready(function() { if (!window.jazzy.docset) { var linkToHash = $('a[href="' + window.location.hash +'"]'); linkToHash.trigger("click"); } }); // On token click, toggle its discussion and animate token.marginLeft $(".token").click(function(event) { if (window.jazzy.docset) { return; } var link = $(this); var animationDuration = 300; var tokenOffset = "15px"; var original = link.css('marginLeft') == tokenOffset; link.animate({'margin-left':original ? "0px" : tokenOffset}, animationDuration); $content = link.parent().parent().next(); $content.slideToggle(animationDuration); // Keeps the document from jumping to the hash. var href = $(this).attr('href'); if (history.pushState) { history.pushState({}, '', href); } else { location.hash = href; } event.preventDefault(); }); ================================================ FILE: docs/undocumented.txt ================================================ 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?) required public init?(coder aDecoder: NSCoder) override public func awakeFromNib() public func isAnimating()->Bool public func animationDuration(itemIndex:NSInteger, type:AnimationType)-> NSTimeInterval public class RotatedView: UIView public class RotatedView : UIView