Skip to content

Commit

Permalink
Fixed Xcode 10.2 warnings. Converted to Swift 5
Browse files Browse the repository at this point in the history
  • Loading branch information
onurgenes committed Mar 26, 2019
1 parent 9d1f305 commit 8412331
Show file tree
Hide file tree
Showing 18 changed files with 114 additions and 115 deletions.
24 changes: 12 additions & 12 deletions Source/Stevia+Alignment.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public func align(horizontally views: UIView...) -> [UIView] {
return align(horizontally: views)
}

@available(*, deprecated: 4.1.0, renamed: "align(horizontally:)")
@available(*, deprecated, renamed: "align(horizontally:)")
@discardableResult
public func alignHorizontally(_ views: UIView...) -> [UIView] {
return align(horizontally: views)
Expand All @@ -55,7 +55,7 @@ public func align(horizontally views: [UIView]) -> [UIView] {
return views
}

@available(*, deprecated: 4.1.0, renamed: "align(horizontally:)")
@available(*, deprecated, renamed: "align(horizontally:)")
@discardableResult
public func alignHorizontally(_ views: [UIView]) -> [UIView] {
align(.horizontal, views: views)
Expand All @@ -76,7 +76,7 @@ public func align(vertically views: UIView...) {
align(vertically: views)
}

@available(*, deprecated: 4.1.0, renamed: "align(vertically:)")
@available(*, deprecated, renamed: "align(vertically:)")
public func alignVertically(_ views: UIView...) {
align(vertically: views)
}
Expand All @@ -95,7 +95,7 @@ public func align(vertically views: [UIView]) {
align(.vertical, views: views)
}

@available(*, deprecated: 4.1.0, renamed: "align(vertically:)")
@available(*, deprecated, renamed: "align(vertically:)")
public func alignVertically(_ views: [UIView]) {
align(.vertical, views: views)
}
Expand Down Expand Up @@ -177,7 +177,7 @@ public func align(tops views: UIView...) -> [UIView] {
return align(tops: views)
}

@available(*, deprecated: 4.1.0, renamed: "align(tops:)")
@available(*, deprecated, renamed: "align(tops:)")
@discardableResult
public func alignTops(_ views: UIView...) -> [UIView] {
return align(tops: views)
Expand All @@ -204,7 +204,7 @@ public func align(tops views: [UIView]) -> [UIView] {
return views
}

@available(*, deprecated: 4.1.0, renamed: "align(tops:)")
@available(*, deprecated, renamed: "align(tops:)")
@discardableResult
public func alignTops(_ views: [UIView]) -> [UIView] {
align(.top, views: views)
Expand All @@ -231,7 +231,7 @@ public func align(bottoms views: UIView...) -> [UIView] {
return align(bottoms: views)
}

@available(*, deprecated: 4.1.0, renamed: "align(bottoms:)")
@available(*, deprecated, renamed: "align(bottoms:)")
@discardableResult
public func alignBottoms(_ views: UIView...) -> [UIView] {
return align(bottoms: views)
Expand All @@ -258,7 +258,7 @@ public func align(bottoms views: [UIView]) -> [UIView] {
return views
}

@available(*, deprecated: 4.1.0, renamed: "align(bottoms:)")
@available(*, deprecated, renamed: "align(bottoms:)")
@discardableResult
public func alignBottoms(_ views: [UIView]) -> [UIView] {
align(.bottom, views: views)
Expand All @@ -280,7 +280,7 @@ public func align(lefts views: UIView...) -> [UIView] {
return align(lefts: views)
}

@available(*, deprecated: 4.1.0, renamed: "align(lefts:)")
@available(*, deprecated, renamed: "align(lefts:)")
@discardableResult
public func alignLefts(_ views: UIView...) -> [UIView] {
return align(lefts: views)
Expand All @@ -302,7 +302,7 @@ public func align(lefts views: [UIView]) -> [UIView] {
return views
}

@available(*, deprecated: 4.1.0, renamed: "align(lefts:)")
@available(*, deprecated, renamed: "align(lefts:)")
@discardableResult
public func alignLefts(_ views: [UIView]) -> [UIView] {
align(.left, views: views)
Expand All @@ -324,7 +324,7 @@ public func align(rights views: UIView...) -> [UIView] {
return align(rights: views)
}

@available(*, deprecated: 4.1.0, renamed: "align(rights:)")
@available(*, deprecated, renamed: "align(rights:)")
@discardableResult
public func alignRights(_ views: UIView...) -> [UIView] {
return align(rights: views)
Expand All @@ -346,7 +346,7 @@ public func align(rights views: [UIView]) -> [UIView] {
return views
}

@available(*, deprecated: 4.1.0, renamed: "align(rights:)")
@available(*, deprecated, renamed: "align(rights:)")
@discardableResult
public func alignRights(_ views: [UIView]) -> [UIView] {
align(.right, views: views)
Expand Down
10 changes: 5 additions & 5 deletions Source/Stevia+Center.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public extension UIView {
*/
@discardableResult
public func centerInContainer() -> UIView {
func centerInContainer() -> UIView {
if let spv = superview {
alignCenter(self, with: spv)
}
Expand All @@ -39,7 +39,7 @@ public extension UIView {
*/
@discardableResult
public func centerHorizontally() -> UIView {
func centerHorizontally() -> UIView {
if let spv = superview {
align(vertically: self, spv)
}
Expand All @@ -57,7 +57,7 @@ public extension UIView {
*/
@discardableResult
public func centerVertically() -> UIView {
func centerVertically() -> UIView {
if let spv = superview {
align(horizontally: self, spv)
}
Expand All @@ -75,7 +75,7 @@ public extension UIView {
*/
@discardableResult
public func centerHorizontally(_ offset: CGFloat) -> UIView {
func centerHorizontally(_ offset: CGFloat) -> UIView {
if let spv = superview {
alignVertically(self, with: spv, offset: offset)
}
Expand All @@ -93,7 +93,7 @@ public extension UIView {
*/
@discardableResult
public func centerVertically(_ offset: CGFloat) -> UIView {
func centerVertically(_ offset: CGFloat) -> UIView {
if let spv = superview {
alignHorizontally(self, with: spv, offset: offset)
}
Expand Down
10 changes: 5 additions & 5 deletions Source/Stevia+Constraints.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public extension UIView {
- Returns: The NSLayoutConstraint created.
*/
@discardableResult
public func addConstraint(item view1: AnyObject,
func addConstraint(item view1: AnyObject,
attribute attr1: NSLayoutConstraint.Attribute,
relatedBy: NSLayoutConstraint.Relation = .equal,
toItem view2: AnyObject? = nil,
Expand Down Expand Up @@ -68,7 +68,7 @@ public extension UIView {
- Returns: The NSLayoutConstraint created.
*/
public func constraint(item view1: AnyObject,
func constraint(item view1: AnyObject,
attribute attr1: NSLayoutConstraint.Attribute,
relatedBy: NSLayoutConstraint.Relation = .equal,
toItem view2: AnyObject? = nil,
Expand All @@ -95,7 +95,7 @@ public extension UIView {
removeConstraints(userAddedConstraints)
*/
public var userAddedConstraints: [NSLayoutConstraint] {
var userAddedConstraints: [NSLayoutConstraint] {
return constraints.filter { c in
guard let cId = c.identifier else { return true }
return !cId.contains("UIView-Encapsulated-Layout") && !cId.contains("Margin-guide-constraint")
Expand All @@ -115,7 +115,7 @@ public extension UIView {
button.followEdges(image)
```
*/
public func followEdges(_ otherView: UIView) {
func followEdges(_ otherView: UIView) {
if let spv = superview {
let cs = [
constraint(item: self, attribute: .top, toItem: otherView),
Expand All @@ -139,7 +139,7 @@ public extension UIView {
*/
@discardableResult
public func heightEqualsWidth() -> UIView {
func heightEqualsWidth() -> UIView {
if let spv = superview {
let c = constraint(item: self, attribute: .height, toItem: self, attribute: .width)
spv.addConstraint(c)
Expand Down
12 changes: 6 additions & 6 deletions Source/Stevia+Content.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public extension UIButton {
- Returns: Itself for chaining purposes
*/
@discardableResult
public func text(_ t: String) -> Self {
func text(_ t: String) -> Self {
setTitle(t, for: .normal)
return self
}
Expand All @@ -32,7 +32,7 @@ public extension UIButton {
- Returns: Itself for chaining purposes
*/
@discardableResult
public func textKey(_ t: String) -> Self {
func textKey(_ t: String) -> Self {
text(NSLocalizedString(t, comment: ""))
return self
}
Expand All @@ -45,7 +45,7 @@ public extension UIButton {
- Returns: Itself for chaining purposes
*/
@discardableResult
public func image(_ s: String) -> Self {
func image(_ s: String) -> Self {
setImage(UIImage(named: s), for: .normal)
return self
}
Expand All @@ -57,7 +57,7 @@ public extension UITextField {
- Returns: Itself for chaining purposes
*/
@discardableResult
public func placeholder(_ t: String) -> Self {
func placeholder(_ t: String) -> Self {
placeholder = t
return self
}
Expand All @@ -69,7 +69,7 @@ public extension UILabel {
- Returns: Itself for chaining purposes
*/
@discardableResult
public func text(_ t: String) -> Self {
func text(_ t: String) -> Self {
text = t
return self
}
Expand All @@ -80,7 +80,7 @@ public extension UILabel {
- Returns: Itself for chaining purposes
*/
@discardableResult
public func textKey(_ t: String) -> Self {
func textKey(_ t: String) -> Self {
text(NSLocalizedString(t, comment: ""))
return self
}
Expand Down
24 changes: 12 additions & 12 deletions Source/Stevia+Equation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,51 +31,51 @@ public struct SteviaAttribute {

public extension UIView {

public var Width: SteviaAttribute {
var Width: SteviaAttribute {
return SteviaAttribute(view: self, attribute: .width)
}

public var Height: SteviaAttribute {
var Height: SteviaAttribute {
return SteviaAttribute(view: self, attribute: .height)
}

public var Top: SteviaAttribute {
var Top: SteviaAttribute {
return SteviaAttribute(view: self, attribute: .top)
}

public var Bottom: SteviaAttribute {
var Bottom: SteviaAttribute {
return SteviaAttribute(view: self, attribute: .bottom)
}

public var Left: SteviaAttribute {
var Left: SteviaAttribute {
return SteviaAttribute(view: self, attribute: .left)
}

public var Right: SteviaAttribute {
var Right: SteviaAttribute {
return SteviaAttribute(view: self, attribute: .right)
}

public var Leading: SteviaAttribute {
var Leading: SteviaAttribute {
return SteviaAttribute(view: self, attribute: .leading)
}

public var Trailing: SteviaAttribute {
var Trailing: SteviaAttribute {
return SteviaAttribute(view: self, attribute: .trailing)
}

public var CenterX: SteviaAttribute {
var CenterX: SteviaAttribute {
return SteviaAttribute(view: self, attribute: .centerX)
}

public var CenterY: SteviaAttribute {
var CenterY: SteviaAttribute {
return SteviaAttribute(view: self, attribute: .centerY)
}

public var FirstBaseline: SteviaAttribute {
var FirstBaseline: SteviaAttribute {
return SteviaAttribute(view: self, attribute: .firstBaseline)
}

public var LastBaseline: SteviaAttribute {
var LastBaseline: SteviaAttribute {
return SteviaAttribute(view: self, attribute: .lastBaseline)
}
}
Expand Down
14 changes: 7 additions & 7 deletions Source/Stevia+Fill.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,18 @@ public extension UIView {
A padding can be used to apply equal spaces between the view and its superview
*/
@discardableResult
public func fillContainer(_ padding: CGFloat = 0) -> UIView {
func fillContainer(_ padding: CGFloat = 0) -> UIView {
fillHorizontally(m: padding)
fillVertically(m: padding)
return self
}

@available(*, deprecated: 2.2.1, message: "Use 'fillVertically' instead")
@available(*, deprecated, message: "Use 'fillVertically' instead")
/**
Adds the constraints needed for the view to fill its `superview` Vertically.
A padding can be used to apply equal spaces between the view and its superview
*/
public func fillV(m points: CGFloat = 0) -> UIView {
func fillV(m points: CGFloat = 0) -> UIView {
return fill(.vertical, points: points)
}

Expand All @@ -35,16 +35,16 @@ public extension UIView {
A padding can be used to apply equal spaces between the view and its superview
*/
@discardableResult
public func fillVertically(m points: CGFloat = 0) -> UIView {
func fillVertically(m points: CGFloat = 0) -> UIView {
return fill(.vertical, points: points)
}

@available(*, deprecated: 2.2.1, message: "Use 'fillHorizontally' instead")
@available(*, deprecated, message: "Use 'fillHorizontally' instead")
/**
Adds the constraints needed for the view to fill its `superview` Horizontally.
A padding can be used to apply equal spaces between the view and its superview
*/
public func fillH(m points: CGFloat = 0) -> UIView {
func fillH(m points: CGFloat = 0) -> UIView {
return fill(.horizontal, points: points)
}

Expand All @@ -53,7 +53,7 @@ public extension UIView {
A padding can be used to apply equal spaces between the view and its superview
*/
@discardableResult
public func fillHorizontally(m points: CGFloat = 0) -> UIView {
func fillHorizontally(m points: CGFloat = 0) -> UIView {
return fill(.horizontal, points: points)
}

Expand Down
Loading

0 comments on commit 8412331

Please sign in to comment.