Browse Source

Merge pull request #214 from CraigSiemens/layout-guides

Layout guides and iOS 9 support
Jonas Budelmann 10 years ago
parent
commit
d2bd374bcc
100 changed files with 247 additions and 143 deletions
  1. 15 5
      Examples/Masonry iOS Examples.xcodeproj/project.pbxproj
  2. 6 4
      Examples/Masonry iOS Examples.xcodeproj/xcshareddata/xcschemes/Masonry iOS Examples.xcscheme
  3. 15 7
      Examples/Masonry iOS Examples/MASExampleLayoutGuideViewController.m
  4. 12 0
      Masonry.xcodeproj/project.pbxproj
  5. 1 0
      Masonry/MASUtilities.h
  6. 12 2
      Masonry/MASViewAttribute.h
  7. 6 0
      Masonry/MASViewAttribute.m
  8. 9 8
      Masonry/MASViewConstraint.m
  9. 1 0
      Masonry/Masonry.h
  10. 25 0
      Masonry/ViewController+MASAdditions.h
  11. 25 0
      Masonry/ViewController+MASAdditions.m
  12. 6 6
      Podfile.lock
  13. 0 1
      Pods/BuildHeaders/Expecta/EXPBackwardCompatibility.h
  14. 0 1
      Pods/BuildHeaders/Expecta/EXPBlockDefinedMatcher.h
  15. 0 1
      Pods/BuildHeaders/Expecta/EXPDefines.h
  16. 0 1
      Pods/BuildHeaders/Expecta/EXPDoubleTuple.h
  17. 0 1
      Pods/BuildHeaders/Expecta/EXPExpect.h
  18. 0 1
      Pods/BuildHeaders/Expecta/EXPFloatTuple.h
  19. 0 1
      Pods/BuildHeaders/Expecta/EXPMatcher.h
  20. 0 1
      Pods/BuildHeaders/Expecta/EXPMatcherHelpers.h
  21. 0 1
      Pods/BuildHeaders/Expecta/EXPMatchers+beCloseTo.h
  22. 0 1
      Pods/BuildHeaders/Expecta/EXPMatchers+beFalsy.h
  23. 0 1
      Pods/BuildHeaders/Expecta/EXPMatchers+beGreaterThan.h
  24. 0 1
      Pods/BuildHeaders/Expecta/EXPMatchers+beGreaterThanOrEqualTo.h
  25. 0 1
      Pods/BuildHeaders/Expecta/EXPMatchers+beIdenticalTo.h
  26. 0 1
      Pods/BuildHeaders/Expecta/EXPMatchers+beInTheRangeOf.h
  27. 0 1
      Pods/BuildHeaders/Expecta/EXPMatchers+beInstanceOf.h
  28. 0 1
      Pods/BuildHeaders/Expecta/EXPMatchers+beKindOf.h
  29. 0 1
      Pods/BuildHeaders/Expecta/EXPMatchers+beLessThan.h
  30. 0 1
      Pods/BuildHeaders/Expecta/EXPMatchers+beLessThanOrEqualTo.h
  31. 0 1
      Pods/BuildHeaders/Expecta/EXPMatchers+beNil.h
  32. 0 1
      Pods/BuildHeaders/Expecta/EXPMatchers+beSubclassOf.h
  33. 0 1
      Pods/BuildHeaders/Expecta/EXPMatchers+beSupersetOf.h
  34. 0 1
      Pods/BuildHeaders/Expecta/EXPMatchers+beTruthy.h
  35. 0 1
      Pods/BuildHeaders/Expecta/EXPMatchers+beginWith.h
  36. 0 1
      Pods/BuildHeaders/Expecta/EXPMatchers+conformTo.h
  37. 0 1
      Pods/BuildHeaders/Expecta/EXPMatchers+contain.h
  38. 0 1
      Pods/BuildHeaders/Expecta/EXPMatchers+endWith.h
  39. 0 1
      Pods/BuildHeaders/Expecta/EXPMatchers+equal.h
  40. 0 1
      Pods/BuildHeaders/Expecta/EXPMatchers+haveCountOf.h
  41. 0 1
      Pods/BuildHeaders/Expecta/EXPMatchers+notify.h
  42. 0 1
      Pods/BuildHeaders/Expecta/EXPMatchers+raise.h
  43. 0 1
      Pods/BuildHeaders/Expecta/EXPMatchers+raiseWithReason.h
  44. 0 1
      Pods/BuildHeaders/Expecta/EXPMatchers+respondTo.h
  45. 0 1
      Pods/BuildHeaders/Expecta/EXPMatchers.h
  46. 0 1
      Pods/BuildHeaders/Expecta/EXPUnsupportedObject.h
  47. 0 1
      Pods/BuildHeaders/Expecta/Expecta.h
  48. 0 1
      Pods/BuildHeaders/Expecta/ExpectaSupport.h
  49. 0 1
      Pods/BuildHeaders/Expecta/NSObject+Expecta.h
  50. 0 1
      Pods/BuildHeaders/Expecta/NSValue+Expecta.h
  51. 0 1
      Pods/BuildHeaders/Masonry/MASCompositeConstraint.h
  52. 0 1
      Pods/BuildHeaders/Masonry/MASConstraint+Private.h
  53. 0 1
      Pods/BuildHeaders/Masonry/MASConstraint.h
  54. 0 1
      Pods/BuildHeaders/Masonry/MASConstraintMaker.h
  55. 0 1
      Pods/BuildHeaders/Masonry/MASLayoutConstraint.h
  56. 0 1
      Pods/BuildHeaders/Masonry/MASUtilities.h
  57. 0 1
      Pods/BuildHeaders/Masonry/MASViewAttribute.h
  58. 0 1
      Pods/BuildHeaders/Masonry/MASViewConstraint.h
  59. 0 1
      Pods/BuildHeaders/Masonry/Masonry.h
  60. 0 1
      Pods/BuildHeaders/Masonry/NSArray+MASAdditions.h
  61. 0 1
      Pods/BuildHeaders/Masonry/NSArray+MASShorthandAdditions.h
  62. 0 1
      Pods/BuildHeaders/Masonry/NSLayoutConstraint+MASDebugAdditions.h
  63. 0 1
      Pods/BuildHeaders/Masonry/View+MASAdditions.h
  64. 0 1
      Pods/BuildHeaders/Masonry/View+MASShorthandAdditions.h
  65. 0 0
      Pods/Expecta/Expecta/EXPBlockDefinedMatcher.h
  66. 0 0
      Pods/Expecta/Expecta/EXPBlockDefinedMatcher.m
  67. 0 0
      Pods/Expecta/Expecta/EXPDefines.h
  68. 1 1
      Pods/Expecta/Expecta/EXPDoubleTuple.h
  69. 1 1
      Pods/Expecta/Expecta/EXPDoubleTuple.m
  70. 6 3
      Pods/Expecta/Expecta/EXPExpect.h
  71. 19 5
      Pods/Expecta/Expecta/EXPExpect.m
  72. 1 1
      Pods/Expecta/Expecta/EXPFloatTuple.h
  73. 11 1
      Pods/Expecta/Expecta/EXPFloatTuple.m
  74. 0 0
      Pods/Expecta/Expecta/EXPMatcher.h
  75. 1 1
      Pods/Expecta/Expecta/EXPUnsupportedObject.h
  76. 1 1
      Pods/Expecta/Expecta/EXPUnsupportedObject.m
  77. 15 0
      Pods/Expecta/Expecta/Expecta.h
  78. 2 11
      Pods/Expecta/Expecta/ExpectaObject.h
  79. 1 1
      Pods/Expecta/Expecta/ExpectaObject.m
  80. 17 0
      Pods/Expecta/Expecta/ExpectaSupport.h
  81. 20 31
      Pods/Expecta/Expecta/ExpectaSupport.m
  82. 0 0
      Pods/Expecta/Expecta/Matchers/EXPMatcherHelpers.h
  83. 0 0
      Pods/Expecta/Expecta/Matchers/EXPMatcherHelpers.m
  84. 0 0
      Pods/Expecta/Expecta/Matchers/EXPMatchers+beCloseTo.h
  85. 0 0
      Pods/Expecta/Expecta/Matchers/EXPMatchers+beCloseTo.m
  86. 0 0
      Pods/Expecta/Expecta/Matchers/EXPMatchers+beFalsy.h
  87. 0 0
      Pods/Expecta/Expecta/Matchers/EXPMatchers+beFalsy.m
  88. 0 0
      Pods/Expecta/Expecta/Matchers/EXPMatchers+beGreaterThan.h
  89. 0 0
      Pods/Expecta/Expecta/Matchers/EXPMatchers+beGreaterThan.m
  90. 0 0
      Pods/Expecta/Expecta/Matchers/EXPMatchers+beGreaterThanOrEqualTo.h
  91. 0 0
      Pods/Expecta/Expecta/Matchers/EXPMatchers+beGreaterThanOrEqualTo.m
  92. 1 1
      Pods/Expecta/Expecta/Matchers/EXPMatchers+beIdenticalTo.h
  93. 1 1
      Pods/Expecta/Expecta/Matchers/EXPMatchers+beIdenticalTo.m
  94. 0 0
      Pods/Expecta/Expecta/Matchers/EXPMatchers+beInTheRangeOf.h
  95. 0 0
      Pods/Expecta/Expecta/Matchers/EXPMatchers+beInTheRangeOf.m
  96. 6 0
      Pods/Expecta/Expecta/Matchers/EXPMatchers+beInstanceOf.h
  97. 4 0
      Pods/Expecta/Expecta/Matchers/EXPMatchers+beInstanceOf.m
  98. 4 0
      Pods/Expecta/Expecta/Matchers/EXPMatchers+beKindOf.h
  99. 2 0
      Pods/Expecta/Expecta/Matchers/EXPMatchers+beKindOf.m
  100. 0 0
      Pods/Expecta/Expecta/Matchers/EXPMatchers+beLessThan.h

