Commit be05fff0 by Daniel Dahan

development: removed public extension declarations, not needed.

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