Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The unified swifty prefix #37

Merged
merged 21 commits into from
Jun 13, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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