Commit be05fff0 by Daniel Dahan

development: removed public extension declarations, not needed.

parent 19fad6e1
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
import UIKit import UIKit
public extension Animation { extension Animation {
/** /**
:name: backgroundColor :name: backgroundColor
*/ */
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
import UIKit import UIKit
public extension UITabBarItem { extension UITabBarItem {
/// Sets the color of the title color for a state. /// Sets the color of the title color for a state.
public func setTitleColor(color: UIColor, forState state: UIControlState) { public func setTitleColor(color: UIColor, forState state: UIControlState) {
setTitleTextAttributes([NSForegroundColorAttributeName: color], for: state) setTitleTextAttributes([NSForegroundColorAttributeName: color], for: state)
...@@ -146,7 +146,7 @@ public class MaterialAssociatedObjectTabBar { ...@@ -146,7 +146,7 @@ public class MaterialAssociatedObjectTabBar {
} }
} }
public extension UITabBar { extension UITabBar {
/// TabBarItem reference. /// TabBarItem reference.
public internal(set) var item: MaterialAssociatedObjectTabBar { public internal(set) var item: MaterialAssociatedObjectTabBar {
get { get {
......
...@@ -47,13 +47,13 @@ public class Button: UIButton { ...@@ -47,13 +47,13 @@ public class Button: UIButton {
public weak var delegate: MaterialDelegate? public weak var delegate: MaterialDelegate?
/// An Array of pulse layers. /// An Array of pulse layers.
public private(set) lazy var pulseLayers: Array<CAShapeLayer> = Array<CAShapeLayer>() public private(set) lazy var pulseLayers = Array<CAShapeLayer>()
/// The opacity value for the pulse animation. /// The opacity value for the pulse animation.
@IBInspectable public var pulseOpacity: CGFloat = 0.25 @IBInspectable public var pulseOpacity: CGFloat = 0.25
/// The color of the pulse effect. /// The color of the pulse effect.
@IBInspectable public var pulseColor: UIColor = Color.grey.base @IBInspectable public var pulseColor = Color.grey.base
/// The type of PulseAnimation. /// The type of PulseAnimation.
public var pulseAnimation: PulseAnimation = .pointWithBacking public var pulseAnimation: PulseAnimation = .pointWithBacking
...@@ -68,16 +68,7 @@ public class Button: UIButton { ...@@ -68,16 +68,7 @@ public class Button: UIButton {
/// A preset property for updated contentEdgeInsets. /// A preset property for updated contentEdgeInsets.
public var contentEdgeInsetsPreset: EdgeInsetsPreset = .none { public var contentEdgeInsetsPreset: EdgeInsetsPreset = .none {
didSet { didSet {
contentInset = EdgeInsetsPresetToValue(preset: contentEdgeInsetsPreset) contentEdgeInsets = EdgeInsetsPresetToValue(preset: contentEdgeInsetsPreset)
}
}
/**
:name: contentInset
*/
@IBInspectable public var contentInset = EdgeInsets.zero {
didSet {
contentEdgeInsets = contentInset
} }
} }
......
...@@ -109,7 +109,7 @@ public func DepthPresetToValue(preset: DepthPreset) -> Depth { ...@@ -109,7 +109,7 @@ public func DepthPresetToValue(preset: DepthPreset) -> Depth {
} }
/// Grid extension for UIView. /// Grid extension for UIView.
public extension UIView { extension UIView {
/// A preset value for Depth. /// A preset value for Depth.
public var depthPreset: DepthPreset { public var depthPreset: DepthPreset {
get { get {
......
...@@ -201,9 +201,9 @@ public class Grid { ...@@ -201,9 +201,9 @@ public class Grid {
var n: Int = 0 var n: Int = 0
for i in 0..<v.count { for i in 0..<v.count {
let child: UIView = v[i] let child = v[i]
if let parent: UIView = context { if let parent = context {
if parent != child.superview { if parent != child.superview {
child.removeFromSuperview() child.removeFromSuperview()
parent.addSubview(child) parent.addSubview(child)
...@@ -213,17 +213,15 @@ public class Grid { ...@@ -213,17 +213,15 @@ public class Grid {
switch axis.direction { switch axis.direction {
case .horizontal: case .horizontal:
let w = (parent.bounds.width - contentInset.left - contentInset.right - layoutInset.left - layoutInset.right + interimSpace) / CGFloat(gc)
let c = child.grid.columns let c = child.grid.columns
let co = child.grid.offset.columns let co = child.grid.offset.columns
let vh = parent.bounds.height - contentInset.top - contentInset.bottom - layoutInset.top - layoutInset.bottom
let vl = CGFloat(i + n + co) * w + contentInset.left + layoutInset.left
let vw = w * CGFloat(c) - interimSpace
child.x = vl let w = (parent.bounds.width - contentInset.left - contentInset.right - layoutInset.left - layoutInset.right + interimSpace) / CGFloat(gc)
child.x = CGFloat(i + n + co) * w + contentInset.left + layoutInset.left
child.y = contentInset.top + layoutInset.top child.y = contentInset.top + layoutInset.top
child.width = vw child.width = w * CGFloat(c) - interimSpace
child.height = vh child.height = parent.bounds.height - contentInset.top - contentInset.bottom - layoutInset.top - layoutInset.bottom
n += c + co - 1 n += c + co - 1
...@@ -243,21 +241,24 @@ public class Grid { ...@@ -243,21 +241,24 @@ public class Grid {
n += r + ro - 1 n += r + ro - 1
case .none: case .none:
let w = (parent.bounds.width - contentInset.left - contentInset.right - layoutInset.left - layoutInset.right + interimSpace) / CGFloat(gc)
let c = child.grid.columns let c = child.grid.columns
let co = child.grid.offset.columns let co = child.grid.offset.columns
let h = (parent.bounds.height - contentInset.top - contentInset.bottom - layoutInset.top - layoutInset.bottom + interimSpace) / CGFloat(gr)
var w = (parent.bounds.width - contentInset.left - contentInset.right - layoutInset.left - layoutInset.right + interimSpace) / CGFloat(gc)
var h = (parent.bounds.height - contentInset.top - contentInset.bottom - layoutInset.top - layoutInset.bottom + interimSpace) / CGFloat(gr)
let r = child.grid.rows let r = child.grid.rows
let ro = child.grid.offset.rows let ro = child.grid.offset.rows
let vt = CGFloat(ro) * h + contentInset.top + layoutInset.top let x = CGFloat(co) * w + contentInset.left + layoutInset.left
let vl = CGFloat(co) * w + contentInset.left + layoutInset.left let y = CGFloat(ro) * h + contentInset.top + layoutInset.top
let vh = h * CGFloat(r) - interimSpace
let vw = w * CGFloat(c) - interimSpace
child.x = vl w = w * CGFloat(c) - interimSpace
child.y = vt h = h * CGFloat(r) - interimSpace
child.width = vw
child.height = vh child.x = x
child.y = y
child.width = w
child.height = h
} }
} }
} }
...@@ -269,7 +270,7 @@ public class Grid { ...@@ -269,7 +270,7 @@ public class Grid {
private var GridKey: UInt8 = 0 private var GridKey: UInt8 = 0
/// Grid extension for UIView. /// Grid extension for UIView.
public extension UIView { extension UIView {
/// Grid reference. /// Grid reference.
public private(set) var grid: Grid { public private(set) var grid: Grid {
get { get {
......
...@@ -42,5 +42,7 @@ public class IconButton: Button { ...@@ -42,5 +42,7 @@ public class IconButton: Button {
super.prepareView() super.prepareView()
cornerRadiusPreset = .cornerRadius1 cornerRadiusPreset = .cornerRadius1
pulseAnimation = .center pulseAnimation = .center
shapePreset = .circle
contentEdgeInsetsPreset = .none
} }
} }
...@@ -51,7 +51,7 @@ public func AnimationRotationModeToValue(mode: AnimationRotationMode) -> String? ...@@ -51,7 +51,7 @@ public func AnimationRotationModeToValue(mode: AnimationRotationMode) -> String?
} }
} }
public extension Animation { extension Animation {
/** /**
:name: path :name: path
*/ */
......
...@@ -593,7 +593,7 @@ public class Layout { ...@@ -593,7 +593,7 @@ public class Layout {
} }
/// Layout /// Layout
public extension Layout { extension Layout {
/** /**
Sets the width of a view. Sets the width of a view.
- Parameter parent: A parent UIView context. - Parameter parent: A parent UIView context.
...@@ -900,7 +900,7 @@ public extension Layout { ...@@ -900,7 +900,7 @@ public extension Layout {
private var LayoutKey: UInt8 = 0 private var LayoutKey: UInt8 = 0
/// Layout extension for UIView. /// Layout extension for UIView.
public extension UIView { extension UIView {
/// Layout reference. /// Layout reference.
public private(set) var layout: Layout { public private(set) var layout: Layout {
get { get {
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
public extension Array where Element: Equatable { extension Array where Element: Equatable {
/** /**
Slices a out a segment of an array based on the start Slices a out a segment of an array based on the start
and end positions. and end positions.
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
import UIKit import UIKit
public extension String { extension String {
/** /**
:name: lines :name: lines
*/ */
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
import UIKit import UIKit
public extension UIFont { extension UIFont {
/** /**
:name: stringSize :name: stringSize
*/ */
......
...@@ -69,22 +69,7 @@ public class Material { ...@@ -69,22 +69,7 @@ public class Material {
} }
/// A preset property to set the shape. /// A preset property to set the shape.
public var shapePreset: ShapePreset = .none { public var shapePreset: ShapePreset = .none
didSet {
guard let v = view else {
return
}
if .none != shapePreset {
if v.width < v.height {
v.frame.size.width = v.height
} else {
v.frame.size.height = v.width
}
v.layoutShadowPath()
}
}
}
/// A preset value for Depth. /// A preset value for Depth.
public var depthPreset: DepthPreset { public var depthPreset: DepthPreset {
...@@ -111,7 +96,7 @@ public class Material { ...@@ -111,7 +96,7 @@ public class Material {
} }
/// Enables automatic shadowPath sizing. /// Enables automatic shadowPath sizing.
public var isShadowPathAutoSizing: Bool = true { public var isShadowPathAutoSizing: Bool = false {
didSet { didSet {
if isShadowPathAutoSizing { if isShadowPathAutoSizing {
view?.layoutShadowPath() view?.layoutShadowPath()
...@@ -124,7 +109,7 @@ public class Material { ...@@ -124,7 +109,7 @@ public class Material {
private var MaterialKey: UInt8 = 0 private var MaterialKey: UInt8 = 0
/// Grid extension for UIView. /// Grid extension for UIView.
public extension UIView { extension UIView {
/// Material Reference. /// Material Reference.
internal var material: Material { internal var material: Material {
get { get {
...@@ -145,6 +130,8 @@ public extension UIView { ...@@ -145,6 +130,8 @@ public extension UIView {
} }
set(value) { set(value) {
layer.frame.origin.x = value layer.frame.origin.x = value
layoutShadowPath()
} }
} }
...@@ -156,6 +143,8 @@ public extension UIView { ...@@ -156,6 +143,8 @@ public extension UIView {
} }
set(value) { set(value) {
layer.frame.origin.y = value layer.frame.origin.y = value
layoutShadowPath()
} }
} }
...@@ -167,9 +156,9 @@ public extension UIView { ...@@ -167,9 +156,9 @@ public extension UIView {
} }
set(value) { set(value) {
layer.frame.size.width = value layer.frame.size.width = value
if .none != shapePreset {
layer.frame.size.height = value layoutShape()
} layoutShadowPath()
} }
} }
...@@ -181,9 +170,9 @@ public extension UIView { ...@@ -181,9 +170,9 @@ public extension UIView {
} }
set(value) { set(value) {
layer.frame.size.height = value layer.frame.size.height = value
if .none != shapePreset {
layer.frame.size.width = value layoutShape()
} layoutShadowPath()
} }
} }
...@@ -198,6 +187,7 @@ public extension UIView { ...@@ -198,6 +187,7 @@ public extension UIView {
} }
set(value) { set(value) {
material.shapePreset = value material.shapePreset = value
layoutShape() layoutShape()
layoutShadowPath() layoutShadowPath()
} }
...@@ -291,9 +281,11 @@ public extension UIView { ...@@ -291,9 +281,11 @@ public extension UIView {
} }
set(value) { set(value) {
layer.cornerRadius = value layer.cornerRadius = value
layoutShadowPath()
if .circle == shapePreset { if .circle == shapePreset {
shapePreset = .none shapePreset = .none
} else {
layoutShadowPath()
} }
} }
} }
...@@ -400,16 +392,16 @@ public extension UIView { ...@@ -400,16 +392,16 @@ public extension UIView {
/// Manages the layout for the shape of the view instance. /// Manages the layout for the shape of the view instance.
public func layoutShape() { public func layoutShape() {
if .circle == shapePreset { if .none != shapePreset {
if width < height { if width < height {
width = height layer.frame.size.width = height
} else { } else if width > height {
height = width layer.frame.size.height = width
} }
let r = width / 2
if r != cornerRadius {
cornerRadius = r
} }
if .circle == shapePreset {
layer.cornerRadius = width / 2
} }
} }
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
import UIKit import UIKit
public extension UIWindow { extension UIWindow {
/** /**
Captures a screenshot of the contents in the apps keyWindow. Captures a screenshot of the contents in the apps keyWindow.
- Returns: An optional UIImage. - Returns: An optional UIImage.
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
import UIKit import UIKit
public extension UIViewController { extension UIViewController {
/** /**
A convenience property that provides access to the MenuController. A convenience property that provides access to the MenuController.
This is the recommended method of accessing the MenuController This is the recommended method of accessing the MenuController
......
...@@ -38,7 +38,7 @@ public enum NavigationBarStyle: Int { ...@@ -38,7 +38,7 @@ public enum NavigationBarStyle: Int {
case Medium case Medium
} }
public extension UINavigationBar { extension UINavigationBar {
/// Device status bar style. /// Device status bar style.
public var statusBarStyle: UIStatusBarStyle { public var statusBarStyle: UIStatusBarStyle {
get { get {
......
...@@ -36,7 +36,7 @@ public enum NavigationDrawerPosition: Int { ...@@ -36,7 +36,7 @@ public enum NavigationDrawerPosition: Int {
case right case right
} }
public extension UIViewController { extension UIViewController {
/** /**
A convenience property that provides access to the NavigationDrawerController. A convenience property that provides access to the NavigationDrawerController.
This is the recommended method of accessing the NavigationDrawerController This is the recommended method of accessing the NavigationDrawerController
......
...@@ -87,7 +87,7 @@ public class MaterialAssociatedObjectNavigationItem { ...@@ -87,7 +87,7 @@ public class MaterialAssociatedObjectNavigationItem {
} }
} }
public extension UINavigationItem { extension UINavigationItem {
/// NavigationItem reference. /// NavigationItem reference.
public internal(set) var item: MaterialAssociatedObjectNavigationItem { public internal(set) var item: MaterialAssociatedObjectNavigationItem {
get { get {
......
...@@ -32,14 +32,14 @@ import UIKit ...@@ -32,14 +32,14 @@ import UIKit
public typealias Offset = UIOffset public typealias Offset = UIOffset
public extension CGSize { extension CGSize {
/// Returns an Offset version of the CGSize. /// Returns an Offset version of the CGSize.
public var asOffset: Offset { public var asOffset: Offset {
return Offset(size: self) return Offset(size: self)
} }
} }
public extension Offset { extension Offset {
/** /**
Initializer that accepts a CGSize value. Initializer that accepts a CGSize value.
- Parameter size: A CGSize value. - Parameter size: A CGSize value.
...@@ -49,7 +49,7 @@ public extension Offset { ...@@ -49,7 +49,7 @@ public extension Offset {
} }
} }
public extension Offset { extension Offset {
/// Returns a CGSize version of the Offset. /// Returns a CGSize version of the Offset.
public var asSize: CGSize { public var asSize: CGSize {
return CGSize(width: horizontal, height: vertical) return CGSize(width: horizontal, height: vertical)
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
import UIKit import UIKit
public extension UIViewController { extension UIViewController {
/** /**
A convenience property that provides access to the SearchBarController. A convenience property that provides access to the SearchBarController.
This is the recommended method of accessing the SearchBarController This is the recommended method of accessing the SearchBarController
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
import UIKit import UIKit
public extension UIViewController { extension UIViewController {
/** /**
A convenience property that provides access to the StatusBarController. A convenience property that provides access to the StatusBarController.
This is the recommended method of accessing the StatusBarController This is the recommended method of accessing the StatusBarController
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
import UIKit import UIKit
public extension UIViewController { extension UIViewController {
/** /**
A convenience property that provides access to the ToolbarController. A convenience property that provides access to the ToolbarController.
This is the recommended method of accessing the ToolbarController This is the recommended method of accessing the ToolbarController
......
...@@ -81,7 +81,7 @@ public func AnimationTransitionSubTypeToValue(direction: AnimationTransitionSubT ...@@ -81,7 +81,7 @@ public func AnimationTransitionSubTypeToValue(direction: AnimationTransitionSubT
} }
} }
public extension Animation { extension Animation {
/** /**
:name: transition :name: transition
*/ */
......
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