+ 15 - 5
Examples/Masonry iOS Examples.xcodeproj/project.pbxproj

@@ -38,6 +38,7 @@
 		114413081924B6EE008E702E /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = "<group>"; };
 		27A27D441A6CF0C400D34F52 /* MASExampleAspectFitView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MASExampleAspectFitView.h; sourceTree = "<group>"; };
 		27A27D451A6CF0C400D34F52 /* MASExampleAspectFitView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MASExampleAspectFitView.m; sourceTree = "<group>"; };
+		321AA59CF7B045B6D503D2E5 /* Pods-Masonry iOS Examples.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Masonry iOS Examples.release.xcconfig"; path = "../Pods/Target Support Files/Pods-Masonry iOS Examples/Pods-Masonry iOS Examples.release.xcconfig"; sourceTree = "<group>"; };
 		3C02224819D0C4EC00507321 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = "<group>"; };
 		3DB1CAD3184538E200E91FC5 /* MASExampleArrayView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MASExampleArrayView.h; sourceTree = "<group>"; };
 		3DB1CAD4184538E200E91FC5 /* MASExampleArrayView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MASExampleArrayView.m; sourceTree = "<group>"; };
@@ -45,7 +46,7 @@
 		44C0E6AE1A9B9C55003C70CF /* MASExampleMarginView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MASExampleMarginView.m; sourceTree = "<group>"; };
 		4BEB55B41957394E008C862B /* MASExampleRemakeView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MASExampleRemakeView.h; sourceTree = "<group>"; };
 		4BEB55B51957394E008C862B /* MASExampleRemakeView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MASExampleRemakeView.m; sourceTree = "<group>"; };
-		B086DD7D31DD4B49ADC08504 /* Pods-Masonry iOS Examples.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Masonry iOS Examples.xcconfig"; path = "../Pods/Pods-Masonry iOS Examples.xcconfig"; sourceTree = "<group>"; };
+		50B25D0621957AEB87C3FCC2 /* Pods-Masonry iOS Examples.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Masonry iOS Examples.debug.xcconfig"; path = "../Pods/Target Support Files/Pods-Masonry iOS Examples/Pods-Masonry iOS Examples.debug.xcconfig"; sourceTree = "<group>"; };
 		BDC1B8303EED42A2B01B94B1 /* libPods-Masonry iOS Examples.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Masonry iOS Examples.a"; sourceTree = BUILT_PRODUCTS_DIR; };
 		DD175E68182639FB0099129A /* MASExampleUpdateView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MASExampleUpdateView.h; sourceTree = "<group>"; };
 		DD175E69182639FB0099129A /* MASExampleUpdateView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MASExampleUpdateView.m; sourceTree = "<group>"; };
@@ -105,7 +106,7 @@
 				DD52F230179CAD57005CD195 /* Masonry iOS Examples */,
 				DD52F229179CAD57005CD195 /* Frameworks */,
 				DD52F228179CAD57005CD195 /* Products */,
-				B086DD7D31DD4B49ADC08504 /* Pods-Masonry iOS Examples.xcconfig */,
+				DF14AF6879B23556F891E1F7 /* Pods */,
 			);
 			sourceTree = "<group>";
 		};
@@ -198,6 +199,15 @@
 			name = Controllers;
 			sourceTree = "<group>";
 		};
+		DF14AF6879B23556F891E1F7 /* Pods */ = {
+			isa = PBXGroup;
+			children = (
+				50B25D0621957AEB87C3FCC2 /* Pods-Masonry iOS Examples.debug.xcconfig */,
+				321AA59CF7B045B6D503D2E5 /* Pods-Masonry iOS Examples.release.xcconfig */,
+			);
+			name = Pods;
+			sourceTree = "<group>";
+		};
 /* End PBXGroup section */
 
 /* Begin PBXNativeTarget section */
