Skip to content
This repository has been archived by the owner on Sep 15, 2019. It is now read-only.

Commit

Permalink
Improved config argument name
Browse files Browse the repository at this point in the history
  • Loading branch information
Satinder Singh committed Jun 6, 2017
1 parent 521cb91 commit f7d1333
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Example/SnapLayout_ExampleTests/SnapManagerTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ class SnapManagerTests: BaseTestCase {
height: heightConstant)
let centerConfig = SnapConfig(centerX: centerXConstant, centerY: centerYConstant)
let snapManager = childView.snap(constants: snapConfig)
.snap(constants: centerConfig)
.snap(config: centerConfig)
XCTAssertNotNil(snapManager.top)
XCTAssertEqual(snapManager.top!.constant, topConstant)
XCTAssertNotNil(snapManager.leading)
Expand Down
22 changes: 11 additions & 11 deletions SnapLayout/Classes/SnapManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -84,24 +84,24 @@ public class SnapManager {
}

/// Snap to view based on argument values.
/// Nil properties within ConstraintConstants will not apply constraints.
/// nil properties within SnapConfig will not apply constraints.
///
/// - Parameters:
/// - view: View to to apply constraints with (defaulted to superview if nil)
/// - constants: ConstraintConstants to apply
/// - config: SnapConfig to apply
/// - isActive: Boolean determining if constraint should be activated (default true)
/// - Returns: SnapManager holding all the values associated with constraints
@discardableResult
public func snap(to view: View? = nil, constants: SnapConfig, isActive: Bool = true) -> SnapManager {
public func snap(to view: View? = nil, config: SnapConfig, isActive: Bool = true) -> SnapManager {
return snap(to: view,
top: constants.top,
leading: constants.leading,
bottom: constants.bottom,
trailing: constants.trailing,
width: constants.width,
height: constants.height,
centerX: constants.centerX,
centerY: constants.centerY,
top: config.top,
leading: config.leading,
bottom: config.bottom,
trailing: config.trailing,
width: config.width,
height: config.height,
centerX: config.centerX,
centerY: config.centerY,
isActive: isActive)
}

Expand Down

0 comments on commit f7d1333

Please sign in to comment.