Skip to content

Commit

Permalink
Fix method conflict on category
Browse files Browse the repository at this point in the history
Category UIView+Constraints had methods name that caused conflicts
with 3rd party libraries or other extentions of the same kind.

Methods are now prefixed using Apple conventions:
https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/ProgrammingWithObjectiveC/CustomizingExistingClasses/CustomizingExistingClasses.html\#//apple_ref/doc/uid/TP40011210-CH6-SW4

How to test
I'm including a sample project that contains an extention with a
method named the same way we have currently on the SDK (production)
To replicate crash:
Go to Podfile
Uncomment line
# gets latest version
[!] Unknown command: `WootricSDK`
Did you mean: trunk?

Usage:

    $ pod COMMAND

      CocoaPods, the Cocoa library package manager.

Commands:

    + cache         Manipulate the CocoaPods cache
    + deintegrate   Deintegrate CocoaPods from your project
    + env           Display pod environment
    + init          Generate a Podfile for the current directory
    + install       Install project dependencies according to versions from a
                    Podfile.lock
    + ipc           Inter-process communication
    + lib           Develop pods
    + list          List pods
    + outdated      Show outdated project dependencies
    + plugins       Show available CocoaPods plugins
    + repo          Manage spec-repositories
    + search        Search for pods
    + setup         Setup the CocoaPods environment
    + spec          Manage pod specs
    + trunk         Interact with the CocoaPods API (e.g. publishing new specs)
    + try           Try a Pod!
    + update        Update outdated project dependencies and create new Podfile.lock

Options:

    --silent        Show nothing
    --version       Show the version of the tool
    --verbose       Show more debugging information
    --no-ansi       Show output without ANSI codes
    --help          Show help banner of specified command
From terminal run [!] No `Podfile' found in the project directory.

This should get the SDK from Cocoapods

Change clientId, clientSecret and accountToken in ViewControler.swift

If you run the project the app should crash.

To fix this:comment [!] Unknown command: `WootricSDK`
Did you mean: trunk?

Usage:

    $ pod COMMAND

      CocoaPods, the Cocoa library package manager.

Commands:

    + cache         Manipulate the CocoaPods cache
    + deintegrate   Deintegrate CocoaPods from your project
    + env           Display pod environment
    + init          Generate a Podfile for the current directory
    + install       Install project dependencies according to versions from a
                    Podfile.lock
    + ipc           Inter-process communication
    + lib           Develop pods
    + list          List pods
    + outdated      Show outdated project dependencies
    + plugins       Show available CocoaPods plugins
    + repo          Manage spec-repositories
    + search        Search for pods
    + setup         Setup the CocoaPods environment
    + spec          Manage pod specs
    + trunk         Interact with the CocoaPods API (e.g. publishing new specs)
    + try           Try a Pod!
    + update        Update outdated project dependencies and create new Podfile.lock

Options:

    --silent        Show nothing
    --version       Show the version of the tool
    --verbose       Show more debugging information
    --no-ansi       Show output without ANSI codes
    --help          Show help banner of specified command
Uncomment line
and change YOUR_PATH to where the local WootricSDK is.
Run [!] No `Podfile' found in the project directory.
Now if you run the project there should be no crash and run normally.

Trello: https://trello.com/c/fjwDvdRe/975-ios-sdk-crashes-on-swift
  • Loading branch information
diegoserranoa committed Nov 17, 2016
1 parent 67d0a5a commit 50b9292
Show file tree
Hide file tree
Showing 17 changed files with 160 additions and 147 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,10 @@
## 0.5.12 (2016-11-17)

### Fixed:

- Change method names in category to avoid conflict
- Update project settings

## 0.5.11 (2016-10-12)

### Fixed:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -29,7 +29,7 @@ The easiest way to get Wootric into your iOS project is to use [CocoaPods](http:

2. Create a file in your Xcode project called Podfile and add the following line:
```ruby
pod "WootricSDK", "~> 0.5.11"
pod "WootricSDK", "~> 0.5.12"
```

