Commit ef355c28 by Daniel Dahan

fixing conflicted files

parent 6b0bd134
......@@ -45,7 +45,7 @@ extension UIViewController {
This is the recommended method of accessing the ChipBarController
through child UIViewControllers.
*/
public var chipsController: ChipBarController? {
public var chipBarController: ChipBarController? {
return traverseViewControllerHierarchyForClassType()
}
}
......@@ -61,25 +61,25 @@ open class ChipBarController: TransitionController {
layoutSubviews()
}
}
/// The ChipBar used to switch between view controllers.
@IBInspectable
open let chipBar = ChipBar()
/// The chipBar alignment.
open var chipBarAlignment = ChipBarAlignment.bottom {
didSet {
layoutSubviews()
}
}
open override func layoutSubviews() {
super.layoutSubviews()
layoutChipBar()
layoutContainer()
layoutRootViewController()
}
open override func prepare() {
super.prepare()
prepareChipBar()
......@@ -98,12 +98,12 @@ fileprivate extension ChipBarController {
/// Layout the container.
func layoutContainer() {
chipBar.frame.size.width = view.bounds.width
switch displayStyle {
case .partial:
let p = chipBar.bounds.height
let y = view.bounds.height - p
switch chipBarAlignment {
case .top:
container.frame.origin.y = p
......@@ -115,18 +115,18 @@ fileprivate extension ChipBarController {
container.frame.origin.y = 0
container.frame.size.height = view.bounds.height
}
container.frame.size.width = view.bounds.width
case .full:
container.frame = view.bounds
}
}
/// Layout the chipBar.
func layoutChipBar() {
chipBar.frame.size.width = view.bounds.width
switch chipBarAlignment {
case .top:
chipBar.isHidden = false
......@@ -138,7 +138,7 @@ fileprivate extension ChipBarController {
chipBar.isHidden = true
}
}
/// Layout the rootViewController.
func layoutRootViewController() {
rootViewController.view.frame = container.bounds
......
......@@ -114,13 +114,17 @@ open class CollectionView: UICollectionView {
- Parameter frame: A CGRect defining the view's frame.
*/
public init(frame: CGRect) {
super.init(frame: frame, collectionViewLayout: CollectionViewLayout())
let layout = UICollectionViewFlowLayout()
layout.itemSize = CGSize(width: 100, height: 100)
super.init(frame: frame, collectionViewLayout: layout)
prepare()
}
/// A convenience initializer that initializes the object.
public init() {
super.init(frame: .zero, collectionViewLayout: CollectionViewLayout())
let layout = UICollectionViewFlowLayout()
layout.itemSize = CGSize(width: 100, height: 100)
super.init(frame: .zero, collectionViewLayout: layout)
prepare()
}
......
......@@ -39,7 +39,7 @@ open class Layer: CAShapeLayer {
the image to a desired shape within the visualLayer.
*/
open let visualLayer = CAShapeLayer()
/**
A property that manages an image for the visualLayer's contents
property. Images should not be set to the backing layer's contents
......@@ -51,7 +51,7 @@ open class Layer: CAShapeLayer {
visualLayer.contents = image?.cgImage
}
}
/**
Allows a relative subrectangle within the range of 0 to 1 to be
specified for the visualLayer's contents property. This allows
......@@ -63,7 +63,7 @@ open class Layer: CAShapeLayer {
visualLayer.contentsRect = contentsRect
}
}
/**
A CGRect that defines a stretchable region inside the visualLayer
with a fixed border around the edge.
......@@ -73,7 +73,7 @@ open class Layer: CAShapeLayer {
visualLayer.contentsCenter = contentsCenter
}
}
/**
A floating point value that defines a ratio between the pixel
dimensions of the visualLayer's contents property and the size
......@@ -85,14 +85,14 @@ open class Layer: CAShapeLayer {
visualLayer.contentsScale = contentsScale
}
}
/// A Preset for the contentsGravity property.
open var contentsGravityPreset: Gravity {
didSet {
contentsGravity = GravityToValue(gravity: contentsGravityPreset)
}
}
/// Determines how content should be aligned within the visualLayer's bounds.
@IBInspectable
open override var contentsGravity: String {
......@@ -103,7 +103,7 @@ open class Layer: CAShapeLayer {
visualLayer.contentsGravity = value
}
}
/**
A property that sets the cornerRadius of the backing layer. If the shape
property has a value of .circle when the cornerRadius is set, it will
......@@ -116,7 +116,7 @@ open class Layer: CAShapeLayer {
shapePreset = .none
}
}
/**
An initializer that initializes the object with a NSCoder object.
- Parameter aDecoder: A NSCoder instance.
......@@ -126,7 +126,7 @@ open class Layer: CAShapeLayer {
super.init(coder: aDecoder)
prepareVisualLayer()
}
/**
An initializer the same as init(). The layer parameter is ignored
to avoid crashes on certain architectures.
......@@ -137,14 +137,14 @@ open class Layer: CAShapeLayer {
super.init(layer: layer)
prepareVisualLayer()
}
/// A convenience initializer.
public override init() {
contentsGravityPreset = .resizeAspectFill
super.init()
prepareVisualLayer()
}
/**
An initializer that initializes the object with a CGRect object.
- Parameter frame: A CGRect instance.
......@@ -153,23 +153,25 @@ open class Layer: CAShapeLayer {
self.init()
self.frame = frame
}
open override func layoutSublayers() {
super.layoutSublayers()
layoutShape()
layoutVisualLayer()
layoutShadowPath()
}
}
fileprivate extension Layer {
/// Prepares the visualLayer property.
open func prepareVisualLayer() {
func prepareVisualLayer() {
visualLayer.zPosition = 0
visualLayer.masksToBounds = true
addSublayer(visualLayer)
}
/// Manages the layout for the visualLayer property.
internal func layoutVisualLayer() {
func layoutVisualLayer() {
visualLayer.frame = bounds
visualLayer.cornerRadius = cornerRadius
}
......
......@@ -33,10 +33,34 @@ import UIKit
fileprivate var ToolbarContext: UInt8 = 0
open class Toolbar: Bar {
/// A convenience property to set the titleLabel.text.
@IBInspectable
open var title: String? {
get {
return titleLabel.text
}
set(value) {
titleLabel.text = value
layoutSubviews()
}
}
/// Title label.
@IBInspectable
open let titleLabel = UILabel()
/// A convenience property to set the detailLabel.text.
@IBInspectable
open var detail: String? {
get {
return detailLabel.text
}
set(value) {
detailLabel.text = value
layoutSubviews()
}
}
/// Detail label.
@IBInspectable
open let detailLabel = UILabel()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment