<commit_before>//
//  Collapsable.swift
//  Core
//
//  Created by <NAME> on 7/6/16.
//  Copyright © 2016 Wolox. All rights reserved.
//

import Foundation

/**
 Represents a collapsable element.
 */
public protocol Collapsable {
    
    /**
     Collapse self.
     
     - Parameter animated: Indicates if the collapse should be animated.
     - Parameter animationDuration: The animationDuration of the collapse.
     */
    func collapse(animated: Bool, animationDuration: NSTimeInterval)
    
    /**
     uncollapse self.
     
     - Parameter animated: Indicates if the collapse should be animated.
     - Parameter animationDuration: The animationDuration of the collapse.
     */
    func uncollapse(animated: Bool, animationDuration: NSTimeInterval)
    
}

/**
 Represents a vertical collapsable view, which when collapsed not only isn't shown but isn't considered in vertical layout.
 */
extension Collapsable where Self: UIView {
    
    /**
     Collapse a view by adding/modifying constraint height. It works also if they view already has a constraint.
     
     - Warning: It is intended to be used to collapse a view *without* subviews.
     
     - Parameter view: The view to collapse<commit_msg>Capitalizing first letter of uncollapse documentation<commit_after>//
//  Collapsable.swift
//  Core
//
//  Created by <NAME> on 7/6/16.
//  Copyright © 2016 Wolox. All rights reserved.
//

import Foundation

/**
 Represents a collapsable element.
 */
public protocol Collapsable {
    
    /**
     Collapse self.
     
     - Parameter animated: Indicates if the collapse should be animated.
     - Parameter animationDuration: The animationDuration of the collapse.
     */
    func collapse(animated: Bool, animationDuration: NSTimeInterval)
    
    /**
     Uncollapse self.
     
     - Parameter animated: Indicates if the collapse should be animated.
     - Parameter animationDuration: The animationDuration of the collapse.
     */
    func uncollapse(animated: Bool, animationDuration: NSTimeInterval)
    
}

/**
 Represents a vertical collapsable view, which when collapsed not only isn't shown but isn't considered in vertical layout.
 */
extension Collapsable where Self: UIView {
    
    /**
     Collapse a view by adding/modifying constraint height. It works also if they view already has a constraint.
     
     - Warning: It is intended to be used to collapse a view *without* subviews.
     
     - Parameter view: The view to collapse
{'fraction_non_alphanumeric': 0.07425343018563357, 'fraction_numerical': 0.00645682001614205, 'mean_word_length': 2.733433734939759, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6531963', 'n_tokens_mistral': 669, 'n_tokens_neox': 640, 'n_words': 262}