3. In your Xcode project directory run the following command:
Expand Down
2 changes: 1 addition & 1 deletion WootricSDK.podspec
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'WootricSDK'
s.version = '0.5.11'
s.version = '0.5.12'
s.license = 'MIT'
s.summary = 'Wootric SDK for displaying survey for end user.'
s.homepage = 'https://github.com/Wootric/WootricSDK-iOS'
Expand Down
8 changes: 7 additions & 1 deletion WootricSDK/WootricSDK.xcodeproj/project.pbxproj
Expand Up @@ -538,7 +538,7 @@
B2DC6EF91B81E6F900F599B3 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0700;
LastUpgradeCheck = 0800;
ORGANIZATIONNAME = Wootric;
TargetAttributes = {
B2DC6F011B81E6F900F599B3 = {
Expand Down Expand Up @@ -670,8 +670,10 @@
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
Expand Down Expand Up @@ -718,8 +720,10 @@
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
Expand Down Expand Up @@ -749,6 +753,7 @@
B2DC6F191B81E6F900F599B3 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
Expand All @@ -768,6 +773,7 @@
B2DC6F1A1B81E6F900F599B3 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
Expand Down
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0700"
LastUpgradeVersion = "0800"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
24 changes: 12 additions & 12 deletions WootricSDK/WootricSDK/UIView+Constraints.h
Expand Up @@ -26,17 +26,17 @@

@interface UIView (Constraints)

- (NSLayoutConstraint *)top;
- (NSLayoutConstraint *)bottom;
- (NSLayoutConstraint *)left;
- (NSLayoutConstraint *)right;
- (NSLayoutConstraint *)centerX;
- (NSLayoutConstraint *)centerY;
- (void)constraintHeight:(CGFloat)height;
- (void)constraintWidth:(CGFloat)width;
- (void)constraintHeightEqualSecondViewHeight:(UIView *)secondView;
- (void)constraintWidthEqualSecondViewWidth:(UIView *)secondView;
- (void)constraintHeightToSecondViewHeight:(UIView *)secondView withConstant:(CGFloat)constant;
- (void)constraintWidthToSecondViewWidth:(UIView *)secondView withConstant:(CGFloat)constant;
- (NSLayoutConstraint *)wtr_topConstraint;
- (NSLayoutConstraint *)wtr_bottomConstraint;
- (NSLayoutConstraint *)wtr_leftConstraint;
- (NSLayoutConstraint *)wtr_rightConstraint;
- (NSLayoutConstraint *)wtr_centerXConstraint;
- (NSLayoutConstraint *)wtr_centerYConstraint;
- (void)wtr_constraintHeight:(CGFloat)height;
- (void)wtr_constraintWidth:(CGFloat)width;
- (void)wtr_constraintHeightEqualSecondViewHeight:(UIView *)secondView;
- (void)wtr_constraintWidthEqualSecondViewWidth:(UIView *)secondView;
- (void)wtr_constraintHeightToSecondViewHeight:(UIView *)secondView withConstant:(CGFloat)constant;
- (void)wtr_constraintWidthToSecondViewWidth:(UIView *)secondView withConstant:(CGFloat)constant;

@end
24 changes: 12 additions & 12 deletions WootricSDK/WootricSDK/UIView+Constraints.m
Expand Up @@ -26,7 +26,7 @@

@implementation UIView (Constraints)

- (NSLayoutConstraint *)top {
- (NSLayoutConstraint *)wtr_topConstraint {
UIView *emptyView = [[UIView alloc] init];
NSLayoutConstraint *constraint = [NSLayoutConstraint constraintWithItem:self
attribute:NSLayoutAttributeTop
Expand All @@ -38,7 +38,7 @@ - (NSLayoutConstraint *)top {
return constraint;
}

- (NSLayoutConstraint *)bottom {
- (NSLayoutConstraint *)wtr_bottomConstraint {
UIView *emptyView = [[UIView alloc] init];
NSLayoutConstraint *constraint = [NSLayoutConstraint constraintWithItem:self
attribute:NSLayoutAttributeBottom
Expand All @@ -50,7 +50,7 @@ - (NSLayoutConstraint *)bottom {
return constraint;
}

- (NSLayoutConstraint *)left {
- (NSLayoutConstraint *)wtr_leftConstraint {
UIView *emptyView = [[UIView alloc] init];
NSLayoutConstraint *constraint = [NSLayoutConstraint constraintWithItem:self
attribute:NSLayoutAttributeLeft
Expand All @@ -62,7 +62,7 @@ - (NSLayoutConstraint *)left {
return constraint;
}

- (NSLayoutConstraint *)right {
- (NSLayoutConstraint *)wtr_rightConstraint {
UIView *emptyView = [[UIView alloc] init];
NSLayoutConstraint *constraint = [NSLayoutConstraint constraintWithItem:self
attribute:NSLayoutAttributeRight
Expand All @@ -74,7 +74,7 @@ - (NSLayoutConstraint *)right {
return constraint;
}

- (NSLayoutConstraint *)centerX {
- (NSLayoutConstraint *)wtr_centerXConstraint {
UIView *emptyView = [[UIView alloc] init];
NSLayoutConstraint *constraint = [NSLayoutConstraint constraintWithItem:self
attribute:NSLayoutAttributeCenterX
Expand All @@ -86,7 +86,7 @@ - (NSLayoutConstraint *)centerX {
return constraint;
}

- (NSLayoutConstraint *)centerY {
- (NSLayoutConstraint *)wtr_centerYConstraint {
UIView *emptyView = [[UIView alloc] init];
NSLayoutConstraint *constraint = [NSLayoutConstraint constraintWithItem:self
attribute:NSLayoutAttributeCenterY
Expand All @@ -98,7 +98,7 @@ - (NSLayoutConstraint *)centerY {
return constraint;
}

- (void)constraintHeight:(CGFloat)height {
- (void)wtr_constraintHeight:(CGFloat)height {
NSLayoutConstraint *constraint = [NSLayoutConstraint constraintWithItem:self
attribute:NSLayoutAttributeHeight
relatedBy:NSLayoutRelationEqual
Expand All @@ -110,7 +110,7 @@ - (void)constraintHeight:(CGFloat)height {
[self addConstraint:constraint];
}

- (void)constraintWidth:(CGFloat)width {
- (void)wtr_constraintWidth:(CGFloat)width {
NSLayoutConstraint *constraint = [NSLayoutConstraint constraintWithItem:self
attribute:NSLayoutAttributeWidth
relatedBy:NSLayoutRelationEqual
Expand All @@ -122,7 +122,7 @@ - (void)constraintWidth:(CGFloat)width {
[self addConstraint:constraint];
}

- (void)constraintHeightEqualSecondViewHeight:(UIView *)secondView {
- (void)wtr_constraintHeightEqualSecondViewHeight:(UIView *)secondView {
NSLayoutConstraint *constraint = [NSLayoutConstraint constraintWithItem:self
attribute:NSLayoutAttributeHeight
relatedBy:NSLayoutRelationEqual
Expand All @@ -134,7 +134,7 @@ - (void)constraintHeightEqualSecondViewHeight:(UIView *)secondView {
[secondView addConstraint:constraint];
}

- (void)constraintWidthEqualSecondViewWidth:(UIView *)secondView {
- (void)wtr_constraintWidthEqualSecondViewWidth:(UIView *)secondView {
NSLayoutConstraint *constraint = [NSLayoutConstraint constraintWithItem:self
attribute:NSLayoutAttributeWidth
relatedBy:NSLayoutRelationEqual
Expand All @@ -146,7 +146,7 @@ - (void)constraintWidthEqualSecondViewWidth:(UIView *)secondView {
[secondView addConstraint:constraint];
}

- (void)constraintHeightToSecondViewHeight:(UIView *)secondView withConstant:(CGFloat)constant {
- (void)wtr_constraintHeightToSecondViewHeight:(UIView *)secondView withConstant:(CGFloat)constant {
NSLayoutConstraint *constraint = [NSLayoutConstraint constraintWithItem:self
attribute:NSLayoutAttributeHeight
relatedBy:NSLayoutRelationEqual
Expand All @@ -158,7 +158,7 @@ - (void)constraintHeightToSecondViewHeight:(UIView *)secondView withConstant:(CG
[secondView addConstraint:constraint];
}

- (void)constraintWidthToSecondViewWidth:(UIView *)secondView withConstant:(CGFloat)constant {
- (void)wtr_constraintWidthToSecondViewWidth:(UIView *)secondView withConstant:(CGFloat)constant {
NSLayoutConstraint *constraint = [NSLayoutConstraint constraintWithItem:self
attribute:NSLayoutAttributeWidth
relatedBy:NSLayoutRelationEqual
Expand Down
4 changes: 2 additions & 2 deletions WootricSDK/WootricSDK/WTRCircleScoreButton.m
Expand Up @@ -44,8 +44,8 @@ - (instancetype)initWithViewController:(UIViewController *)viewController {
}

- (void)setupConstraints {
[self constraintHeight:42];
[self constraintWidth:42];
[self wtr_constraintHeight:42];
[self wtr_constraintWidth:42];
}

- (void)addConstraintsWithSuperview:(UIView *)superView andLeftConstraintConstant:(CGFloat)leftConstant {
Expand Down
4 changes: 2 additions & 2 deletions WootricSDK/WootricSDK/WTRCircleScoreView.m
Expand Up @@ -38,8 +38,8 @@ - (instancetype)initWithViewController:(UIViewController *)viewController {
}

- (void)setupConstraints {
[self constraintHeight:42];
[self constraintWidth:492];
[self wtr_constraintHeight:42];
[self wtr_constraintWidth:492];
}

- (void)addCircleButtonsWithViewController:(UIViewController *)viewController {
Expand Down
26 changes: 13 additions & 13 deletions WootricSDK/WootricSDK/WTRFeedbackView.m
Expand Up @@ -128,28 +128,28 @@ - (void)addSubviews {
}

- (void)setupEditScoreButtonConstraints {
[[[_editScoreButton centerX] toSecondViewCenterX:self] addToView:self];
[[[[_editScoreButton top] toSecondViewTop:self] withConstant:16] addToView:self];
[[[_editScoreButton wtr_centerXConstraint] toSecondViewCenterX:self] addToView:self];
[[[[_editScoreButton wtr_topConstraint] toSecondViewTop:self] withConstant:16] addToView:self];
}

- (void)setupFollowupLabelConstraints {
[[[_followupLabel centerX] toSecondViewCenterX:self] addToView:self];
[[[[_followupLabel top] toSecondViewTop:self] withConstant:50] addToView:self];
[[[[_followupLabel left] toSecondViewLeft:self] withConstant:16] addToView:self];
[[[[_followupLabel right] toSecondViewRight:self] withConstant:-16] addToView:self];
[[[_followupLabel wtr_centerXConstraint] toSecondViewCenterX:self] addToView:self];
[[[[_followupLabel wtr_topConstraint] toSecondViewTop:self] withConstant:50] addToView:self];
[[[[_followupLabel wtr_leftConstraint] toSecondViewLeft:self] withConstant:16] addToView:self];
[[[[_followupLabel wtr_rightConstraint] toSecondViewRight:self] withConstant:-16] addToView:self];
}

- (void)setupFeedbackTextViewConstraints {
[[[[_feedbackTextView left] toSecondViewLeft:self] withConstant:16] addToView:self];
[[[[_feedbackTextView right] toSecondViewRight:self] withConstant:-16] addToView:self];
[[[[_feedbackTextView top] toSecondViewBottom:_followupLabel] withConstant:16] addToView:self];
[[[_feedbackTextView bottom] toSecondViewBottom:self] addToView:self];
[[[[_feedbackTextView wtr_leftConstraint] toSecondViewLeft:self] withConstant:16] addToView:self];
[[[[_feedbackTextView wtr_rightConstraint] toSecondViewRight:self] withConstant:-16] addToView:self];
[[[[_feedbackTextView wtr_topConstraint] toSecondViewBottom:_followupLabel] withConstant:16] addToView:self];
[[[_feedbackTextView wtr_bottomConstraint] toSecondViewBottom:self] addToView:self];
}

- (void)setupFeedbackLabelConstraints {
[[[[_feedbackPlaceholder left] toSecondViewLeft:_feedbackTextView] withConstant:20] addToView:self];
[[[[_feedbackPlaceholder right] toSecondViewRight:_feedbackTextView] withConstant:-20] addToView:self];
[[[[_feedbackPlaceholder top] toSecondViewTop:_feedbackTextView] withConstant:17] addToView:self];
[[[[_feedbackPlaceholder wtr_leftConstraint] toSecondViewLeft:_feedbackTextView] withConstant:20] addToView:self];
[[[[_feedbackPlaceholder wtr_rightConstraint] toSecondViewRight:_feedbackTextView] withConstant:-20] addToView:self];
[[[[_feedbackPlaceholder wtr_topConstraint] toSecondViewTop:_feedbackTextView] withConstant:17] addToView:self];
}

@end
6 changes: 3 additions & 3 deletions WootricSDK/WootricSDK/WTRSingleScoreLabel.m
Expand Up @@ -72,9 +72,9 @@ - (void)addConstraintsWithLeftConstraintConstant:(CGFloat)leftConstant {

[superView addConstraint:self.leftConstraint];

[[[self centerY] toSecondViewCenterY:superView] addToView:superView];
[self constraintWidth:24];
[self constraintHeight:16];
[[[self wtr_centerYConstraint] toSecondViewCenterY:superView] addToView:superView];
[self wtr_constraintWidth:24];
[self wtr_constraintHeight:16];
}

@end
50 changes: 25 additions & 25 deletions WootricSDK/WootricSDK/WTRSocialShareView.m
Expand Up @@ -183,15 +183,15 @@ - (void)setupSocialShareQuestionLabel {
}

- (void)setupCustomThankYouLabelConstraints {
[[[[_customThankYouLabel left] toSecondViewLeft:self] withConstant:24] addToView:self];
[[[[_customThankYouLabel right] toSecondViewRight:self] withConstant:-24] addToView:self];
[[[[_customThankYouLabel top] toSecondViewBottom:_finalThankYouLabel] withConstant:8] addToView:self];
[[[[_customThankYouLabel wtr_leftConstraint] toSecondViewLeft:self] withConstant:24] addToView:self];
[[[[_customThankYouLabel wtr_rightConstraint] toSecondViewRight:self] withConstant:-24] addToView:self];
[[[[_customThankYouLabel wtr_topConstraint] toSecondViewBottom:_finalThankYouLabel] withConstant:8] addToView:self];
}

- (void)setupFacebookButtonConstraints {
[_facebookButton constraintWidth:32];
[_facebookButton constraintHeight:32];
[[[[_facebookButton top] toSecondViewBottom:_socialShareQuestionLabel] withConstant:18] addToView:self];
[_facebookButton wtr_constraintWidth:32];
[_facebookButton wtr_constraintHeight:32];
[[[[_facebookButton wtr_topConstraint] toSecondViewBottom:_socialShareQuestionLabel] withConstant:18] addToView:self];

_facebookXConstraint = [NSLayoutConstraint constraintWithItem:_facebookButton
attribute:NSLayoutAttributeCenterX
Expand All @@ -204,9 +204,9 @@ - (void)setupFacebookButtonConstraints {
}

- (void)setupTwitterButtonConstraints {
[_twitterButton constraintWidth:32];
[_twitterButton constraintHeight:32];
[[[[_twitterButton top] toSecondViewBottom:_socialShareQuestionLabel] withConstant:18] addToView:self];
[_twitterButton wtr_constraintWidth:32];
[_twitterButton wtr_constraintHeight:32];
[[[[_twitterButton wtr_topConstraint] toSecondViewBottom:_socialShareQuestionLabel] withConstant:18] addToView:self];

_twitterXConstraint = [NSLayoutConstraint constraintWithItem:_twitterButton
attribute:NSLayoutAttributeCenterX
Expand All @@ -219,9 +219,9 @@ - (void)setupTwitterButtonConstraints {
}

- (void)setupFacebookLikeButtonConstraints {
[_facebookLikeButton constraintWidth:32];
[_facebookLikeButton constraintHeight:32];
[[[[_facebookLikeButton top] toSecondViewBottom:_socialShareQuestionLabel] withConstant:18] addToView:self];
[_facebookLikeButton wtr_constraintWidth:32];
[_facebookLikeButton wtr_constraintHeight:32];
[[[[_facebookLikeButton wtr_topConstraint] toSecondViewBottom:_socialShareQuestionLabel] withConstant:18] addToView:self];

_facebookLikeXConstraint = [NSLayoutConstraint constraintWithItem:_facebookLikeButton
attribute:NSLayoutAttributeCenterX
Expand All @@ -234,28 +234,28 @@ - (void)setupFacebookLikeButtonConstraints {
}

- (void)setupSocialShareQuestionLabelConstraints {
[[[[_socialShareQuestionLabel left] toSecondViewLeft:self] withConstant:24] addToView:self];
[[[[_socialShareQuestionLabel right] toSecondViewRight:self] withConstant:-24] addToView:self];
[[[[_socialShareQuestionLabel top] toSecondViewBottom:_thankYouButton] withConstant:16] addToView:self];
[[[[_socialShareQuestionLabel wtr_leftConstraint] toSecondViewLeft:self] withConstant:24] addToView:self];
[[[[_socialShareQuestionLabel wtr_rightConstraint] toSecondViewRight:self] withConstant:-24] addToView:self];
[[[[_socialShareQuestionLabel wtr_topConstraint] toSecondViewBottom:_thankYouButton] withConstant:16] addToView:self];
}

- (void)setupFinalThankYouLabelConstraints {
[[[[_finalThankYouLabel top] toSecondViewTop:self] withConstant:16] addToView:self];
[[[[_finalThankYouLabel left] toSecondViewLeft:self] withConstant:24] addToView:self];
[[[[self right] toSecondViewRight:_finalThankYouLabel] withConstant:24] addToView:self];
[[[[_finalThankYouLabel wtr_topConstraint] toSecondViewTop:self] withConstant:16] addToView:self];
[[[[_finalThankYouLabel wtr_leftConstraint] toSecondViewLeft:self] withConstant:24] addToView:self];
[[[[self wtr_rightConstraint] toSecondViewRight:_finalThankYouLabel] withConstant:24] addToView:self];
}

- (void)setupThankYouButtonConstraints {
[_thankYouButton constraintHeight:50];
[[[_thankYouButton centerX] toSecondViewCenterX:self] addToView:self];
[[[[_thankYouButton left] toSecondViewLeft:self] withConstant:24] addToView:self];
[[[[_thankYouButton right] toSecondViewRight:self] withConstant:-24] addToView:self];
[[[[_thankYouButton top] toSecondViewBottom:_finalThankYouLabel] withConstant:38] addToView:self];
[_thankYouButton wtr_constraintHeight:50];
[[[_thankYouButton wtr_centerXConstraint] toSecondViewCenterX:self] addToView:self];
[[[[_thankYouButton wtr_leftConstraint] toSecondViewLeft:self] withConstant:24] addToView:self];
[[[[_thankYouButton wtr_rightConstraint] toSecondViewRight:self] withConstant:-24] addToView:self];
[[[[_thankYouButton wtr_topConstraint] toSecondViewBottom:_finalThankYouLabel] withConstant:38] addToView:self];
}

- (void)setupNoThanksButtonConstraints {
[[[_noThanksButton centerX] toSecondViewCenterX:self] addToView:self];
[[[[_noThanksButton bottom] toSecondViewBottom:self] withConstant:-8] addToView:self];
[[[_noThanksButton wtr_centerXConstraint] toSecondViewCenterX:self] addToView:self];
[[[[_noThanksButton wtr_bottomConstraint] toSecondViewBottom:self] withConstant:-8] addToView:self];
}

@end

0 comments on commit 50b9292

Please sign in to comment.