Skip to content

Commit

Permalink
Merge pull request #10 from mobillium/feature/update-attributedstring…
Browse files Browse the repository at this point in the history
…dictionarybuilder

rename NSAttributedStringBuilder to AttributedStringDictionaryBuilder.
  • Loading branch information
aslanmehmetsalih authored Mar 18, 2021
2 parents 6e359be + 8e1bfbd commit 810fe22
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 33 deletions.
8 changes: 4 additions & 4 deletions Example/MobilliumBuilders.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

/* Begin PBXBuildFile section */
14F6A9DC434E70976A1A52D7 /* Pods_MobilliumBuilders_Tests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 299AB978ED542F326C02897B /* Pods_MobilliumBuilders_Tests.framework */; };
7A00777826013A2C0085E756 /* NSAttributedStringBuilderTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A00777726013A2C0085E756 /* NSAttributedStringBuilderTests.swift */; };
7A00777826013A2C0085E756 /* AttributedStringDictionaryBuilderTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A00777726013A2C0085E756 /* AttributedStringDictionaryBuilderTests.swift */; };
A22847BD26032F5700C790FE /* UIViewBuilderTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A22847BC26032F5700C790FE /* UIViewBuilderTests.swift */; };
A22847CC2603482900C790FE /* UIImageViewBuilderTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A22847CB2603482900C790FE /* UIImageViewBuilderTests.swift */; };
A228481726035A4E00C790FE /* UITextFieldBuilderTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A228481626035A4E00C790FE /* UITextFieldBuilderTests.swift */; };
Expand All @@ -27,7 +27,7 @@
607FACE51AFB9204008FA782 /* MobilliumBuilders_Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = MobilliumBuilders_Tests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
607FACEA1AFB9204008FA782 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
7895CD3E1B1CF98C30AC2E27 /* Pods-MobilliumBuilders_Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-MobilliumBuilders_Tests.debug.xcconfig"; path = "Target Support Files/Pods-MobilliumBuilders_Tests/Pods-MobilliumBuilders_Tests.debug.xcconfig"; sourceTree = "<group>"; };
7A00777726013A2C0085E756 /* NSAttributedStringBuilderTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NSAttributedStringBuilderTests.swift; sourceTree = "<group>"; };
7A00777726013A2C0085E756 /* AttributedStringDictionaryBuilderTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AttributedStringDictionaryBuilderTests.swift; sourceTree = "<group>"; };
A22847BC26032F5700C790FE /* UIViewBuilderTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UIViewBuilderTests.swift; sourceTree = "<group>"; };
A22847CB2603482900C790FE /* UIImageViewBuilderTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UIImageViewBuilderTests.swift; sourceTree = "<group>"; };
A228481626035A4E00C790FE /* UITextFieldBuilderTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UITextFieldBuilderTests.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -83,7 +83,7 @@
607FACE81AFB9204008FA782 /* Tests */ = {
isa = PBXGroup;
children = (
7A00777726013A2C0085E756 /* NSAttributedStringBuilderTests.swift */,
7A00777726013A2C0085E756 /* AttributedStringDictionaryBuilderTests.swift */,
A27B27BF2601E824003C16F0 /* UIStackViewBuilderTests.swift */,
A2BE5FCD2601F34200DAA587 /* UIButtonBuilderTests.swift */,
A2BE60072602175F00DAA587 /* UIScrollViewBuilderTests.swift */,
Expand Down Expand Up @@ -249,7 +249,7 @@
A2BE60082602175F00DAA587 /* UIScrollViewBuilderTests.swift in Sources */,
A228481726035A4E00C790FE /* UITextFieldBuilderTests.swift in Sources */,
A22847CC2603482900C790FE /* UIImageViewBuilderTests.swift in Sources */,
7A00777826013A2C0085E756 /* NSAttributedStringBuilderTests.swift in Sources */,
7A00777826013A2C0085E756 /* AttributedStringDictionaryBuilderTests.swift in Sources */,
A27B27C02601E824003C16F0 /* UIStackViewBuilderTests.swift in Sources */,
A2BE5FCE2601F34200DAA587 /* UIButtonBuilderTests.swift in Sources */,
A2BE602A26022D5D00DAA587 /* UILabelBuilderTests.swift in Sources */,
Expand Down
8 changes: 4 additions & 4 deletions Example/Pods/Pods.xcodeproj/project.pbxproj

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// NSAttributedStringBuilderTests.swift
// AttributedStringDictionaryBuilderTests.swift
// MobilliumBuilders
//
// Created by Mehmet Salih Aslan on 16.03.2021.
Expand All @@ -9,11 +9,11 @@
import XCTest
import MobilliumBuilders

class NSAttributedStringBuilderTests: XCTestCase {
class AttributedStringDictionaryBuilderTests: XCTestCase {

func testFont() {
let font = UIFont.systemFont(ofSize: 12)
let attributes = NSAttributedStringBuilder()
let attributes = AttributedStringDictionaryBuilder()
.font(font)
.build()

Expand All @@ -24,7 +24,7 @@ class NSAttributedStringBuilderTests: XCTestCase {

func testParagraphStyle() {
let paragraphStyle = NSMutableParagraphStyle()
let attributes = NSAttributedStringBuilder()
let attributes = AttributedStringDictionaryBuilder()
.paragraphStyle(paragraphStyle)
.build()

Expand All @@ -35,7 +35,7 @@ class NSAttributedStringBuilderTests: XCTestCase {

func testForegroundColor() {
let foregroundColor = UIColor.white
let attributes = NSAttributedStringBuilder()
let attributes = AttributedStringDictionaryBuilder()
.foregroundColor(foregroundColor)
.build()

Expand All @@ -46,7 +46,7 @@ class NSAttributedStringBuilderTests: XCTestCase {

func testBackgroundColor() {
let backgroundColor = UIColor.red
let attributes = NSAttributedStringBuilder()
let attributes = AttributedStringDictionaryBuilder()
.backgroundColor(backgroundColor)
.build()

Expand All @@ -57,7 +57,7 @@ class NSAttributedStringBuilderTests: XCTestCase {

func testKern() {
let kern: Int = 3
let attributes = NSAttributedStringBuilder()
let attributes = AttributedStringDictionaryBuilder()
.kern(kern)
.build()

Expand All @@ -69,7 +69,7 @@ class NSAttributedStringBuilderTests: XCTestCase {
func testStrikethrough() {
let style = NSUnderlineStyle.patternDash
let color = UIColor.gray
let attributes = NSAttributedStringBuilder()
let attributes = AttributedStringDictionaryBuilder()
.strikethrough(style: style, color: color)
.build()

Expand All @@ -81,7 +81,7 @@ class NSAttributedStringBuilderTests: XCTestCase {

func testStrikethroughStyle() {
let strikethroughStyle = NSUnderlineStyle.patternDash
let attributes = NSAttributedStringBuilder()
let attributes = AttributedStringDictionaryBuilder()
.strikethroughStyle(strikethroughStyle)
.build()

Expand All @@ -92,7 +92,7 @@ class NSAttributedStringBuilderTests: XCTestCase {

func testStrikethroughColor() {
let strikethroughColor = UIColor.blue
let attributes = NSAttributedStringBuilder()
let attributes = AttributedStringDictionaryBuilder()
.strikethroughColor(strikethroughColor)
.build()

Expand All @@ -104,7 +104,7 @@ class NSAttributedStringBuilderTests: XCTestCase {
func testUnderline() {
let style = NSUnderlineStyle.patternDashDot
let color = UIColor.cyan
let attributes = NSAttributedStringBuilder()
let attributes = AttributedStringDictionaryBuilder()
.underline(style: style, color: color)
.build()

Expand All @@ -116,7 +116,7 @@ class NSAttributedStringBuilderTests: XCTestCase {

func testUnderlineStyle() {
let underlineStyle = NSUnderlineStyle.patternDot
let attributes = NSAttributedStringBuilder()
let attributes = AttributedStringDictionaryBuilder()
.underlineStyle(underlineStyle)
.build()

Expand All @@ -127,7 +127,7 @@ class NSAttributedStringBuilderTests: XCTestCase {

func testUnderlineColor() {
let underlineColor = UIColor.yellow
let attributes = NSAttributedStringBuilder()
let attributes = AttributedStringDictionaryBuilder()
.underlineColor(underlineColor)
.build()

Expand All @@ -139,7 +139,7 @@ class NSAttributedStringBuilderTests: XCTestCase {
func testStroke() {
let color = UIColor.brown
let width: Int = 1
let attributes = NSAttributedStringBuilder()
let attributes = AttributedStringDictionaryBuilder()
.stroke(color: color, width: width)
.build()

Expand All @@ -151,7 +151,7 @@ class NSAttributedStringBuilderTests: XCTestCase {

func testStrokeColor() {
let strokeColor = UIColor.green
let attributes = NSAttributedStringBuilder()
let attributes = AttributedStringDictionaryBuilder()
.strokeColor(strokeColor)
.build()

Expand All @@ -162,7 +162,7 @@ class NSAttributedStringBuilderTests: XCTestCase {

func testStrokeWidth() {
let strokeWidth: Int = 3
let attributes = NSAttributedStringBuilder()
let attributes = AttributedStringDictionaryBuilder()
.strokeWidth(strokeWidth)
.build()

Expand All @@ -176,7 +176,7 @@ class NSAttributedStringBuilderTests: XCTestCase {
XCTAssert(false)
return
}
let attributes = NSAttributedStringBuilder()
let attributes = AttributedStringDictionaryBuilder()
.link(link)
.build()

Expand Down
2 changes: 1 addition & 1 deletion Example/Tests/UILabelBuilderTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class UILabelBuilderTests: XCTestCase {
}

func testAttributedText() {
let attributes = NSAttributedStringBuilder()
let attributes = AttributedStringDictionaryBuilder()
.font(.systemFont(ofSize: 12))
.build()

Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
//
// NSAttributedStringBuilder.swift
// AttributedStringDictionaryBuilder.swift
// MobilliumBuilders
//
// Created by Mehmet Salih Aslan on 16.03.2021.
//

import UIKit

public class NSAttributedStringBuilder {
public class AttributedStringDictionaryBuilder {

public typealias NSAttributedStringDictionary = [NSAttributedString.Key: Any]
private var attributes: NSAttributedStringDictionary = [:]
public typealias AttributedStringDictionary = [NSAttributedString.Key: Any]
private var attributes: AttributedStringDictionary = [:]

public init() {}

Expand Down Expand Up @@ -107,8 +107,7 @@ public class NSAttributedStringBuilder {
return self
}

@discardableResult
public func build() -> NSAttributedStringDictionary {
public func build() -> AttributedStringDictionary {
return attributes
}

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ pod 'MobilliumBuilders'
```
## Usage
MobilliumBuilders comes with these builders.
- NSAttributedStringBuilder
- AttributedStringDictionaryBuilder
- UIButtonBuilder
- UIImageViewBuilder
- UILabelBuilder
Expand Down

0 comments on commit 810fe22

Please sign in to comment.