Skip to content

Commit

Permalink
The unified swifty prefix (#37)
Browse files Browse the repository at this point in the history
* extension NSString for macOS

* UIKit + SwiftyAttributes

* tests for public var swiftyLargeTitleTextAttributes

* fixed build error on tvOS

* fixed for tvOS again

* moved NSString+SwiftyAttributes

* fixed macOS build error

* less functions

* removed unused typealiases. less #if os. added documentation for new properties.

* add functions again

* typealiases

* added NSString extension to project

* Update NSString+SwiftyAttributes.swift

* tests

* Update NSString+macOS.swift

* removed functions without tests

* swifty_

* swifty_ -> swifty
  • Loading branch information
RomanPodymov authored and eddiekaiger committed Jun 13, 2019
1 parent f599af5 commit a6b07aa
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ extension NSString {

- parameter attrs: The attributes to use.
*/
public func swifty_size(withSwiftyAttributes attrs: [Attribute]? = nil) -> Size {
public func swiftySize(withSwiftyAttributes attrs: [Attribute]? = nil) -> Size {
return size(withAttributes: attrs?.foundationAttributes)
}

Expand All @@ -41,7 +41,7 @@ extension NSString {
- parameter swiftyAttributes: The attributes to use.
- parameter context: Drawing context.
*/
public func swifty_boundingRect(with size: Size, options: DrawingOptions = [], swiftyAttributes: [Attribute]? = nil, context: DrawingContext?) -> Rect {
public func swiftyBoundingRect(with size: Size, options: DrawingOptions = [], swiftyAttributes: [Attribute]? = nil, context: DrawingContext?) -> Rect {
return boundingRect(with: size, options: options, attributes: swiftyAttributes?.foundationAttributes, context: context)
}
}
2 changes: 1 addition & 1 deletion SwiftyAttributes/Sources/macOS/NSString+macOS.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ extension NSString {
- parameter swiftyAttributes: The attributes to use.
*/
@available(macOS, deprecated: 10.12)
public func swifty_boundingRect(with size: Size, options: DrawingOptions = [], swiftyAttributes: [Attribute]? = nil) -> Rect {
public func swiftyBoundingRect(with size: Size, options: DrawingOptions = [], swiftyAttributes: [Attribute]? = nil) -> Rect {
return boundingRect(with: size, options: options, attributes: swiftyAttributes?.foundationAttributes)
}
}
Expand Down
6 changes: 3 additions & 3 deletions SwiftyAttributesTests/NSString_Tests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ class NSString_Tests: XCTestCase {

func testSizeWithSwiftyAttributes() {
let testString = "Hello World" as NSString
let subject = testString.swifty_size(withSwiftyAttributes: subjectAttributes)
let subject = testString.swiftySize(withSwiftyAttributes: subjectAttributes)
let expected = testString.size(withAttributes: expectedAttributes)
XCTAssertEqual(subject, expected)
}

func testBoundingRectWithSizeOptionsSwiftyAttributesContext() {
let testString = "Hello World" as NSString
let testSize = CGSize(width: 50, height: 100)
let subject = testString.swifty_boundingRect(
let subject = testString.swiftyBoundingRect(
with: testSize,
options: [],
swiftyAttributes: subjectAttributes,
Expand All @@ -52,7 +52,7 @@ class NSString_Tests: XCTestCase {
func testBoundingRectWithSizeOptionsSwiftyAttributes() {
let testString = "Hello World" as NSString
let testSize = CGSize(width: 50, height: 100)
let subject = testString.swifty_boundingRect(
let subject = testString.swiftyBoundingRect(
with: testSize,
options: [],
swiftyAttributes: subjectAttributes
Expand Down

0 comments on commit a6b07aa

Please sign in to comment.