Skip to content

Commit e44ddf9

Browse files
dharmik-ymlmpospese
authored andcommitted
FIxed documentation and swiftLint warning
1 parent c8b2851 commit e44ddf9

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

Sources/YCoreUI/Extensions/UIKit/UIView+constrainSize.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ extension UIView {
1212
/// Constrain the receiving view with given size
1313
/// - Parameters:
1414
/// - size: size of view to constrain to
15-
/// - relation: relation to evaluate (towards sibling) (default `.equal`)
15+
/// - relation: relation to evaluate (towards size) (default `.equal`)
1616
/// - priority: constraint priority (default `.required`)
1717
/// - isActive: whether to activate the constraint or not (default `true`)
1818
/// - Returns: The created layout constraint
@@ -45,7 +45,7 @@ extension UIView {
4545
/// - Parameters:
4646
/// - width: width of view to constrain to
4747
/// - height: height of view to constrain to
48-
/// - relation: relation to evaluate (towards sibling) (default `.equal`)
48+
/// - relation: relation to evaluate (towards width and height) (default `.equal`)
4949
/// - priority: constraint priority (default `.required`)
5050
/// - isActive: whether to activate the constraint or not (default `true`)
5151
/// - Returns: The created layout constraint
@@ -62,7 +62,7 @@ extension UIView {
6262
/// Constrain the receiving view with given dimension
6363
/// - Parameters:
6464
/// - dimension: dimension of view to constrain to
65-
/// - relation: relation to evaluate (towards sibling) (default `.equal`)
65+
/// - relation: relation to evaluate (towards dimension) (default `.equal`)
6666
/// - priority: constraint priority (default `.required`)
6767
/// - isActive: whether to activate the constraint or not (default `true`)
6868
/// - Returns: The created layout constraint

Tests/YCoreUITests/Extensions/UIKit/UIView+constrainSizeTests.swift

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,11 @@ import XCTest
1010
@testable import YCoreUI
1111

1212
final class UIViewConstrainSizeTests: XCTestCase {
13-
1413
let randomSize = CGSize(width: 150, height: 200)
1514

1615
func testSize() {
1716
let sut = makeSUT()
1817

19-
XCTAssert(sut.translatesAutoresizingMaskIntoConstraints)
20-
2118
let sizeAttributes: [
2219
(NSLayoutConstraint.Attribute, CGFloat)
2320
] = [
@@ -27,6 +24,8 @@ final class UIViewConstrainSizeTests: XCTestCase {
2724

2825
let constraints = sut.constrainSize(randomSize)
2926

27+
XCTAssertFalse(sut.translatesAutoresizingMaskIntoConstraints)
28+
3029
sizeAttributes.forEach {
3130
guard let constraint = constraints[$0.0] else {
3231
XCTFail("Expected to have constraint for give attribute")
@@ -58,6 +57,8 @@ final class UIViewConstrainSizeTests: XCTestCase {
5857

5958
let constraints = sut.constrainSize(width: randomSize.width, height: randomSize.height)
6059

60+
XCTAssertFalse(sut.translatesAutoresizingMaskIntoConstraints)
61+
6162
sizeAttributes.forEach {
6263
guard let constraint = constraints[$0.0] else {
6364
XCTFail("Expected to have constraint for give attribute")
@@ -91,6 +92,8 @@ final class UIViewConstrainSizeTests: XCTestCase {
9192

9293
let constraints = sut.constrainSize(randomDimension)
9394

95+
XCTAssertFalse(sut.translatesAutoresizingMaskIntoConstraints)
96+
9497
sizeAttributes.forEach {
9598
guard let constraint = constraints[$0.0] else {
9699
XCTFail("Expected to have constraint for give attribute")

0 commit comments

Comments
 (0)