@@ -273,7 +283,7 @@
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 			shellPath = /bin/sh;
-			shellScript = "\"${SRCROOT}/../Pods/Pods-Masonry iOS Examples-resources.sh\"\n";
+			shellScript = "\"${SRCROOT}/../Pods/Target Support Files/Pods-Masonry iOS Examples/Pods-Masonry iOS Examples-resources.sh\"\n";
 			showEnvVarsInLog = 0;
 		};
 		621F6A1FCAEF44F880874959 /* Check Pods Manifest.lock */ = {
@@ -393,7 +403,7 @@
 		};
 		DD52F245179CAD57005CD195 /* Debug */ = {
 			isa = XCBuildConfiguration;
-			baseConfigurationReference = B086DD7D31DD4B49ADC08504 /* Pods-Masonry iOS Examples.xcconfig */;
+			baseConfigurationReference = 50B25D0621957AEB87C3FCC2 /* Pods-Masonry iOS Examples.debug.xcconfig */;
 			buildSettings = {
 				ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
 				GCC_PRECOMPILE_PREFIX_HEADER = YES;
@@ -406,7 +416,7 @@
 		};
 		DD52F246179CAD57005CD195 /* Release */ = {
 			isa = XCBuildConfiguration;
-			baseConfigurationReference = B086DD7D31DD4B49ADC08504 /* Pods-Masonry iOS Examples.xcconfig */;
+			baseConfigurationReference = 321AA59CF7B045B6D503D2E5 /* Pods-Masonry iOS Examples.release.xcconfig */;
 			buildSettings = {
 				ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
 				GCC_PRECOMPILE_PREFIX_HEADER = YES;

+ 6 - 4
Examples/Masonry iOS Examples.xcodeproj/xcshareddata/xcschemes/Masonry iOS Examples.xcscheme

@@ -14,8 +14,8 @@
             buildForAnalyzing = "YES">
             <BuildableReference
                BuildableIdentifier = "primary"
-               BlueprintIdentifier = "DD52F1A9179CA93B005CD195"
-               BuildableName = "libMasonry.a"
+               BlueprintIdentifier = "3AED05B61AD59FD40053CC65"
+               BuildableName = "Masonry.framework"
                BlueprintName = "Masonry iOS"
                ReferencedContainer = "container:../Masonry.xcodeproj">
             </BuildableReference>
@@ -62,7 +62,8 @@
       ignoresPersistentStateOnLaunch = "NO"
       debugDocumentVersioning = "YES"
       allowLocationSimulation = "YES">
-      <BuildableProductRunnable>
+      <BuildableProductRunnable
+         runnableDebuggingMode = "0">
          <BuildableReference
             BuildableIdentifier = "primary"
             BlueprintIdentifier = "DD52F226179CAD57005CD195"
@@ -80,7 +81,8 @@
       useCustomWorkingDirectory = "NO"
       buildConfiguration = "Release"
       debugDocumentVersioning = "YES">
-      <BuildableProductRunnable>
+      <BuildableProductRunnable
+         runnableDebuggingMode = "0">
          <BuildableReference
             BuildableIdentifier = "primary"
             BlueprintIdentifier = "DD52F226179CAD57005CD195"

+ 15 - 7
Examples/Masonry iOS Examples/MASExampleLayoutGuideViewController.m

@@ -34,26 +34,34 @@
     topView.layer.borderWidth = 2;
     [self.view addSubview:topView];
 
+    UIView *topSubview = UIView.new;
+    topSubview.backgroundColor = UIColor.blueColor;
+    topSubview.layer.borderColor = UIColor.blackColor.CGColor;
+    topSubview.layer.borderWidth = 2;
+    [topView addSubview:topSubview];
+    
     UIView *bottomView = UIView.new;
     bottomView.backgroundColor = UIColor.redColor;
     bottomView.layer.borderColor = UIColor.blackColor.CGColor;
     bottomView.layer.borderWidth = 2;
     [self.view addSubview:bottomView];
 
-    // TODO find way that avoids casting
-    // layoutGuides are actually UIView subclasses so can be used in Masonry
-    // However casting to UIView is not ideal if Apple decides to change underlying implementation of layoutGuides this will break
     [topView makeConstraints:^(MASConstraintMaker *make) {
-        UIView *topLayoutGuide = (id)self.topLayoutGuide;
-        make.top.equalTo(topLayoutGuide.bottom);
+        make.top.equalTo(self.mas_topLayoutGuide);
         make.left.equalTo(self.view);
         make.right.equalTo(self.view);
         make.height.equalTo(@40);
     }];
 
+    [topSubview makeConstraints:^(MASConstraintMaker *make) {
+        make.top.equalTo(self.mas_topLayoutGuide);
+        make.centerX.equalTo(@0);
+        make.width.equalTo(@20);
+        make.height.equalTo(@20);
+    }];
+    
     [bottomView makeConstraints:^(MASConstraintMaker *make) {
-        UIView *bottomLayoutGuide = (id)self.bottomLayoutGuide;
-        make.bottom.equalTo(bottomLayoutGuide.top);
+        make.bottom.equalTo(self.mas_bottomLayoutGuide);
         make.left.equalTo(self.view);
         make.right.equalTo(self.view);
         make.height.equalTo(@40);

+ 12 - 0
Masonry.xcodeproj/project.pbxproj

@@ -53,6 +53,10 @@
 		3AED06201AD5A1400053CC65 /* MASCompositeConstraint.h in Headers */ = {isa = PBXBuildFile; fileRef = 3AED05DC1AD5A0470053CC65 /* MASCompositeConstraint.h */; settings = {ATTRIBUTES = (Public, ); }; };
 		3AED06211AD5A1400053CC65 /* NSLayoutConstraint+MASDebugAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 3AED05ED1AD5A0470053CC65 /* NSLayoutConstraint+MASDebugAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; };
 		3AED06221AD5A1400053CC65 /* MASConstraint.h in Headers */ = {isa = PBXBuildFile; fileRef = 3AED05DE1AD5A0470053CC65 /* MASConstraint.h */; settings = {ATTRIBUTES = (Public, ); }; };
+		4473548D1B39F772004DACCB /* ViewController+MASAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 4473548B1B39F772004DACCB /* ViewController+MASAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; };
+		4473548E1B39F772004DACCB /* ViewController+MASAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 4473548C1B39F772004DACCB /* ViewController+MASAdditions.m */; };
+		447354921B3A18B3004DACCB /* ViewController+MASAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 4473548C1B39F772004DACCB /* ViewController+MASAdditions.m */; };
+		447354931B3A18B9004DACCB /* ViewController+MASAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 4473548B1B39F772004DACCB /* ViewController+MASAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; };
 /* End PBXBuildFile section */
 
 /* Begin PBXFileReference section */
@@ -82,6 +86,8 @@
 		3AED05F01AD5A0470053CC65 /* View+MASAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "View+MASAdditions.m"; sourceTree = "<group>"; };
 		3AED05F11AD5A0470053CC65 /* View+MASShorthandAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "View+MASShorthandAdditions.h"; sourceTree = "<group>"; };
 		3AED06271AD5A1400053CC65 /* Masonry.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Masonry.framework; sourceTree = BUILT_PRODUCTS_DIR; };
+		4473548B1B39F772004DACCB /* ViewController+MASAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "ViewController+MASAdditions.h"; sourceTree = "<group>"; };
+		4473548C1B39F772004DACCB /* ViewController+MASAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "ViewController+MASAdditions.m"; sourceTree = "<group>"; };
 /* End PBXFileReference section */
 
 /* Begin PBXFrameworksBuildPhase section */
@@ -127,6 +133,8 @@
 				3AED05EF1AD5A0470053CC65 /* View+MASAdditions.h */,
 				3AED05F01AD5A0470053CC65 /* View+MASAdditions.m */,
 				3AED05F11AD5A0470053CC65 /* View+MASShorthandAdditions.h */,
+				4473548B1B39F772004DACCB /* ViewController+MASAdditions.h */,
+				4473548C1B39F772004DACCB /* ViewController+MASAdditions.m */,
 				3AED05EA1AD5A0470053CC65 /* NSArray+MASAdditions.h */,
 				3AED05EB1AD5A0470053CC65 /* NSArray+MASAdditions.m */,
 				3AED05EC1AD5A0470053CC65 /* NSArray+MASShorthandAdditions.h */,
@@ -167,6 +175,7 @@
 			files = (
 				3AED06051AD5A0470053CC65 /* View+MASAdditions.h in Headers */,
 				3AED06071AD5A0470053CC65 /* View+MASShorthandAdditions.h in Headers */,
+				4473548D1B39F772004DACCB /* ViewController+MASAdditions.h in Headers */,
 				3AED05FC1AD5A0470053CC65 /* MASViewAttribute.h in Headers */,
 				3AED05BD1AD59FD40053CC65 /* Masonry.h in Headers */,
 				3AED05F91AD5A0470053CC65 /* MASLayoutConstraint.h in Headers */,
@@ -197,6 +206,7 @@
 				3AED061E1AD5A1400053CC65 /* MASUtilities.h in Headers */,
 				3AED061F1AD5A1400053CC65 /* NSArray+MASAdditions.h in Headers */,
 				3AED06201AD5A1400053CC65 /* MASCompositeConstraint.h in Headers */,
+				447354931B3A18B9004DACCB /* ViewController+MASAdditions.h in Headers */,
 				3AED06221AD5A1400053CC65 /* MASConstraint.h in Headers */,
 				3AED061D1AD5A1400053CC65 /* MASConstraint+Private.h in Headers */,
 				3AED06211AD5A1400053CC65 /* NSLayoutConstraint+MASDebugAdditions.h in Headers */,
@@ -298,6 +308,7 @@
 			files = (
 				3AED06011AD5A0470053CC65 /* NSArray+MASAdditions.m in Sources */,
 				3AED05FD1AD5A0470053CC65 /* MASViewAttribute.m in Sources */,
+				4473548E1B39F772004DACCB /* ViewController+MASAdditions.m in Sources */,
 				3AED05FA1AD5A0470053CC65 /* MASLayoutConstraint.m in Sources */,
 				3AED05F51AD5A0470053CC65 /* MASConstraint.m in Sources */,
 				3AED05FF1AD5A0470053CC65 /* MASViewConstraint.m in Sources */,
@@ -318,6 +329,7 @@
 				3AED060D1AD5A1400053CC65 /* MASConstraint.m in Sources */,
 				3AED060E1AD5A1400053CC65 /* MASViewConstraint.m in Sources */,
 				3AED060F1AD5A1400053CC65 /* MASCompositeConstraint.m in Sources */,
+				447354921B3A18B3004DACCB /* ViewController+MASAdditions.m in Sources */,
 				3AED06101AD5A1400053CC65 /* MASConstraintMaker.m in Sources */,
 				3AED06111AD5A1400053CC65 /* NSLayoutConstraint+MASDebugAdditions.m in Sources */,
 				3AED06121AD5A1400053CC65 /* View+MASAdditions.m in Sources */,

+ 1 - 0
Masonry/MASUtilities.h

@@ -12,6 +12,7 @@
 
     #import <UIKit/UIKit.h>
     #define MAS_VIEW UIView
+    #define MAS_VIEW_CONTROLLER UIViewController
     #define MASEdgeInsets UIEdgeInsets
 
     typedef UILayoutPriority MASLayoutPriority;

+ 12 - 2
Masonry/MASViewAttribute.h

@@ -15,20 +15,30 @@
 @interface MASViewAttribute : NSObject
 
 /**
- *  The view which the reciever relates to
+ *  The view which the reciever relates to. Can be nil if item is not a view.
  */
 @property (nonatomic, weak, readonly) MAS_VIEW *view;
 
+/**
+ *  The item which the reciever relates to.
+ */
+@property (nonatomic, weak, readonly) id item;
+
 /**
  *  The attribute which the reciever relates to
  */
 @property (nonatomic, assign, readonly) NSLayoutAttribute layoutAttribute;
 
 /**
- *  The designated initializer.
+ *  Convenience initializer.
  */
 - (id)initWithView:(MAS_VIEW *)view layoutAttribute:(NSLayoutAttribute)layoutAttribute;
 
+/**
+ *  The designated initializer.
+ */
+- (id)initWithView:(MAS_VIEW *)view item:(id)item layoutAttribute:(NSLayoutAttribute)layoutAttribute;
+
 /**
  *	Determine whether the layoutAttribute is a size attribute
  *

+ 6 - 0
Masonry/MASViewAttribute.m

@@ -11,10 +11,16 @@
 @implementation MASViewAttribute
 
 - (id)initWithView:(MAS_VIEW *)view layoutAttribute:(NSLayoutAttribute)layoutAttribute {
+    self = [self initWithView:view item:view layoutAttribute:layoutAttribute];
+    return self;
+}
+
+- (id)initWithView:(MAS_VIEW *)view item:(id)item layoutAttribute:(NSLayoutAttribute)layoutAttribute {
     self = [super init];
     if (!self) return nil;
     
     _view = view;
+    _item = item;
     _layoutAttribute = layoutAttribute;
     
     return self;

+ 9 - 8
Masonry/MASViewConstraint.m

@@ -313,17 +313,16 @@ static char kInstalledConstraintsKey;
         return;
     }
     
-    MAS_VIEW *firstLayoutItem = self.firstViewAttribute.view;
-    
+    MAS_VIEW *firstLayoutItem = self.firstViewAttribute.item;
     NSLayoutAttribute firstLayoutAttribute = self.firstViewAttribute.layoutAttribute;
-    MAS_VIEW *secondLayoutItem = self.secondViewAttribute.view;
+    MAS_VIEW *secondLayoutItem = self.secondViewAttribute.item;
     NSLayoutAttribute secondLayoutAttribute = self.secondViewAttribute.layoutAttribute;
 
     // alignment attributes must have a secondViewAttribute
     // therefore we assume that is refering to superview
     // eg make.left.equalTo(@10)
     if (!self.firstViewAttribute.isSizeAttribute && !self.secondViewAttribute) {
-        secondLayoutItem = firstLayoutItem.superview;
+        secondLayoutItem = self.firstViewAttribute.view.superview;
         secondLayoutAttribute = firstLayoutAttribute;
     }
     
@@ -339,14 +338,16 @@ static char kInstalledConstraintsKey;
     layoutConstraint.priority = self.layoutPriority;
     layoutConstraint.mas_key = self.mas_key;
     
-    if (secondLayoutItem) {
-        MAS_VIEW *closestCommonSuperview = [firstLayoutItem mas_closestCommonSuperview:secondLayoutItem];
+    if (self.secondViewAttribute.view) {
+        MAS_VIEW *closestCommonSuperview = [self.firstViewAttribute.view mas_closestCommonSuperview:self.secondViewAttribute.view];
         NSAssert(closestCommonSuperview,
                  @"couldn't find a common superview for %@ and %@",
-                 firstLayoutItem, secondLayoutItem);
+                 self.firstViewAttribute.view, self.secondViewAttribute.view);
         self.installedView = closestCommonSuperview;
+    } else if (self.firstViewAttribute.isSizeAttribute) {
+        self.installedView = self.firstViewAttribute.view;
     } else {
-        self.installedView = firstLayoutItem;
+        self.installedView = self.firstViewAttribute.view.superview;
     }
 
 

+ 1 - 0
Masonry/Masonry.h

@@ -17,6 +17,7 @@ FOUNDATION_EXPORT const unsigned char MasonryVersionString[];
 #import "MASUtilities.h"
 #import "View+MASAdditions.h"
 #import "View+MASShorthandAdditions.h"
+#import "ViewController+MASAdditions.h"
 #import "NSArray+MASAdditions.h"
 #import "NSArray+MASShorthandAdditions.h"
 #import "MASConstraint.h"

+ 25 - 0
Masonry/ViewController+MASAdditions.h

@@ -0,0 +1,25 @@
+//
+//  UIViewController+MASAdditions.h
+//  Masonry
+//
+//  Created by Craig Siemens on 2015-06-23.
+//
+//
+
+#import "MASUtilities.h"
+#import "MASConstraintMaker.h"
+#import "MASViewAttribute.h"
+
+#ifdef MAS_VIEW_CONTROLLER
+
+@interface MAS_VIEW_CONTROLLER (MASAdditions)
+
+/**
+ *	following properties return a new MASViewAttribute with appropriate UILa 8youtGuide and NSLayoutAttribute
+ */
+@property (nonatomic, strong, readonly) MASViewAttribute *mas_topLayoutGuide;
+@property (nonatomic, strong, readonly) MASViewAttribute *mas_bottomLayoutGuide;
+
+@end
+
+#endif

+ 25 - 0
Masonry/ViewController+MASAdditions.m

@@ -0,0 +1,25 @@
+//
+//  UIViewController+MASAdditions.m
+//  Masonry
+//
+//  Created by Craig Siemens on 2015-06-23.
+//
+//
+
+#import "ViewController+MASAdditions.h"
+
+#ifdef MAS_VIEW_CONTROLLER
+
+@implementation MAS_VIEW_CONTROLLER (MASAdditions)
+
+- (MASViewAttribute *)mas_topLayoutGuide {
+    return [[MASViewAttribute alloc] initWithView:self.view item:self.topLayoutGuide layoutAttribute:NSLayoutAttributeBottom];
+}
+
+- (MASViewAttribute *)mas_bottomLayoutGuide {
+    return [[MASViewAttribute alloc] initWithView:self.view item:self.bottomLayoutGuide layoutAttribute:NSLayoutAttributeTop];
+}
+
+@end
+
+#endif

+ 6 - 6
Podfile.lock

@@ -1,6 +1,6 @@
 PODS:
-  - Expecta (0.3.0)
-  - Masonry (0.5.0)
+  - Expecta (1.0.0)
+  - Masonry (0.6.1)
 
 DEPENDENCIES:
   - Expecta
@@ -8,10 +8,10 @@ DEPENDENCIES:
 
 EXTERNAL SOURCES:
   Masonry:
-    :path: ./
+    :path: "./"
 
 SPEC CHECKSUMS:
-  Expecta: 322f1dc42610106a5ba9871b4924cf1635d80833
-  Masonry: bef482b29f00b33a2da916e1011af85f5d371d66
+  Expecta: 32604574add2c46a36f8d2f716b6c5736eb75024
+  Masonry: 4972309f2f134de9dd312f4dc4a21359b50e6caa
 
-COCOAPODS: 0.32.1
+COCOAPODS: 0.37.2

+ 0 - 1
Pods/BuildHeaders/Expecta/EXPBackwardCompatibility.h

@@ -1 +0,0 @@
-../../Expecta/src/EXPBackwardCompatibility.h

+ 0 - 1
Pods/BuildHeaders/Expecta/EXPBlockDefinedMatcher.h

@@ -1 +0,0 @@
-../../Expecta/src/EXPBlockDefinedMatcher.h

+ 0 - 1
Pods/BuildHeaders/Expecta/EXPDefines.h

@@ -1 +0,0 @@
-../../Expecta/src/EXPDefines.h

+ 0 - 1
Pods/BuildHeaders/Expecta/EXPDoubleTuple.h

@@ -1 +0,0 @@
-../../Expecta/src/EXPDoubleTuple.h

+ 0 - 1
Pods/BuildHeaders/Expecta/EXPExpect.h

@@ -1 +0,0 @@
-../../Expecta/src/EXPExpect.h

+ 0 - 1
Pods/BuildHeaders/Expecta/EXPFloatTuple.h

@@ -1 +0,0 @@
-../../Expecta/src/EXPFloatTuple.h

+ 0 - 1
Pods/BuildHeaders/Expecta/EXPMatcher.h

@@ -1 +0,0 @@
-../../Expecta/src/EXPMatcher.h

+ 0 - 1
Pods/BuildHeaders/Expecta/EXPMatcherHelpers.h

@@ -1 +0,0 @@
-../../Expecta/src/matchers/EXPMatcherHelpers.h

+ 0 - 1
Pods/BuildHeaders/Expecta/EXPMatchers+beCloseTo.h

@@ -1 +0,0 @@
-../../Expecta/src/matchers/EXPMatchers+beCloseTo.h

+ 0 - 1
Pods/BuildHeaders/Expecta/EXPMatchers+beFalsy.h

@@ -1 +0,0 @@
-../../Expecta/src/matchers/EXPMatchers+beFalsy.h

+ 0 - 1
Pods/BuildHeaders/Expecta/EXPMatchers+beGreaterThan.h

@@ -1 +0,0 @@
-../../Expecta/src/matchers/EXPMatchers+beGreaterThan.h

+ 0 - 1
Pods/BuildHeaders/Expecta/EXPMatchers+beGreaterThanOrEqualTo.h

@@ -1 +0,0 @@
-../../Expecta/src/matchers/EXPMatchers+beGreaterThanOrEqualTo.h

+ 0 - 1
Pods/BuildHeaders/Expecta/EXPMatchers+beIdenticalTo.h

@@ -1 +0,0 @@
-../../Expecta/src/matchers/EXPMatchers+beIdenticalTo.h

+ 0 - 1
Pods/BuildHeaders/Expecta/EXPMatchers+beInTheRangeOf.h

@@ -1 +0,0 @@
-../../Expecta/src/matchers/EXPMatchers+beInTheRangeOf.h

+ 0 - 1
Pods/BuildHeaders/Expecta/EXPMatchers+beInstanceOf.h

@@ -1 +0,0 @@
-../../Expecta/src/matchers/EXPMatchers+beInstanceOf.h

+ 0 - 1
Pods/BuildHeaders/Expecta/EXPMatchers+beKindOf.h

@@ -1 +0,0 @@
-../../Expecta/src/matchers/EXPMatchers+beKindOf.h

+ 0 - 1
Pods/BuildHeaders/Expecta/EXPMatchers+beLessThan.h

@@ -1 +0,0 @@
-../../Expecta/src/matchers/EXPMatchers+beLessThan.h

+ 0 - 1
Pods/BuildHeaders/Expecta/EXPMatchers+beLessThanOrEqualTo.h

@@ -1 +0,0 @@
-../../Expecta/src/matchers/EXPMatchers+beLessThanOrEqualTo.h

+ 0 - 1
Pods/BuildHeaders/Expecta/EXPMatchers+beNil.h

@@ -1 +0,0 @@
-../../Expecta/src/matchers/EXPMatchers+beNil.h

+ 0 - 1
Pods/BuildHeaders/Expecta/EXPMatchers+beSubclassOf.h

@@ -1 +0,0 @@
-../../Expecta/src/matchers/EXPMatchers+beSubclassOf.h

+ 0 - 1
Pods/BuildHeaders/Expecta/EXPMatchers+beSupersetOf.h

@@ -1 +0,0 @@
-../../Expecta/src/matchers/EXPMatchers+beSupersetOf.h

+ 0 - 1
Pods/BuildHeaders/Expecta/EXPMatchers+beTruthy.h

@@ -1 +0,0 @@
-../../Expecta/src/matchers/EXPMatchers+beTruthy.h

+ 0 - 1
Pods/BuildHeaders/Expecta/EXPMatchers+beginWith.h

@@ -1 +0,0 @@
-../../Expecta/src/matchers/EXPMatchers+beginWith.h

+ 0 - 1
Pods/BuildHeaders/Expecta/EXPMatchers+conformTo.h

@@ -1 +0,0 @@
-../../Expecta/src/matchers/EXPMatchers+conformTo.h

+ 0 - 1
Pods/BuildHeaders/Expecta/EXPMatchers+contain.h

@@ -1 +0,0 @@
-../../Expecta/src/matchers/EXPMatchers+contain.h

+ 0 - 1
Pods/BuildHeaders/Expecta/EXPMatchers+endWith.h

@@ -1 +0,0 @@
-../../Expecta/src/matchers/EXPMatchers+endWith.h

+ 0 - 1
Pods/BuildHeaders/Expecta/EXPMatchers+equal.h

@@ -1 +0,0 @@
-../../Expecta/src/matchers/EXPMatchers+equal.h

+ 0 - 1
Pods/BuildHeaders/Expecta/EXPMatchers+haveCountOf.h

@@ -1 +0,0 @@
-../../Expecta/src/matchers/EXPMatchers+haveCountOf.h

+ 0 - 1
Pods/BuildHeaders/Expecta/EXPMatchers+notify.h

@@ -1 +0,0 @@
-../../Expecta/src/matchers/EXPMatchers+notify.h

+ 0 - 1
Pods/BuildHeaders/Expecta/EXPMatchers+raise.h

@@ -1 +0,0 @@
-../../Expecta/src/matchers/EXPMatchers+raise.h

+ 0 - 1
Pods/BuildHeaders/Expecta/EXPMatchers+raiseWithReason.h

@@ -1 +0,0 @@
-../../Expecta/src/matchers/EXPMatchers+raiseWithReason.h

+ 0 - 1
Pods/BuildHeaders/Expecta/EXPMatchers+respondTo.h

@@ -1 +0,0 @@
-../../Expecta/src/matchers/EXPMatchers+respondTo.h

+ 0 - 1
Pods/BuildHeaders/Expecta/EXPMatchers.h

@@ -1 +0,0 @@
-../../Expecta/src/matchers/EXPMatchers.h

+ 0 - 1
Pods/BuildHeaders/Expecta/EXPUnsupportedObject.h

@@ -1 +0,0 @@
-../../Expecta/src/EXPUnsupportedObject.h

+ 0 - 1
Pods/BuildHeaders/Expecta/Expecta.h

@@ -1 +0,0 @@
-../../Expecta/src/Expecta.h

+ 0 - 1
Pods/BuildHeaders/Expecta/ExpectaSupport.h

@@ -1 +0,0 @@
-../../Expecta/src/ExpectaSupport.h

+ 0 - 1
Pods/BuildHeaders/Expecta/NSObject+Expecta.h

@@ -1 +0,0 @@
-../../Expecta/src/NSObject+Expecta.h

+ 0 - 1
Pods/BuildHeaders/Expecta/NSValue+Expecta.h

@@ -1 +0,0 @@
-../../Expecta/src/NSValue+Expecta.h

+ 0 - 1
Pods/BuildHeaders/Masonry/MASCompositeConstraint.h

@@ -1 +0,0 @@
-../../../Masonry/MASCompositeConstraint.h

+ 0 - 1
Pods/BuildHeaders/Masonry/MASConstraint+Private.h

@@ -1 +0,0 @@
-../../../Masonry/MASConstraint+Private.h

+ 0 - 1
Pods/BuildHeaders/Masonry/MASConstraint.h

@@ -1 +0,0 @@
-../../../Masonry/MASConstraint.h

+ 0 - 1
Pods/BuildHeaders/Masonry/MASConstraintMaker.h

@@ -1 +0,0 @@
-../../../Masonry/MASConstraintMaker.h

+ 0 - 1
Pods/BuildHeaders/Masonry/MASLayoutConstraint.h

@@ -1 +0,0 @@
-../../../Masonry/MASLayoutConstraint.h

+ 0 - 1
Pods/BuildHeaders/Masonry/MASUtilities.h

@@ -1 +0,0 @@
-../../../Masonry/MASUtilities.h

+ 0 - 1
Pods/BuildHeaders/Masonry/MASViewAttribute.h

@@ -1 +0,0 @@
-../../../Masonry/MASViewAttribute.h

+ 0 - 1
Pods/BuildHeaders/Masonry/MASViewConstraint.h

@@ -1 +0,0 @@
-../../../Masonry/MASViewConstraint.h

+ 0 - 1
Pods/BuildHeaders/Masonry/Masonry.h

@@ -1 +0,0 @@
-../../../Masonry/Masonry.h

+ 0 - 1
Pods/BuildHeaders/Masonry/NSArray+MASAdditions.h

@@ -1 +0,0 @@
-../../../Masonry/NSArray+MASAdditions.h

+ 0 - 1
Pods/BuildHeaders/Masonry/NSArray+MASShorthandAdditions.h

@@ -1 +0,0 @@
-../../../Masonry/NSArray+MASShorthandAdditions.h

+ 0 - 1
Pods/BuildHeaders/Masonry/NSLayoutConstraint+MASDebugAdditions.h

@@ -1 +0,0 @@
-../../../Masonry/NSLayoutConstraint+MASDebugAdditions.h

+ 0 - 1
Pods/BuildHeaders/Masonry/View+MASAdditions.h

@@ -1 +0,0 @@
-../../../Masonry/View+MASAdditions.h

+ 0 - 1
Pods/BuildHeaders/Masonry/View+MASShorthandAdditions.h

@@ -1 +0,0 @@
-../../../Masonry/View+MASShorthandAdditions.h

+ 0 - 0
Pods/Expecta/src/EXPBlockDefinedMatcher.h → Pods/Expecta/Expecta/EXPBlockDefinedMatcher.h


+ 0 - 0
Pods/Expecta/src/EXPBlockDefinedMatcher.m → Pods/Expecta/Expecta/EXPBlockDefinedMatcher.m


+ 0 - 0
Pods/Expecta/src/EXPDefines.h → Pods/Expecta/Expecta/EXPDefines.h


+ 1 - 1
Pods/Expecta/src/EXPDoubleTuple.h → Pods/Expecta/Expecta/EXPDoubleTuple.h

@@ -8,6 +8,6 @@
 @property (nonatomic, assign) double *values;
 @property (nonatomic, assign) size_t size;
 
-- (id)initWithDoubleValues:(double *)values size:(size_t)size;
+- (instancetype)initWithDoubleValues:(double *)values size:(size_t)size NS_DESIGNATED_INITIALIZER;
 
 @end

+ 1 - 1
Pods/Expecta/src/EXPDoubleTuple.m → Pods/Expecta/Expecta/EXPDoubleTuple.m

@@ -4,7 +4,7 @@
 
 @synthesize values = _values, size = _size;
 
-- (id)initWithDoubleValues:(double *)values size:(size_t)size {
+- (instancetype)initWithDoubleValues:(double *)values size:(size_t)size {
     if ((self = [super init])) {
         self.values = malloc(sizeof(double) * size);
         memcpy(self.values, values, sizeof(double) * size);

+ 6 - 3
Pods/Expecta/src/EXPExpect.h → Pods/Expecta/Expecta/EXPExpect.h

@@ -9,6 +9,7 @@
   char *_fileName;
   BOOL _negative;
   BOOL _asynchronous;
+  NSTimeInterval _timeout;
 }
 
 @property(nonatomic, copy) EXPIdBlock actualBlock;
@@ -18,14 +19,16 @@
 @property(nonatomic) const char *fileName;
 @property(nonatomic) BOOL negative;
 @property(nonatomic) BOOL asynchronous;
+@property(nonatomic) NSTimeInterval timeout;
 
 @property(nonatomic, readonly) EXPExpect *to;
 @property(nonatomic, readonly) EXPExpect *toNot;
 @property(nonatomic, readonly) EXPExpect *notTo;
 @property(nonatomic, readonly) EXPExpect *will;
 @property(nonatomic, readonly) EXPExpect *willNot;
+@property(nonatomic, readonly) EXPExpect *(^after)(NSTimeInterval timeInterval);
 
-- (id)initWithActualBlock:(id)actualBlock testCase:(id)testCase lineNumber:(int)lineNumber fileName:(const char *)fileName;
+- (instancetype)initWithActualBlock:(id)actualBlock testCase:(id)testCase lineNumber:(int)lineNumber fileName:(const char *)fileName NS_DESIGNATED_INITIALIZER;
 + (EXPExpect *)expectWithActualBlock:(id)actualBlock testCase:(id)testCase lineNumber:(int)lineNumber fileName:(const char *)fileName;
 
 - (void)applyMatcher:(id<EXPMatcher>)matcher;
@@ -37,6 +40,6 @@
   EXPExpect *_expectation;
   SEL _selector;
 }
-- (id)initWithExpectation:(EXPExpect *)expectation selector:(SEL)selector;
-- (void (^)(void))dispatch;
+- (instancetype)initWithExpectation:(EXPExpect *)expectation selector:(SEL)selector NS_DESIGNATED_INITIALIZER;
+@property (nonatomic, readonly, copy) void (^dispatch)(void);
 @end

+ 19 - 5
Pods/Expecta/src/EXPExpect.m → Pods/Expecta/Expecta/EXPExpect.m

@@ -14,23 +14,26 @@
   toNot,
   notTo,
   will,
-  willNot;
+  willNot,
+  after;
 
 @synthesize
   actualBlock=_actualBlock,
   testCase=_testCase,
   negative=_negative,
   asynchronous=_asynchronous,
+  timeout=_timeout,
   lineNumber=_lineNumber,
   fileName=_fileName;
 
-- (id)initWithActualBlock:(id)actualBlock testCase:(id)testCase lineNumber:(int)lineNumber fileName:(const char *)fileName {
+- (instancetype)initWithActualBlock:(id)actualBlock testCase:(id)testCase lineNumber:(int)lineNumber fileName:(const char *)fileName {
   self = [super init];
   if(self) {
     self.actualBlock = actualBlock;
     self.testCase = testCase;
     self.negative = NO;
     self.asynchronous = NO;
+    self.timeout = [Expecta asynchronousTestTimeout];
     self.lineNumber = lineNumber;
     self.fileName = fileName;
   }
@@ -39,7 +42,7 @@
 
 - (void)dealloc
 {
-  self.actualBlock = nil;
+  _actualBlock = nil;
   [super dealloc];
 }
 
@@ -71,6 +74,17 @@
   return self.will.toNot;
 }
 
+- (EXPExpect *(^)(NSTimeInterval))after
+{
+  EXPExpect * (^block)(NSTimeInterval) = [^EXPExpect *(NSTimeInterval timeout) {
+    self.asynchronous = YES;
+    self.timeout = timeout;
+    return self;
+  } copy];
+
+  return [block autorelease];
+}
+
 #pragma mark -
 
 - (id)actual {
@@ -98,7 +112,7 @@
     } else {
       BOOL matchResult = NO;
       if(self.asynchronous) {
-        NSTimeInterval timeOut = [Expecta asynchronousTestTimeout];
+        NSTimeInterval timeOut = self.timeout;
         NSDate *expiryDate = [NSDate dateWithTimeIntervalSinceNow:timeOut];
         while(1) {
           matchResult = [matcher matches:*actual];
@@ -164,7 +178,7 @@
 
 @implementation EXPDynamicPredicateMatcher
 
-- (id)initWithExpectation:(EXPExpect *)expectation selector:(SEL)selector
+- (instancetype)initWithExpectation:(EXPExpect *)expectation selector:(SEL)selector
 {
   if ((self = [super init])) {
     _expectation = expectation;

+ 1 - 1
Pods/Expecta/src/EXPFloatTuple.h → Pods/Expecta/Expecta/EXPFloatTuple.h

@@ -8,6 +8,6 @@
 @property (nonatomic, assign) float *values;
 @property (nonatomic, assign) size_t size;
 
-- (id)initWithFloatValues:(float *)values size:(size_t)size;
+- (instancetype)initWithFloatValues:(float *)values size:(size_t)size NS_DESIGNATED_INITIALIZER;
 
 @end

+ 11 - 1
Pods/Expecta/src/EXPFloatTuple.m → Pods/Expecta/Expecta/EXPFloatTuple.m

@@ -4,7 +4,7 @@
 
 @synthesize values = _values, size = _size;
 
-- (id)initWithFloatValues:(float *)values size:(size_t)size {
+- (instancetype)initWithFloatValues:(float *)values size:(size_t)size {
     if ((self = [super init])) {
         self.values = malloc(sizeof(float) * size);
         memcpy(self.values, values, sizeof(float) * size);
@@ -30,6 +30,16 @@
     return NO;
 }
 
+- (NSUInteger)hash
+{
+    NSUInteger prime = 31;
+    NSUInteger hash = 0;
+    for (int i=0; i<self.size; i++) {
+        hash = prime * hash + (NSUInteger)self.values[i];
+    }
+    return hash;
+}
+
 - (NSString *)description {
     if (self.size == 2) {
         return [NSString stringWithFormat:@"Float tuple: {%f, %f}", self.values[0], self.values[1]];

+ 0 - 0
Pods/Expecta/src/EXPMatcher.h → Pods/Expecta/Expecta/EXPMatcher.h


+ 1 - 1
Pods/Expecta/src/EXPUnsupportedObject.h → Pods/Expecta/Expecta/EXPUnsupportedObject.h

@@ -6,6 +6,6 @@
 
 @property (nonatomic, retain) NSString *type;
 
-- (id)initWithType:(NSString *)type;
+- (instancetype)initWithType:(NSString *)type NS_DESIGNATED_INITIALIZER;
 
 @end

+ 1 - 1
Pods/Expecta/src/EXPUnsupportedObject.m → Pods/Expecta/Expecta/EXPUnsupportedObject.m

@@ -4,7 +4,7 @@
 
 @synthesize type=_type;
 
-- (id)initWithType:(NSString *)type {
+- (instancetype)initWithType:(NSString *)type {
   self = [super init];
   if(self) {
     self.type = type;

+ 15 - 0
Pods/Expecta/Expecta/Expecta.h

@@ -0,0 +1,15 @@
+#import <Foundation/Foundation.h>
+
+//! Project version number for Expecta.
+FOUNDATION_EXPORT double ExpectaVersionNumber;
+
+//! Project version string for Expecta.
+FOUNDATION_EXPORT const unsigned char ExpectaVersionString[];
+
+#import <Expecta/ExpectaObject.h>
+#import <Expecta/ExpectaSupport.h>
+#import <Expecta/EXPMatchers.h>
+
+// Enable shorthand by default
+#define expect(...) EXP_expect((__VA_ARGS__))
+#define failure(...) EXP_failure((__VA_ARGS__))

+ 2 - 11
Pods/Expecta/src/Expecta.h → Pods/Expecta/Expecta/ExpectaObject.h

@@ -1,23 +1,14 @@
 #import <Foundation/Foundation.h>
-#import "ExpectaSupport.h"
 
 #define EXPObjectify(value) _EXPObjectify(@encode(__typeof__((value))), (value))
-
 #define EXP_expect(actual) _EXP_expect(self, __LINE__, __FILE__, ^id{ return EXPObjectify((actual)); })
-
 #define EXPMatcherInterface(matcherName, matcherArguments) _EXPMatcherInterface(matcherName, matcherArguments)
 #define EXPMatcherImplementationBegin(matcherName, matcherArguments) _EXPMatcherImplementationBegin(matcherName, matcherArguments)
 #define EXPMatcherImplementationEnd _EXPMatcherImplementationEnd
+#define EXPMatcherAliasImplementation(newMatcherName, oldMatcherName, matcherArguments) _EXPMatcherAliasImplementation(newMatcherName, oldMatcherName, matcherArguments)
 
-#import "EXPMatchers.h"
-
-#ifdef EXP_SHORTHAND
-#  define expect(actual) EXP_expect((actual))
-#endif
+#define EXP_failure(message) EXPFail(self, __LINE__, __FILE__, message)
 
-#ifdef EXP_OLD_SYNTAX
-#  import "EXPBackwardCompatibility.h"
-#endif
 
 @interface Expecta : NSObject
 

+ 1 - 1
Pods/Expecta/src/Expecta.m → Pods/Expecta/Expecta/ExpectaObject.m

@@ -1,4 +1,4 @@
-#import "Expecta.h"
+#import "ExpectaObject.h"
 
 @implementation Expecta
 

+ 17 - 0
Pods/Expecta/src/ExpectaSupport.h → Pods/Expecta/Expecta/ExpectaSupport.h

@@ -1,6 +1,10 @@
 #import "EXPExpect.h"
 #import "EXPBlockDefinedMatcher.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 id _EXPObjectify(const char *type, ...);
 EXPExpect *_EXP_expect(id testCase, int lineNumber, const char *fileName, EXPIdBlock actualBlock);
 
@@ -54,3 +58,16 @@ EXPFixCategoriesBug(EXPMatcher##matcherName##Matcher); \
   return _EXP_autorelease(matcherBlock); \
 } \
 @end
+
+#define _EXPMatcherAliasImplementation(newMatcherName, oldMatcherName, matcherArguments) \
+EXPFixCategoriesBug(EXPMatcher##newMatcherName##Matcher); \
+@implementation EXPExpect (newMatcherName##Matcher) \
+@dynamic newMatcherName;\
+- (void(^) matcherArguments) newMatcherName { \
+  return [self oldMatcherName]; \
+}\
+@end
+
+#ifdef __cplusplus
+}
+#endif

+ 20 - 31
Pods/Expecta/src/ExpectaSupport.m → Pods/Expecta/Expecta/ExpectaSupport.m

@@ -7,12 +7,6 @@
 #import "EXPDefines.h"
 #import <objc/runtime.h>
 
-@interface NSException (ExpectaSenTestFailure)
-
-+ (NSException *)failureInFile:(NSString *)filename atLine:(int)lineNumber withDescription:(NSString *)formatString, ...;
-
-@end
-
 @interface NSObject (ExpectaXCTestRecordFailure)
 
 // suppress warning
@@ -26,44 +20,44 @@ id _EXPObjectify(const char *type, ...) {
   id obj = nil;
   if(strcmp(type, @encode(char)) == 0) {
     char actual = (char)va_arg(v, int);
-    obj = [NSNumber numberWithChar:actual];
+    obj = @(actual);
   } else if(strcmp(type, @encode(_Bool)) == 0) {
     _Static_assert(sizeof(_Bool) <= sizeof(int), "Expected _Bool to be subject to vararg type promotion");
     _Bool actual = (_Bool)va_arg(v, int);
-    obj = [NSNumber numberWithBool:actual];
+    obj = @(actual);
   } else if(strcmp(type, @encode(double)) == 0) {
     double actual = (double)va_arg(v, double);
-    obj = [NSNumber numberWithDouble:actual];
+    obj = @(actual);
   } else if(strcmp(type, @encode(float)) == 0) {
     float actual = (float)va_arg(v, double);
-    obj = [NSNumber numberWithFloat:actual];
+    obj = @(actual);
   } else if(strcmp(type, @encode(int)) == 0) {
     int actual = (int)va_arg(v, int);
-    obj = [NSNumber numberWithInt:actual];
+    obj = @(actual);
   } else if(strcmp(type, @encode(long)) == 0) {
     long actual = (long)va_arg(v, long);
-    obj = [NSNumber numberWithLong:actual];
+    obj = @(actual);
   } else if(strcmp(type, @encode(long long)) == 0) {
     long long actual = (long long)va_arg(v, long long);
-    obj = [NSNumber numberWithLongLong:actual];
+    obj = @(actual);
   } else if(strcmp(type, @encode(short)) == 0) {
     short actual = (short)va_arg(v, int);
-    obj = [NSNumber numberWithShort:actual];
+    obj = @(actual);
   } else if(strcmp(type, @encode(unsigned char)) == 0) {
     unsigned char actual = (unsigned char)va_arg(v, unsigned int);
-    obj = [NSNumber numberWithUnsignedChar:actual];
+    obj = @(actual);
   } else if(strcmp(type, @encode(unsigned int)) == 0) {
     unsigned int actual = (int)va_arg(v, unsigned int);
-    obj = [NSNumber numberWithUnsignedInt:actual];
+    obj = @(actual);
   } else if(strcmp(type, @encode(unsigned long)) == 0) {
     unsigned long actual = (unsigned long)va_arg(v, unsigned long);
-    obj = [NSNumber numberWithUnsignedLong:actual];
+    obj = @(actual);
   } else if(strcmp(type, @encode(unsigned long long)) == 0) {
     unsigned long long actual = (unsigned long long)va_arg(v, unsigned long long);
-    obj = [NSNumber numberWithUnsignedLongLong:actual];
+    obj = @(actual);
   } else if(strcmp(type, @encode(unsigned short)) == 0) {
     unsigned short actual = (unsigned short)va_arg(v, unsigned int);
-    obj = [NSNumber numberWithUnsignedShort:actual];
+    obj = @(actual);
   } else if(strstr(type, @encode(EXPBasicBlock)) != NULL) {
       // @encode(EXPBasicBlock) returns @? as of clang 4.1.
       // This condition must occur before the test for id/class type,
@@ -113,14 +107,9 @@ void EXPFail(id testCase, int lineNumber, const char *fileName, NSString *messag
   NSString *reason = [NSString stringWithFormat:@"%s:%d %@", fileName, lineNumber, message];
   NSException *exception = [NSException exceptionWithName:@"Expecta Error" reason:reason userInfo:nil];
 
-  if(testCase && [testCase respondsToSelector:@selector(failWithException:)]) {
-    if([[(Class)objc_getMetaClass("NSException") class] instancesRespondToSelector:@selector(failureInFile:atLine:withDescription:)]) {
-      exception = [NSException failureInFile:[NSString stringWithUTF8String:fileName] atLine:lineNumber withDescription:message];
-    }
-    [testCase failWithException:exception];
-  } else if(testCase && [testCase respondsToSelector:@selector(recordFailureWithDescription:inFile:atLine:expected:)]){
+  if(testCase && [testCase respondsToSelector:@selector(recordFailureWithDescription:inFile:atLine:expected:)]){
       [testCase recordFailureWithDescription:message
-                                      inFile:[NSString stringWithUTF8String:fileName]
+                                      inFile:@(fileName)
                                       atLine:lineNumber
                                     expected:NO];
   } else {
@@ -157,7 +146,7 @@ NSString *EXPDescribeObject(id obj) {
   } else if([obj isKindOfClass:[NSDictionary class]]) {
     NSMutableArray *arr = [NSMutableArray arrayWithCapacity:[obj count]];
     for(id k in obj) {
-      id v = [obj objectForKey:k];
+      id v = obj[k];
       [arr addObject:[NSString stringWithFormat:@"%@ = %@;",EXPDescribeObject(k), EXPDescribeObject(v)]];
     }
     description = [NSString stringWithFormat:@"{%@}", [arr componentsJoinedByString:@" "]];
@@ -170,18 +159,18 @@ NSString *EXPDescribeObject(id obj) {
 }
 
 void EXP_prerequisite(EXPBoolBlock block) {
-  [[[[NSThread currentThread] threadDictionary] objectForKey:@"EXP_currentMatcher"] setPrerequisiteBlock:block];
+  [[[NSThread currentThread] threadDictionary][@"EXP_currentMatcher"] setPrerequisiteBlock:block];
 }
 
 void EXP_match(EXPBoolBlock block) {
-  [[[[NSThread currentThread] threadDictionary] objectForKey:@"EXP_currentMatcher"] setMatchBlock:block];
+  [[[NSThread currentThread] threadDictionary][@"EXP_currentMatcher"] setMatchBlock:block];
 }
 
 void EXP_failureMessageForTo(EXPStringBlock block) {
-  [[[[NSThread currentThread] threadDictionary] objectForKey:@"EXP_currentMatcher"] setFailureMessageForToBlock:block];
+  [[[NSThread currentThread] threadDictionary][@"EXP_currentMatcher"] setFailureMessageForToBlock:block];
 }
 
 void EXP_failureMessageForNotTo(EXPStringBlock block) {
-  [[[[NSThread currentThread] threadDictionary] objectForKey:@"EXP_currentMatcher"] setFailureMessageForNotToBlock:block];
+  [[[NSThread currentThread] threadDictionary][@"EXP_currentMatcher"] setFailureMessageForNotToBlock:block];
 }
 

+ 0 - 0
Pods/Expecta/src/matchers/EXPMatcherHelpers.h → Pods/Expecta/Expecta/Matchers/EXPMatcherHelpers.h


+ 0 - 0
Pods/Expecta/src/matchers/EXPMatcherHelpers.m → Pods/Expecta/Expecta/Matchers/EXPMatcherHelpers.m


+ 0 - 0
Pods/Expecta/src/matchers/EXPMatchers+beCloseTo.h → Pods/Expecta/Expecta/Matchers/EXPMatchers+beCloseTo.h


+ 0 - 0
Pods/Expecta/src/matchers/EXPMatchers+beCloseTo.m → Pods/Expecta/Expecta/Matchers/EXPMatchers+beCloseTo.m


+ 0 - 0
Pods/Expecta/src/matchers/EXPMatchers+beFalsy.h → Pods/Expecta/Expecta/Matchers/EXPMatchers+beFalsy.h


+ 0 - 0
Pods/Expecta/src/matchers/EXPMatchers+beFalsy.m → Pods/Expecta/Expecta/Matchers/EXPMatchers+beFalsy.m


+ 0 - 0
Pods/Expecta/src/matchers/EXPMatchers+beGreaterThan.h → Pods/Expecta/Expecta/Matchers/EXPMatchers+beGreaterThan.h


+ 0 - 0
Pods/Expecta/src/matchers/EXPMatchers+beGreaterThan.m → Pods/Expecta/Expecta/Matchers/EXPMatchers+beGreaterThan.m


+ 0 - 0
Pods/Expecta/src/matchers/EXPMatchers+beGreaterThanOrEqualTo.h → Pods/Expecta/Expecta/Matchers/EXPMatchers+beGreaterThanOrEqualTo.h


+ 0 - 0
Pods/Expecta/src/matchers/EXPMatchers+beGreaterThanOrEqualTo.m → Pods/Expecta/Expecta/Matchers/EXPMatchers+beGreaterThanOrEqualTo.m


+ 1 - 1
Pods/Expecta/src/matchers/EXPMatchers+beIdenticalTo.h → Pods/Expecta/Expecta/Matchers/EXPMatchers+beIdenticalTo.h

@@ -6,5 +6,5 @@ EXPMatcherInterface(beIdenticalTo, (void *expected)); // to aid code completion
 #if __has_feature(objc_arc)
 #define beIdenticalTo(expected) _beIdenticalTo((__bridge void*)expected)
 #else
-#define beIdenticalTo _beIdenticalTo
+#define beIdenticalTo(expected) _beIdenticalTo(expected)
 #endif

+ 1 - 1
Pods/Expecta/src/matchers/EXPMatchers+beIdenticalTo.m → Pods/Expecta/Expecta/Matchers/EXPMatchers+beIdenticalTo.m

@@ -1,7 +1,7 @@
 #import "EXPMatchers+equal.h"
 #import "EXPMatcherHelpers.h"
 
-EXPMatcherImplementationBegin(beIdenticalTo, (void *expected)) {
+EXPMatcherImplementationBegin(_beIdenticalTo, (void *expected)) {
   match(^BOOL{
     if(actual == expected) {
       return YES;

+ 0 - 0
Pods/Expecta/src/matchers/EXPMatchers+beInTheRangeOf.h → Pods/Expecta/Expecta/Matchers/EXPMatchers+beInTheRangeOf.h


+ 0 - 0
Pods/Expecta/src/matchers/EXPMatchers+beInTheRangeOf.m → Pods/Expecta/Expecta/Matchers/EXPMatchers+beInTheRangeOf.m


+ 6 - 0
Pods/Expecta/Expecta/Matchers/EXPMatchers+beInstanceOf.h

@@ -0,0 +1,6 @@
+#import "Expecta.h"
+
+EXPMatcherInterface(beInstanceOf,   (Class expected));
+EXPMatcherInterface(beAnInstanceOf, (Class expected));
+EXPMatcherInterface(beMemberOf,     (Class expected));
+EXPMatcherInterface(beAMemberOf,    (Class expected));

+ 4 - 0
Pods/Expecta/src/matchers/EXPMatchers+beInstanceOf.m → Pods/Expecta/Expecta/Matchers/EXPMatchers+beInstanceOf.m

@@ -25,3 +25,7 @@ EXPMatcherImplementationBegin(beInstanceOf, (Class expected)) {
   });
 }
 EXPMatcherImplementationEnd
+
+EXPMatcherAliasImplementation(beAnInstanceOf, beInstanceOf, (Class expected));
+EXPMatcherAliasImplementation(beMemberOf,     beInstanceOf, (Class expected));
+EXPMatcherAliasImplementation(beAMemberOf,    beInstanceOf, (Class expected));

+ 4 - 0
Pods/Expecta/Expecta/Matchers/EXPMatchers+beKindOf.h

@@ -0,0 +1,4 @@
+#import "Expecta.h"
+
+EXPMatcherInterface(beKindOf,  (Class expected));
+EXPMatcherInterface(beAKindOf, (Class expected));

+ 2 - 0
Pods/Expecta/src/matchers/EXPMatchers+beKindOf.m → Pods/Expecta/Expecta/Matchers/EXPMatchers+beKindOf.m

@@ -25,3 +25,5 @@ EXPMatcherImplementationBegin(beKindOf, (Class expected)) {
   });
 }
 EXPMatcherImplementationEnd
+
+EXPMatcherAliasImplementation(beAKindOf, beKindOf, (Class expected));

+ 0 - 0
Pods/Expecta/src/matchers/EXPMatchers+beLessThan.h → Pods/Expecta/Expecta/Matchers/EXPMatchers+beLessThan.h


Some files were not shown because too many files changed in this diff