//
//  ActionsList
//  Copyright © 2017 Yegor Miroshnichenko. Licensed under the MIT license.
//

import UIKit

extension UIView {
    
    /// Constraints edges to `superview`'s edges
    func constraintToSuperview() {
        guard let superView = superview
            else {
                return
        }
        translatesAutoresizingMaskIntoConstraints = false
        topAnchor
            .constraint(equalTo: superView.topAnchor)
            .isActive = true
        bottomAnchor
            .constraint(equalTo: superView.bottomAnchor)
            .isActive = true
        leadingAnchor
            .constraint(equalTo: superView.leadingAnchor)
            .isActive = true
        trailingAnchor
            .constraint(equalTo: superView.trailingAnchor)
            .isActive = true
    }
}
