<commit_before>//
//  LayoutManager.swift
//  LayoutManager
//
//  Created by <NAME> on 6/2/16.
//  Copyright © 2016 <NAME>. All rights reserved.
//

#if os(iOS)
    import UIKit
    typealias View = UIView
#else
    import Cocoa
    typealias View = NSView
#endif

extension View: Frameable {
    public var superFrame: CGRect {
        guard let superview = superview else {
            return CGRectZero
        }
        
        return superview.frame
    }
    
    public func setDimensionAutomatically() {
        #if os(iOS)
            self.sizeToFit()
        #else
            self.autoresizesSubviews = true
            self.autoresizingMask = [.ViewWidthSizable, .ViewHeightSizable]
        #endif
    }
}

extension CALayer {
    public var superFrame: CGRect {
        guard let superlayer = superlayer else {
            return CGRectZero
        }
        
        return superlayer.frame
    }<commit_msg>Connect the protocols with the View and Layer extensions.<commit_after>//
//  LayoutManager.swift
//  LayoutManager
//
//  Created by <NAME> on 6/2/16.
//  Copyright © 2016 <NAME>. All rights reserved.
//

#if os(iOS)
    import UIKit
    typealias View = UIView
#else
    import Cocoa
    typealias View = NSView
#endif

extension View: Frameable, Anchorable, Alignable, Groupable {
    public var superFrame: CGRect {
        guard let superview = superview else {
            return CGRectZero
        }
        
        return superview.frame
    }
    
    public func setDimensionAutomatically() {
        #if os(iOS)
            self.sizeToFit()
        #else
            self.autoresizesSubviews = true
            self.autoresizingMask = [.ViewWidthSizable, .ViewHeightSizable]
        #endif
    }
}

extension CALayer: Frameable, Anchorable, Alignable, Groupable {
    public var superFrame: CGRect {
        guard let superlayer = superlayer else {
            return CGRectZero
        }
        
        return superlayer.frame
    }
{'fraction_non_alphanumeric': 0.0791476407914764, 'fraction_numerical': 0.008117706747843734, 'mean_word_length': 1.9476831091180866, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '1973238', 'n_tokens_mistral': 598, 'n_tokens_neox': 564, 'n_words': 161}