├── Cartfile ├── Cartfile.private ├── Docs └── ASDKFluentExtensionsUsageDemo.gif ├── ASDKFluentExtensions.xcworkspace └── contents.xcworkspacedata ├── .gitignore ├── Podfile.lock ├── Podfile ├── Cartfile.resolved ├── Source ├── ASLayoutSpec+FluentChildren.m ├── ASLayoutSpec+FluentSpacer.m ├── ASLayoutSpec+FluentSpacer.h ├── ASAbsoluteLayoutSpec+FluentLayout.m ├── ASStackLayoutSpec+FluentLayout.m ├── ASDKFluentExtensions.h ├── ASLayoutSpec+FluentChildren.h ├── ASAbsoluteLayoutSpec+FluentLayout.h ├── ASStackLayoutSpec+FluentLayout.h ├── ASDisplayNode+FluentLayout.m ├── ASLayoutSpec+FluentLayout.m ├── ASLayoutSpec+FluentStyling.m ├── ASDisplayNode+FluentStyling.m ├── ASLayoutSpec+FluentLayout.h ├── ASDisplayNode+FluentLayout.h ├── ASLayoutSpec+FluentStyling.h └── ASDisplayNode+FluentStyling.h ├── ASDKFluentExtensions.podspec ├── Tests ├── Helpers.h ├── ASLayoutSpec+FluentSpacerTests.m ├── Info.plist ├── ASLayoutSpec+FluentChildrenTests.m ├── ASAbsoluteLayoutSpec+FluentLayoutTests.m ├── Helpers.m ├── ASStackLayoutSpec+FluentLayoutTests.m ├── ASLayoutElement+FluentLayoutTests.m └── ASLayoutElement+FluentStylingTests.m ├── Resources └── Info.plist ├── LICENSE ├── ASDKFluentExtensions.xcodeproj ├── xcshareddata │ └── xcschemes │ │ └── ASDKFluentExtensions.xcscheme └── project.pbxproj └── README.md /Cartfile: -------------------------------------------------------------------------------- 1 | github "TextureGroup/Texture" == 2.6 2 | -------------------------------------------------------------------------------- /Cartfile.private: -------------------------------------------------------------------------------- 1 | github "specta/specta" ~> 1.0 2 | github "specta/expecta" "master" 3 | -------------------------------------------------------------------------------- /Docs/ASDKFluentExtensionsUsageDemo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cesteban/ASDKFluentExtensions/HEAD/Docs/ASDKFluentExtensionsUsageDemo.gif -------------------------------------------------------------------------------- /ASDKFluentExtensions.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | build/* 2 | DerivedData/* 3 | *.pbxuser 4 | xcuserdata 5 | project.xcworkspace 6 | *.moved-aside 7 | *.mo 8 | *.xcuserstate 9 | *.xcuserdata 10 | *.xcuserdatad 11 | *.xccheckout 12 | *.orig 13 | tmp/ 14 | .DS_Store 15 | 16 | Pods 17 | Carthage 18 | -------------------------------------------------------------------------------- /Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - Texture/Core (2.6) 3 | 4 | DEPENDENCIES: 5 | - Texture/Core (~> 2.6) 6 | 7 | SPEC CHECKSUMS: 8 | Texture: 7249074582daf75e524e59df5428b66b8e8db0e4 9 | 10 | PODFILE CHECKSUM: a54489ce34099d8e645c1d21b60d59c029c7b73e 11 | 12 | COCOAPODS: 1.3.1 13 | -------------------------------------------------------------------------------- /Podfile: -------------------------------------------------------------------------------- 1 | source 'https://github.com/CocoaPods/Specs.git' 2 | platform :ios, '8.0' 3 | 4 | use_frameworks! 5 | 6 | workspace 'ASDKFluentExtensions' 7 | 8 | project 'ASDKFluentExtensions.xcodeproj' 9 | 10 | target 'ASDKFluentExtensions' do 11 | pod 'Texture/Core', '~> 2.6' 12 | end 13 | -------------------------------------------------------------------------------- /Cartfile.resolved: -------------------------------------------------------------------------------- 1 | github "pinterest/PINCache" "2.3" 2 | github "pinterest/PINOperation" "1.1.1" 3 | github "specta/expecta" "fa55aaf12fc82d0d2dd689ecce2db44ad6869582" 4 | git "https://chromium.googlesource.com/webm/libwebp" "v0.6.0" 5 | github "specta/specta" "v1.0.7" 6 | github "pinterest/PINRemoteImage" "3.0.0-beta.13" 7 | github "TextureGroup/Texture" "2.6" 8 | -------------------------------------------------------------------------------- /Source/ASLayoutSpec+FluentChildren.m: -------------------------------------------------------------------------------- 1 | // 2 | // ASLayoutSpec+FluentChildren.m 3 | // ASDKFluentExtensions 4 | // 5 | // Copyright © 2017 Cesar Estebanez Tascon. 6 | // This software may be modified and distributed under the terms 7 | // of the MIT license. See the LICENSE file for details. 8 | // 9 | 10 | #import "ASLayoutSpec+FluentChildren.h" 11 | 12 | @implementation ASLayoutSpec (FluentChildren) 13 | 14 | - (instancetype)withChildren:(NSArray> *)children 15 | { 16 | self.children = children; 17 | return self; 18 | } 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /Source/ASLayoutSpec+FluentSpacer.m: -------------------------------------------------------------------------------- 1 | // 2 | // ASLayoutSpec+FluentSpacer.m 3 | // ASDKFluentExtensions 4 | // 5 | // Copyright © 2017 Cesar Estebanez Tascon. 6 | // This software may be modified and distributed under the terms 7 | // of the MIT license. See the LICENSE file for details. 8 | // 9 | 10 | #import "ASLayoutSpec+FluentSpacer.h" 11 | #import "ASLayoutSpec+FluentStyling.h" 12 | 13 | @implementation ASLayoutSpec (FluentSpacer) 14 | 15 | + (ASLayoutSpec *)spacer 16 | { 17 | return [[[ASLayoutSpec alloc] init] withFlexGrow:1]; 18 | } 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /Source/ASLayoutSpec+FluentSpacer.h: -------------------------------------------------------------------------------- 1 | // 2 | // ASLayoutSpec+FluentSpacer.h 3 | // ASDKFluentExtensions 4 | // 5 | // Copyright © 2017 Cesar Estebanez Tascon. 6 | // This software may be modified and distributed under the terms 7 | // of the MIT license. See the LICENSE file for details. 8 | // 9 | 10 | #import 11 | 12 | NS_ASSUME_NONNULL_BEGIN 13 | 14 | /** 15 | * @abstract Extension of ASLayoutSpec for conveniently creating spacers. 16 | */ 17 | @interface ASLayoutSpec (FluentSpacer) 18 | 19 | /** 20 | * Creates and returns a spacer (i.e. an ASLayoutSpec with flexGrow = 1.0) 21 | */ 22 | + (ASLayoutSpec *)spacer; 23 | 24 | @end 25 | 26 | NS_ASSUME_NONNULL_END 27 | -------------------------------------------------------------------------------- /Source/ASAbsoluteLayoutSpec+FluentLayout.m: -------------------------------------------------------------------------------- 1 | // 2 | // ASAbsoluteLayoutSpec+FluentLayout.m 3 | // ASDKFluentExtensions 4 | // 5 | // Copyright © 2017 Cesar Estebanez Tascon. 6 | // This software may be modified and distributed under the terms 7 | // of the MIT license. See the LICENSE file for details. 8 | // 9 | 10 | #import "ASAbsoluteLayoutSpec+FluentLayout.h" 11 | 12 | @implementation ASAbsoluteLayoutSpec (FluentLayout) 13 | 14 | - (instancetype)withChildren:(NSArray> *)children 15 | { 16 | self.children = children; 17 | return self; 18 | } 19 | 20 | - (instancetype)withSizing:(ASAbsoluteLayoutSpecSizing)sizing 21 | { 22 | self.sizing = sizing; 23 | return self; 24 | } 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /ASDKFluentExtensions.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |spec| 2 | spec.name = 'ASDKFluentExtensions' 3 | spec.version = '0.8.2' 4 | spec.license = { :type => 'MIT' } 5 | spec.homepage = 'https://github.com/cesteban/ASDKFluentExtensions' 6 | spec.authors = { 'Cesar Estebanez' => 'cestebanez@gmail.com' } 7 | spec.summary = 'Extend AsyncDisplayKit with a fluent layout API' 8 | spec.source = { :git => 'https://github.com/cesteban/ASDKFluentExtensions.git', :tag => spec.version.to_s } 9 | 10 | spec.ios.deployment_target = '8.0' 11 | 12 | spec.public_header_files = 'Source/*.h' 13 | spec.source_files = 'Source/*.{h,m}' 14 | spec.dependency 'Texture/Core', '~> 2.6' 15 | 16 | end 17 | -------------------------------------------------------------------------------- /Tests/Helpers.h: -------------------------------------------------------------------------------- 1 | // 2 | // Helpers.h 3 | // ASDKFluentExtensions 4 | // 5 | // Created by César Estébanez Tascón on 21/05/2017. 6 | // Copyright © 2017 Cesar Estebanez Tascon. All rights reserved. 7 | // 8 | 9 | #ifndef Helpers_h 10 | #define Helpers_h 11 | 12 | // Helper functions to invoke selectors with non-object arguments and return values 13 | 14 | extern id asdkfe_invokeSelector(id target, SEL selector); 15 | 16 | extern id asdkfe_invokeSelectorUnary(id target, SEL selector, void *arg1); 17 | 18 | extern id asdkfe_invokeSelectorBinary(id target, SEL selector, void *arg1, void *arg2); 19 | 20 | extern id asdkfe_invokeSelectorTernary(id target, SEL selector, void *arg1, void *arg2, void *arg3); 21 | 22 | #endif /* Helpers_h */ 23 | -------------------------------------------------------------------------------- /Tests/ASLayoutSpec+FluentSpacerTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // ASLayoutSpec+FluentSpacerTests.m 3 | // ASDKFluentExtensions 4 | // 5 | // Created by César Estébanez Tascón on 21/05/2017. 6 | // Copyright © 2017 Cesar Estebanez Tascon. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | #import 12 | 13 | #import "ASLayoutSpec+FluentSpacer.h" 14 | 15 | SpecBegin(ASDisplayNode_FluentSpacer) 16 | 17 | describe(@"ASDisplayNode_FluentSpacer", ^{ 18 | it(@"should be able to generate spacers", ^{ 19 | ASLayoutSpec *spacer = [ASLayoutSpec spacer]; 20 | expect(spacer).to.beInstanceOf([ASLayoutSpec class]); 21 | expect(spacer.style.flexGrow).to.equal(1); 22 | }); 23 | }); 24 | 25 | SpecEnd 26 | -------------------------------------------------------------------------------- /Tests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | $(CURRENT_PROJECT_VERSION) 21 | NSPrincipalClass 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /Tests/ASLayoutSpec+FluentChildrenTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // ASLayoutSpec+FluentChildrenTests.m 3 | // ASDKFluentExtensions 4 | // 5 | // Created by César Estébanez Tascón on 04/07/2017. 6 | // Copyright © 2017 Cesar Estebanez Tascon. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | #import 12 | 13 | #import "ASLayoutSpec+FluentChildren.h" 14 | 15 | SpecBegin(ASLayoutSpec_FluentChildren) 16 | 17 | it(@"should be able to fluently modify children of the stack", ^{ 18 | ASStackLayoutSpec *stack = [[ASStackLayoutSpec alloc] init]; 19 | id element1 = [[ASDisplayNode alloc] init]; 20 | id element2 = [[ASLayoutSpec alloc] init]; 21 | NSArray> *children = @[element1, element2]; 22 | 23 | ASStackLayoutSpec *spec = [stack withChildren:children]; 24 | 25 | expect(spec).to.equal(stack); 26 | expect(spec.children).to.haveCountOf(2); 27 | expect(spec.children).to.contain(element1); 28 | expect(spec.children).to.contain(element2); 29 | }); 30 | 31 | SpecEnd 32 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 César Estébanez Tascón 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Source/ASStackLayoutSpec+FluentLayout.m: -------------------------------------------------------------------------------- 1 | // 2 | // ASStackLayoutSpec+FluentLayout.m 3 | // ASDKFluentExtensions 4 | // 5 | // Copyright © 2017 Cesar Estebanez Tascon. 6 | // This software may be modified and distributed under the terms 7 | // of the MIT license. See the LICENSE file for details. 8 | // 9 | 10 | #import "ASStackLayoutSpec+FluentLayout.h" 11 | 12 | @implementation ASStackLayoutSpec (FluentLayout) 13 | 14 | - (instancetype)withSpacing:(CGFloat)spacing 15 | { 16 | self.spacing = spacing; 17 | return self; 18 | } 19 | 20 | - (instancetype)withJustifyContent:(ASStackLayoutJustifyContent)justifyContent 21 | { 22 | self.justifyContent = justifyContent; 23 | return self; 24 | } 25 | 26 | - (instancetype)withAlignItems:(ASStackLayoutAlignItems)alignItems 27 | { 28 | self.alignItems = alignItems; 29 | return self; 30 | } 31 | 32 | // Experimental 33 | - (instancetype)justifyContent:(ASStackLayoutJustifyContent)justifyContent 34 | { 35 | self.justifyContent = justifyContent; 36 | return self; 37 | } 38 | 39 | // Experimental 40 | - (instancetype)alignItems:(ASStackLayoutAlignItems)alignItems 41 | { 42 | self.alignItems = alignItems; 43 | return self; 44 | } 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /Source/ASDKFluentExtensions.h: -------------------------------------------------------------------------------- 1 | // 2 | // ASDKFluentExtensions.h 3 | // ASDKFluentExtensions 4 | // 5 | // Copyright © 2017 Cesar Estebanez Tascon. 6 | // This software may be modified and distributed under the terms 7 | // of the MIT license. See the LICENSE file for details. 8 | // 9 | 10 | #import 11 | 12 | //! Project version number for ASDKFluentExtensions. 13 | FOUNDATION_EXPORT double ASDKFluentExtensionsVersionNumber; 14 | 15 | //! Project version string for ASDKFluentExtensions. 16 | FOUNDATION_EXPORT const unsigned char ASDKFluentExtensionsVersionString[]; 17 | 18 | // In this header, you should import all the public headers of your framework using statements like #import 19 | 20 | #import 21 | #import 22 | #import 23 | #import 24 | #import 25 | #import 26 | #import 27 | #import 28 | -------------------------------------------------------------------------------- /Source/ASLayoutSpec+FluentChildren.h: -------------------------------------------------------------------------------- 1 | // 2 | // ASLayoutSpec+FluentChildren.h 3 | // ASDKFluentExtensions 4 | // 5 | // Copyright © 2017 Cesar Estebanez Tascon. 6 | // This software may be modified and distributed under the terms 7 | // of the MIT license. See the LICENSE file for details. 8 | // 9 | 10 | #import 11 | 12 | NS_ASSUME_NONNULL_BEGIN 13 | 14 | /** 15 | * @abstract Extension of ASLayoutSpec that enables writting layout code using a fluent API. 16 | * @discussion Methods of this category will modify the children property of the caller and return 17 | * self. This enables a composable idiom for layout and styling code. Since the return value is 18 | * always an ASLayoutElement, calls to fluent methods can be composed with other calls to create 19 | * complex layouts in a very readable style: 20 | * 21 | * @code ASStackLayoutSpec 22 | .vertical() 23 | .withSpacing(20) 24 | .withJustifyContent(.center) 25 | .withChildren([ 26 | topSeparator 27 | .withFlexGrow(1.0), 28 | textNode 29 | .withAlignSelf(.center), 30 | bottomSeparator 31 | .withFlexGrow(1.0) 32 | ]) 33 | .withInset(UIEdgeInsets(top: 60, left: 0, bottom: 60, right: 0)) 34 | * 35 | */ 36 | @interface ASLayoutSpec (FluentChildren) 37 | 38 | /** 39 | * Adds the provided ASLayoutElement's as children of the caller and returns self. 40 | */ 41 | - (instancetype)withChildren:(NSArray> *)children; 42 | 43 | @end 44 | 45 | NS_ASSUME_NONNULL_END 46 | -------------------------------------------------------------------------------- /Source/ASAbsoluteLayoutSpec+FluentLayout.h: -------------------------------------------------------------------------------- 1 | // 2 | // ASAbsoluteLayoutSpec+FluentLayout.h 3 | // ASDKFluentExtensions 4 | // 5 | // Copyright © 2017 Cesar Estebanez Tascon. 6 | // This software may be modified and distributed under the terms 7 | // of the MIT license. See the LICENSE file for details. 8 | // 9 | 10 | #import 11 | 12 | /** 13 | * @abstract Extension of ASAbsoluteLayoutSpec that enables writting layout code using a fluent API. 14 | * @discussion Methods of this category will modify properties of the caller and return self. 15 | * This enables a composable idiom for layout and styling code. Since the return value is always 16 | * an ASLayoutElement, calls to fluent methods can be composed with other calls to create complex 17 | * layouts in a very readable style: 18 | * 19 | * @code ASStackLayoutSpec 20 | .vertical() 21 | .withSpacing(20) 22 | .withJustifyContent(.center) 23 | .withChildren([ 24 | topSeparator 25 | .withFlexGrow(1.0), 26 | textNode 27 | .withAlignSelf(.center), 28 | bottomSeparator 29 | .withFlexGrow(1.0) 30 | ]) 31 | .withInset(UIEdgeInsets(top: 60, left: 0, bottom: 60, right: 0)) 32 | * 33 | */ 34 | @interface ASAbsoluteLayoutSpec (FluentLayout) 35 | 36 | /** 37 | * Adds the provided ASLayoutElement's as children of the caller and returns self. 38 | */ 39 | - (instancetype)withChildren:(NSArray> *)children; 40 | 41 | /** 42 | * Modifies the sizing property of the caller and returns self. 43 | */ 44 | - (instancetype)withSizing:(ASAbsoluteLayoutSpecSizing)sizing; 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /Tests/ASAbsoluteLayoutSpec+FluentLayoutTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // ASAbsoluteLayoutSpec+FluentLayoutTests.m 3 | // ASDKFluentExtensions 4 | // 5 | // Created by César Estébanez Tascón on 21/05/2017. 6 | // Copyright © 2017 Cesar Estebanez Tascon. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | #import 12 | 13 | #import "ASAbsoluteLayoutSpec+FluentLayout.h" 14 | 15 | SpecBegin(ASAbsoluteLayoutSpec_FluentLayout) 16 | 17 | describe(@"ASAbsoluteLayoutSpec_FluentLayout", ^{ 18 | 19 | it(@"should be able to fluently modify children of the absolute layout", ^{ 20 | ASAbsoluteLayoutSpec *absolute = [[ASAbsoluteLayoutSpec alloc] init]; 21 | id element1 = [[ASDisplayNode alloc] init]; 22 | id element2 = [[ASLayoutSpec alloc] init]; 23 | NSArray> *children = @[element1, element2]; 24 | 25 | ASAbsoluteLayoutSpec *spec = [absolute withChildren:children]; 26 | 27 | expect(spec).to.equal(absolute); 28 | expect(spec.children).to.haveCountOf(2); 29 | expect(spec.children).to.contain(element1); 30 | expect(spec.children).to.contain(element2); 31 | }); 32 | 33 | it(@"should be able to fluently modify sizing property of the stack", ^{ 34 | ASAbsoluteLayoutSpec *absolute = [[ASAbsoluteLayoutSpec alloc] init]; 35 | ASAbsoluteLayoutSpecSizing sizing = ASAbsoluteLayoutSpecSizingSizeToFit; 36 | 37 | ASAbsoluteLayoutSpec *spec = [absolute withSizing:sizing]; 38 | 39 | expect(spec).to.equal(absolute); 40 | expect(spec.sizing).to.equal(sizing); 41 | }); 42 | 43 | }); 44 | 45 | SpecEnd 46 | -------------------------------------------------------------------------------- /Tests/Helpers.m: -------------------------------------------------------------------------------- 1 | // 2 | // Helpers.m 3 | // ASDKFluentExtensions 4 | // 5 | // Created by César Estébanez Tascón on 21/05/2017. 6 | // Copyright © 2017 Cesar Estebanez Tascon. All rights reserved. 7 | // 8 | 9 | #import "Helpers.h" 10 | 11 | #import 12 | 13 | id asdkfe_invokeSelectorWithArguments(id target, SEL selector, void *args[]) { 14 | NSMethodSignature *signature = [[target class] instanceMethodSignatureForSelector:selector]; 15 | NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:signature]; 16 | invocation.selector = selector; 17 | invocation.target = target; 18 | 19 | int i = 0; 20 | while (args[i] != NULL) { 21 | void *arg = args[i]; 22 | [invocation setArgument:arg atIndex:2+i]; 23 | i++; 24 | } 25 | 26 | [invocation invoke]; 27 | 28 | void *tmp; 29 | [invocation getReturnValue:&tmp]; 30 | id result = (__bridge id)tmp; 31 | 32 | return result; 33 | } 34 | 35 | id asdkfe_invokeSelector(id target, SEL selector) { 36 | return asdkfe_invokeSelectorWithArguments(target, selector, (void *[]){NULL}); 37 | } 38 | 39 | id asdkfe_invokeSelectorUnary(id target, SEL selector, void *arg1) { 40 | return asdkfe_invokeSelectorWithArguments(target, selector, (void *[]){arg1, NULL}); 41 | } 42 | 43 | id asdkfe_invokeSelectorBinary(id target, SEL selector, void *arg1, void *arg2) { 44 | return asdkfe_invokeSelectorWithArguments(target, selector, (void *[]){arg1, arg2, NULL}); 45 | } 46 | 47 | id asdkfe_invokeSelectorTernary(id target, SEL selector, void *arg1, void *arg2, void *arg3) { 48 | return asdkfe_invokeSelectorWithArguments(target, selector, (void *[]){arg1, arg2, arg3, NULL}); 49 | } 50 | -------------------------------------------------------------------------------- /Tests/ASStackLayoutSpec+FluentLayoutTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // ASStackLayoutSpec+FluentLayoutTests.m 3 | // ASDKFluentExtensions 4 | // 5 | // Created by César Estébanez Tascón on 21/05/2017. 6 | // Copyright © 2017 Cesar Estebanez Tascon. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | #import 12 | 13 | #import "ASStackLayoutSpec+FluentLayout.h" 14 | 15 | SpecBegin(ASStackLayoutSpec_FluentLayout) 16 | 17 | describe(@"ASStackLayoutSpec_FluentLayout", ^{ 18 | 19 | it(@"should be able to fluently modify spacing property of the stack", ^{ 20 | ASStackLayoutSpec *stack = [[ASStackLayoutSpec alloc] init]; 21 | CGFloat spacing = 10; 22 | 23 | ASStackLayoutSpec *spec = [stack withSpacing:spacing]; 24 | 25 | expect(spec).to.equal(stack); 26 | expect(spec.spacing).to.equal(spacing); 27 | }); 28 | 29 | it(@"should be able to fluently modify justifyContent property of the stack", ^{ 30 | ASStackLayoutSpec *stack = [[ASStackLayoutSpec alloc] init]; 31 | ASStackLayoutJustifyContent justifyContent = ASStackLayoutJustifyContentCenter; 32 | 33 | ASStackLayoutSpec *spec = [stack withJustifyContent:justifyContent]; 34 | 35 | expect(spec).to.equal(stack); 36 | expect(spec.justifyContent).to.equal(justifyContent); 37 | }); 38 | 39 | it(@"should be able to fluently modify alignItems property of the stack", ^{ 40 | ASStackLayoutSpec *stack = [[ASStackLayoutSpec alloc] init]; 41 | ASStackLayoutAlignItems alignItems = ASStackLayoutAlignItemsCenter; 42 | 43 | ASStackLayoutSpec *spec = [stack withAlignItems:alignItems]; 44 | 45 | expect(spec).to.equal(stack); 46 | expect(spec.alignItems).to.equal(alignItems); 47 | }); 48 | 49 | }); 50 | 51 | SpecEnd 52 | -------------------------------------------------------------------------------- /Source/ASStackLayoutSpec+FluentLayout.h: -------------------------------------------------------------------------------- 1 | // 2 | // ASStackLayoutSpec+FluentLayout.h 3 | // ASDKFluentExtensions 4 | // 5 | // Copyright © 2017 Cesar Estebanez Tascon. 6 | // This software may be modified and distributed under the terms 7 | // of the MIT license. See the LICENSE file for details. 8 | // 9 | 10 | #import 11 | 12 | NS_ASSUME_NONNULL_BEGIN 13 | 14 | /** 15 | * @abstract Extension of ASStackLayoutSpec that enables writting layout code using a fluent API. 16 | * @discussion Methods of this category will modify properties of the caller and return self. 17 | * This enables a composable idiom for layout and styling code. Since the return value is always 18 | * an ASLayoutElement, calls to fluent methods can be composed with other calls to create complex 19 | * layouts in a very readable style: 20 | * 21 | * @code ASStackLayoutSpec 22 | .vertical() 23 | .withSpacing(20) 24 | .withJustifyContent(.center) 25 | .withChildren([ 26 | topSeparator 27 | .withFlexGrow(1.0), 28 | textNode 29 | .withAlignSelf(.center), 30 | bottomSeparator 31 | .withFlexGrow(1.0) 32 | ]) 33 | .withInset(UIEdgeInsets(top: 60, left: 0, bottom: 60, right: 0)) 34 | * 35 | */ 36 | @interface ASStackLayoutSpec (FluentLayout) 37 | 38 | /** 39 | * Modifies the spacing property of the caller and returns self. 40 | */ 41 | - (instancetype)withSpacing:(CGFloat)spacing; 42 | 43 | /** 44 | * Modifies the justifyContent property of the caller and returns self. 45 | */ 46 | - (instancetype)withJustifyContent:(ASStackLayoutJustifyContent)justifyContent; 47 | 48 | /** 49 | * Modifies the alignItems property of the caller and returns self. 50 | */ 51 | - (instancetype)withAlignItems:(ASStackLayoutAlignItems)alignItems; 52 | 53 | 54 | /** 55 | * Experimental: Modifies the justifyContent property of the caller and returns self. 56 | */ 57 | - (instancetype)justifyContent:(ASStackLayoutJustifyContent)justifyContent; 58 | 59 | /** 60 | * Experimental: Modifies the alignItems property of the caller and returns self. 61 | */ 62 | - (instancetype)alignItems:(ASStackLayoutAlignItems)alignItems; 63 | 64 | @end 65 | 66 | NS_ASSUME_NONNULL_END 67 | -------------------------------------------------------------------------------- /Source/ASDisplayNode+FluentLayout.m: -------------------------------------------------------------------------------- 1 | // 2 | // ASDisplayNode+FluentLayout.m 3 | // ASDKFluentExtensions 4 | // 5 | // Copyright © 2017 Cesar Estebanez Tascon. 6 | // This software may be modified and distributed under the terms 7 | // of the MIT license. See the LICENSE file for details. 8 | // 9 | 10 | #import "ASDisplayNode+FluentLayout.h" 11 | 12 | @implementation ASDisplayNode (FluentLayout) 13 | 14 | - (ASWrapperLayoutSpec *)wrap 15 | { 16 | return [ASWrapperLayoutSpec wrapperWithLayoutElement:self]; 17 | } 18 | 19 | - (ASInsetLayoutSpec *)withInset:(UIEdgeInsets)insets 20 | { 21 | return [ASInsetLayoutSpec insetLayoutSpecWithInsets:insets child:self]; 22 | } 23 | 24 | - (ASOverlayLayoutSpec *)withOverlay:(id)overlay 25 | { 26 | return [ASOverlayLayoutSpec overlayLayoutSpecWithChild:self overlay:overlay]; 27 | } 28 | 29 | - (ASBackgroundLayoutSpec *)withBackground:(id)background 30 | { 31 | return [ASBackgroundLayoutSpec backgroundLayoutSpecWithChild:self background:background]; 32 | } 33 | 34 | - (ASCenterLayoutSpec *)center 35 | { 36 | return [ASCenterLayoutSpec centerLayoutSpecWithCenteringOptions:ASCenterLayoutSpecCenteringNone sizingOptions:ASCenterLayoutSpecSizingOptionDefault child:self]; 37 | } 38 | 39 | - (ASCenterLayoutSpec *)centerWithCenteringOptions:(ASCenterLayoutSpecCenteringOptions)centeringOptions 40 | { 41 | return [ASCenterLayoutSpec centerLayoutSpecWithCenteringOptions:centeringOptions sizingOptions:ASCenterLayoutSpecSizingOptionDefault child:self]; 42 | } 43 | 44 | - (ASCenterLayoutSpec *)centerWithSizingOptions:(ASCenterLayoutSpecSizingOptions)sizingOptions 45 | { 46 | return [ASCenterLayoutSpec centerLayoutSpecWithCenteringOptions:ASCenterLayoutSpecCenteringNone sizingOptions:sizingOptions child:self]; 47 | } 48 | 49 | - (ASCenterLayoutSpec *)centerWithCenteringOptions:(ASCenterLayoutSpecCenteringOptions)centeringOptions sizingOptions:(ASCenterLayoutSpecSizingOptions)sizingOptions 50 | { 51 | return [ASCenterLayoutSpec centerLayoutSpecWithCenteringOptions:centeringOptions sizingOptions:sizingOptions child:self]; 52 | } 53 | 54 | - (ASRatioLayoutSpec *)withRatio:(CGFloat)ratio 55 | { 56 | return [ASRatioLayoutSpec ratioLayoutSpecWithRatio:ratio child:self]; 57 | } 58 | 59 | - (ASRelativeLayoutSpec *)withRelativePositionHorizontal:(ASRelativeLayoutSpecPosition)horizontal 60 | { 61 | return [ASRelativeLayoutSpec relativePositionLayoutSpecWithHorizontalPosition:horizontal verticalPosition:ASRelativeLayoutSpecPositionNone sizingOption:ASRelativeLayoutSpecSizingOptionDefault child:self]; 62 | } 63 | 64 | - (ASRelativeLayoutSpec *)withRelativePositionVertical:(ASRelativeLayoutSpecPosition)vertical 65 | { 66 | return [ASRelativeLayoutSpec relativePositionLayoutSpecWithHorizontalPosition:ASRelativeLayoutSpecPositionNone verticalPosition:vertical sizingOption:ASRelativeLayoutSpecSizingOptionDefault child:self]; 67 | } 68 | 69 | - (ASRelativeLayoutSpec *)withRelativePositionHorizontal:(ASRelativeLayoutSpecPosition)horizontal vertical:(ASRelativeLayoutSpecPosition)vertical 70 | { 71 | return [ASRelativeLayoutSpec relativePositionLayoutSpecWithHorizontalPosition:horizontal verticalPosition:vertical sizingOption:ASRelativeLayoutSpecSizingOptionDefault child:self]; 72 | } 73 | 74 | - (ASRelativeLayoutSpec *)withRelativePositionHorizontal:(ASRelativeLayoutSpecPosition)horizontal vertical:(ASRelativeLayoutSpecPosition)vertical sizing:(ASRelativeLayoutSpecSizingOption)sizing 75 | { 76 | return [ASRelativeLayoutSpec relativePositionLayoutSpecWithHorizontalPosition:horizontal verticalPosition:vertical sizingOption:sizing child:self]; 77 | } 78 | 79 | @end 80 | -------------------------------------------------------------------------------- /Source/ASLayoutSpec+FluentLayout.m: -------------------------------------------------------------------------------- 1 | // 2 | // ASLayoutSpec+FluentLayout.m 3 | // ASDKFluentExtensions 4 | // 5 | // Copyright © 2017 Cesar Estebanez Tascon. 6 | // This software may be modified and distributed under the terms 7 | // of the MIT license. See the LICENSE file for details. 8 | // 9 | 10 | #import "ASLayoutSpec+FluentLayout.h" 11 | #import "ASLayoutSpec+FluentStyling.h" 12 | 13 | @implementation ASLayoutSpec (FluentLayout) 14 | 15 | - (ASWrapperLayoutSpec *)wrap 16 | { 17 | return [ASWrapperLayoutSpec wrapperWithLayoutElement:self]; 18 | } 19 | 20 | - (ASInsetLayoutSpec *)withInset:(UIEdgeInsets)insets 21 | { 22 | return [ASInsetLayoutSpec insetLayoutSpecWithInsets:insets child:self]; 23 | } 24 | 25 | - (ASOverlayLayoutSpec *)withOverlay:(id)overlay 26 | { 27 | return [ASOverlayLayoutSpec overlayLayoutSpecWithChild:self overlay:overlay]; 28 | } 29 | 30 | - (ASBackgroundLayoutSpec *)withBackground:(id)background 31 | { 32 | return [ASBackgroundLayoutSpec backgroundLayoutSpecWithChild:self background:background]; 33 | } 34 | 35 | - (ASCenterLayoutSpec *)center 36 | { 37 | return [ASCenterLayoutSpec centerLayoutSpecWithCenteringOptions:ASCenterLayoutSpecCenteringNone sizingOptions:ASCenterLayoutSpecSizingOptionDefault child:self]; 38 | } 39 | 40 | - (ASCenterLayoutSpec *)centerWithCenteringOptions:(ASCenterLayoutSpecCenteringOptions)centeringOptions 41 | { 42 | return [ASCenterLayoutSpec centerLayoutSpecWithCenteringOptions:centeringOptions sizingOptions:ASCenterLayoutSpecSizingOptionDefault child:self]; 43 | } 44 | 45 | - (ASCenterLayoutSpec *)centerWithSizingOptions:(ASCenterLayoutSpecSizingOptions)sizingOptions 46 | { 47 | return [ASCenterLayoutSpec centerLayoutSpecWithCenteringOptions:ASCenterLayoutSpecCenteringNone sizingOptions:sizingOptions child:self]; 48 | } 49 | 50 | - (ASCenterLayoutSpec *)centerWithCenteringOptions:(ASCenterLayoutSpecCenteringOptions)centeringOptions sizingOptions:(ASCenterLayoutSpecSizingOptions)sizingOptions 51 | { 52 | return [ASCenterLayoutSpec centerLayoutSpecWithCenteringOptions:centeringOptions sizingOptions:sizingOptions child:self]; 53 | } 54 | 55 | - (ASRatioLayoutSpec *)withRatio:(CGFloat)ratio 56 | { 57 | return [ASRatioLayoutSpec ratioLayoutSpecWithRatio:ratio child:self]; 58 | } 59 | 60 | - (ASRelativeLayoutSpec *)withRelativePositionHorizontal:(ASRelativeLayoutSpecPosition)horizontal 61 | { 62 | return [ASRelativeLayoutSpec relativePositionLayoutSpecWithHorizontalPosition:horizontal verticalPosition:ASRelativeLayoutSpecPositionNone sizingOption:ASRelativeLayoutSpecSizingOptionDefault child:self]; 63 | } 64 | 65 | - (ASRelativeLayoutSpec *)withRelativePositionVertical:(ASRelativeLayoutSpecPosition)vertical 66 | { 67 | return [ASRelativeLayoutSpec relativePositionLayoutSpecWithHorizontalPosition:ASRelativeLayoutSpecPositionNone verticalPosition:vertical sizingOption:ASRelativeLayoutSpecSizingOptionDefault child:self]; 68 | } 69 | 70 | - (ASRelativeLayoutSpec *)withRelativePositionHorizontal:(ASRelativeLayoutSpecPosition)horizontal vertical:(ASRelativeLayoutSpecPosition)vertical 71 | { 72 | return [ASRelativeLayoutSpec relativePositionLayoutSpecWithHorizontalPosition:horizontal verticalPosition:vertical sizingOption:ASRelativeLayoutSpecSizingOptionDefault child:self]; 73 | } 74 | 75 | - (ASRelativeLayoutSpec *)withRelativePositionHorizontal:(ASRelativeLayoutSpecPosition)horizontal vertical:(ASRelativeLayoutSpecPosition)vertical sizing:(ASRelativeLayoutSpecSizingOption)sizing 76 | { 77 | return [ASRelativeLayoutSpec relativePositionLayoutSpecWithHorizontalPosition:horizontal verticalPosition:vertical sizingOption:sizing child:self]; 78 | } 79 | 80 | @end 81 | -------------------------------------------------------------------------------- /Source/ASLayoutSpec+FluentStyling.m: -------------------------------------------------------------------------------- 1 | // 2 | // ASLayoutSpec+FluentStyling.m 3 | // ASDKFluentExtensions 4 | // 5 | // Copyright © 2017 Cesar Estebanez Tascon. 6 | // This software may be modified and distributed under the terms 7 | // of the MIT license. See the LICENSE file for details. 8 | // 9 | 10 | #import "ASLayoutSpec+FluentStyling.h" 11 | 12 | @implementation ASLayoutSpec (FluentStyling) 13 | 14 | #pragma mark - Sizing 15 | 16 | - (instancetype)withWidth:(ASDimension)width 17 | { 18 | self.style.width = width; 19 | return self; 20 | } 21 | 22 | - (instancetype)withHeight:(ASDimension)height 23 | { 24 | self.style.height = height; 25 | return self; 26 | } 27 | 28 | - (instancetype)withMinWidth:(ASDimension)minWidth 29 | { 30 | self.style.minWidth = minWidth; 31 | return self; 32 | } 33 | 34 | - (instancetype)withMaxWidth:(ASDimension)maxWidth 35 | { 36 | self.style.maxWidth = maxWidth; 37 | return self; 38 | } 39 | 40 | - (instancetype)withMinHeight:(ASDimension)minHeight 41 | { 42 | self.style.minHeight = minHeight; 43 | return self; 44 | } 45 | 46 | - (instancetype)withMaxHeight:(ASDimension)maxHeight 47 | { 48 | self.style.maxHeight = maxHeight; 49 | return self; 50 | } 51 | 52 | #pragma mark - Size Helpers 53 | 54 | - (instancetype)withPreferredSize:(CGSize)preferredSize 55 | { 56 | self.style.preferredSize = preferredSize; 57 | return self; 58 | } 59 | 60 | - (instancetype)withMinSize:(CGSize)minSize 61 | { 62 | self.style.minSize = minSize; 63 | return self; 64 | } 65 | 66 | - (instancetype)withMaxSize:(CGSize)maxSize 67 | { 68 | self.style.maxSize = maxSize; 69 | return self; 70 | } 71 | 72 | - (instancetype)withPreferredLayoutSize:(ASLayoutSize)preferredLayoutSize 73 | { 74 | self.style.preferredLayoutSize = preferredLayoutSize; 75 | return self; 76 | } 77 | 78 | - (instancetype)withMinLayoutSize:(ASLayoutSize)minLayoutSize 79 | { 80 | self.style.minLayoutSize = minLayoutSize; 81 | return self; 82 | } 83 | 84 | - (instancetype)withMaxLayoutSize:(ASLayoutSize)maxLayoutSize 85 | { 86 | self.style.maxLayoutSize = maxLayoutSize; 87 | return self; 88 | } 89 | 90 | #pragma mark - ASStackLayoutElement 91 | 92 | - (instancetype)withSpacingBefore:(CGFloat)spacingBefore 93 | { 94 | self.style.spacingBefore = spacingBefore; 95 | return self; 96 | } 97 | 98 | - (instancetype)withSpacingAfter:(CGFloat)spacingAfter 99 | { 100 | self.style.spacingAfter = spacingAfter; 101 | return self; 102 | } 103 | 104 | - (instancetype)withFlexGrow:(CGFloat)flexGrow 105 | { 106 | self.style.flexGrow = flexGrow; 107 | return self; 108 | } 109 | 110 | - (instancetype)withFlexShrink:(CGFloat)flexShrink 111 | { 112 | self.style.flexShrink = flexShrink; 113 | return self; 114 | } 115 | 116 | - (instancetype)withFlexBasis:(ASDimension)flexBasis 117 | { 118 | self.style.flexBasis = flexBasis; 119 | return self; 120 | } 121 | 122 | - (instancetype)withAlignSelf:(ASStackLayoutAlignSelf)alignSelf 123 | { 124 | self.style.alignSelf = alignSelf; 125 | return self; 126 | } 127 | 128 | // Experimental 129 | - (instancetype)alignSelf:(ASStackLayoutAlignSelf)alignSelf 130 | { 131 | self.style.alignSelf = alignSelf; 132 | return self; 133 | } 134 | 135 | - (instancetype)withAscender:(CGFloat)ascender 136 | { 137 | self.style.ascender = ascender; 138 | return self; 139 | } 140 | 141 | - (instancetype)withDescender:(CGFloat)descender 142 | { 143 | self.style.descender = descender; 144 | return self; 145 | } 146 | 147 | #pragma mark - ASAbsoluteLayoutElement 148 | 149 | - (instancetype)withLayoutPosition:(CGPoint)layoutPosition 150 | { 151 | self.style.layoutPosition = layoutPosition; 152 | return self; 153 | } 154 | 155 | @end 156 | -------------------------------------------------------------------------------- /Source/ASDisplayNode+FluentStyling.m: -------------------------------------------------------------------------------- 1 | // 2 | // ASDisplayNode+FluentStyling.m 3 | // ASDKFluentExtensions 4 | // 5 | // Copyright © 2017 Cesar Estebanez Tascon. 6 | // This software may be modified and distributed under the terms 7 | // of the MIT license. See the LICENSE file for details. 8 | // 9 | 10 | #import "ASDisplayNode+FluentStyling.h" 11 | 12 | @implementation ASDisplayNode (FluentStyling) 13 | 14 | #pragma mark - Sizing 15 | 16 | - (instancetype)withWidth:(ASDimension)width 17 | { 18 | self.style.width = width; 19 | return self; 20 | } 21 | 22 | - (instancetype)withHeight:(ASDimension)height 23 | { 24 | self.style.height = height; 25 | return self; 26 | } 27 | 28 | - (instancetype)withMinWidth:(ASDimension)minWidth 29 | { 30 | self.style.minWidth = minWidth; 31 | return self; 32 | } 33 | 34 | - (instancetype)withMaxWidth:(ASDimension)maxWidth 35 | { 36 | self.style.maxWidth = maxWidth; 37 | return self; 38 | } 39 | 40 | - (instancetype)withMinHeight:(ASDimension)minHeight 41 | { 42 | self.style.minHeight = minHeight; 43 | return self; 44 | } 45 | 46 | - (instancetype)withMaxHeight:(ASDimension)maxHeight 47 | { 48 | self.style.maxHeight = maxHeight; 49 | return self; 50 | } 51 | 52 | #pragma mark - Size Helpers 53 | 54 | - (instancetype)withPreferredSize:(CGSize)preferredSize 55 | { 56 | self.style.preferredSize = preferredSize; 57 | return self; 58 | } 59 | 60 | - (instancetype)withMinSize:(CGSize)minSize 61 | { 62 | self.style.minSize = minSize; 63 | return self; 64 | } 65 | 66 | - (instancetype)withMaxSize:(CGSize)maxSize 67 | { 68 | self.style.maxSize = maxSize; 69 | return self; 70 | } 71 | 72 | - (instancetype)withPreferredLayoutSize:(ASLayoutSize)preferredLayoutSize 73 | { 74 | self.style.preferredLayoutSize = preferredLayoutSize; 75 | return self; 76 | } 77 | 78 | - (instancetype)withMinLayoutSize:(ASLayoutSize)minLayoutSize 79 | { 80 | self.style.minLayoutSize = minLayoutSize; 81 | return self; 82 | } 83 | 84 | - (instancetype)withMaxLayoutSize:(ASLayoutSize)maxLayoutSize 85 | { 86 | self.style.maxLayoutSize = maxLayoutSize; 87 | return self; 88 | } 89 | 90 | #pragma mark - ASStackLayoutElement 91 | 92 | - (instancetype)withSpacingBefore:(CGFloat)spacingBefore 93 | { 94 | self.style.spacingBefore = spacingBefore; 95 | return self; 96 | } 97 | 98 | - (instancetype)withSpacingAfter:(CGFloat)spacingAfter 99 | { 100 | self.style.spacingAfter = spacingAfter; 101 | return self; 102 | } 103 | 104 | - (instancetype)withFlexGrow:(CGFloat)flexGrow 105 | { 106 | self.style.flexGrow = flexGrow; 107 | return self; 108 | } 109 | 110 | - (instancetype)withFlexShrink:(CGFloat)flexShrink 111 | { 112 | self.style.flexShrink = flexShrink; 113 | return self; 114 | } 115 | 116 | - (instancetype)withFlexBasis:(ASDimension)flexBasis 117 | { 118 | self.style.flexBasis = flexBasis; 119 | return self; 120 | } 121 | 122 | - (instancetype)withAlignSelf:(ASStackLayoutAlignSelf)alignSelf 123 | { 124 | self.style.alignSelf = alignSelf; 125 | return self; 126 | } 127 | 128 | // Experimental 129 | - (instancetype)alignSelf:(ASStackLayoutAlignSelf)alignSelf 130 | { 131 | self.style.alignSelf = alignSelf; 132 | return self; 133 | } 134 | 135 | - (instancetype)withAscender:(CGFloat)ascender 136 | { 137 | self.style.ascender = ascender; 138 | return self; 139 | } 140 | 141 | - (instancetype)withDescender:(CGFloat)descender 142 | { 143 | self.style.descender = descender; 144 | return self; 145 | } 146 | 147 | #pragma mark - ASAbsoluteLayoutElement 148 | 149 | - (instancetype)withLayoutPosition:(CGPoint)layoutPosition 150 | { 151 | self.style.layoutPosition = layoutPosition; 152 | return self; 153 | } 154 | 155 | @end 156 | -------------------------------------------------------------------------------- /ASDKFluentExtensions.xcodeproj/xcshareddata/xcschemes/ASDKFluentExtensions.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 42 | 43 | 49 | 50 | 51 | 52 | 53 | 54 | 64 | 65 | 71 | 72 | 73 | 74 | 75 | 76 | 82 | 83 | 89 | 90 | 91 | 92 | 94 | 95 | 98 | 99 | 100 | -------------------------------------------------------------------------------- /Source/ASLayoutSpec+FluentLayout.h: -------------------------------------------------------------------------------- 1 | // 2 | // ASLayoutSpec+FluentLayout.h 3 | // ASDKFluentExtensions 4 | // 5 | // Copyright © 2017 Cesar Estebanez Tascon. 6 | // This software may be modified and distributed under the terms 7 | // of the MIT license. See the LICENSE file for details. 8 | // 9 | 10 | #import 11 | 12 | NS_ASSUME_NONNULL_BEGIN 13 | 14 | /** 15 | * @abstract Extension of ASLayoutSpec that enables writting layout code using a fluent API. 16 | * @discussion Methods of this category will create the appropriate ASLayoutSpec subclass 17 | * passing self as its child, and then return the spec. 18 | * This enables a composable idiom for layout and styling code. Since the return value is always 19 | * an ASLayoutElement, calls to fluent methods can be composed with other calls to create complex 20 | * layouts in a very readable style: 21 | * 22 | * @code ASStackLayoutSpec 23 | .vertical() 24 | .withSpacing(20) 25 | .withJustifyContent(.center) 26 | .withChildren([ 27 | topSeparator 28 | .withFlexGrow(1.0), 29 | textNode 30 | .withAlignSelf(.center), 31 | bottomSeparator 32 | .withFlexGrow(1.0) 33 | ]) 34 | .withInset(UIEdgeInsets(top: 60, left: 0, bottom: 60, right: 0)) 35 | * 36 | */ 37 | @interface ASLayoutSpec (FluentLayout) 38 | 39 | /** 40 | * Wraps the caller in an ASWrapperLayoutSpec and returns the spec. 41 | */ 42 | - (ASWrapperLayoutSpec *)wrap; 43 | 44 | /** 45 | * Wraps the caller in an ASInsetLayoutSpec with the specified insets, and returns the spec. 46 | */ 47 | - (ASInsetLayoutSpec *)withInset:(UIEdgeInsets)insets; 48 | 49 | /** 50 | * Wraps the caller in an ASOverlayLayoutSpec, passign self as the child of the spec, and 51 | * overlay as the overlay element. Then returns the spec. 52 | */ 53 | - (ASOverlayLayoutSpec *)withOverlay:(id)overlay; 54 | 55 | /** 56 | * Wraps the caller in an ASBackgroundLayoutSpec, passign self as the child of the spec, 57 | * and background as the background element. Then returns the spec. 58 | */ 59 | - (ASBackgroundLayoutSpec *)withBackground:(id)background; 60 | 61 | /** 62 | * Wraps the caller in an ASCenterLayoutSpec with the default parameters, and returns the spec. 63 | */ 64 | - (ASCenterLayoutSpec *)center; 65 | 66 | /** 67 | * Wraps the caller in an ASCenterLayoutSpec with the specified centeringOptions, and returns the spec. 68 | */ 69 | - (ASCenterLayoutSpec *)centerWithCenteringOptions:(ASCenterLayoutSpecCenteringOptions)centeringOptions; 70 | 71 | /** 72 | * Wraps the caller in an ASCenterLayoutSpec with the specified sizingOptions, and returns the spec. 73 | */ 74 | - (ASCenterLayoutSpec *)centerWithSizingOptions:(ASCenterLayoutSpecSizingOptions)sizingOptions; 75 | 76 | /** 77 | * Wraps the caller in an ASCenterLayoutSpec with the specified centeringOptions and sizingOptions, 78 | * and returns the spec. 79 | */ 80 | - (ASCenterLayoutSpec *)centerWithCenteringOptions:(ASCenterLayoutSpecCenteringOptions)centeringOptions sizingOptions:(ASCenterLayoutSpecSizingOptions)sizingOptions; 81 | 82 | /** 83 | * Wraps the caller in an ASRatioLayoutSpec with the specified ratio and returns the spec. 84 | */ 85 | - (ASRatioLayoutSpec *)withRatio:(CGFloat)ratio; 86 | 87 | /** 88 | * Wraps the caller in an ASRelativeLayoutSpec with the specified horizontal position and returns the spec. 89 | */ 90 | - (ASRelativeLayoutSpec *)withRelativePositionHorizontal:(ASRelativeLayoutSpecPosition)horizontal NS_SWIFT_NAME(withRelativePosition(horizontal:)); 91 | 92 | /** 93 | * Wraps the caller in an ASRelativeLayoutSpec with the specified vertical position and returns the spec. 94 | */ 95 | - (ASRelativeLayoutSpec *)withRelativePositionVertical:(ASRelativeLayoutSpecPosition)vertical NS_SWIFT_NAME(withRelativePosition(vertical:)); 96 | 97 | /** 98 | * Wraps the caller in an ASRelativeLayoutSpec with the specified horizontal and vertical position, and 99 | * returns the spec. 100 | */ 101 | - (ASRelativeLayoutSpec *)withRelativePositionHorizontal:(ASRelativeLayoutSpecPosition)horizontal vertical:(ASRelativeLayoutSpecPosition)vertical NS_SWIFT_NAME(withRelativePosition(horizontal:vertical:)); 102 | 103 | /** 104 | * Wraps the caller in an ASRelativeLayoutSpec with the specified horizontal position, vertical position, 105 | * and the sizing options. Then returns the spec. 106 | */ 107 | - (ASRelativeLayoutSpec *)withRelativePositionHorizontal:(ASRelativeLayoutSpecPosition)horizontal vertical:(ASRelativeLayoutSpecPosition)vertical sizing:(ASRelativeLayoutSpecSizingOption)sizing NS_SWIFT_NAME(withRelativePosition(horizontal:vertical:sizing:)); 108 | 109 | @end 110 | 111 | NS_ASSUME_NONNULL_END 112 | -------------------------------------------------------------------------------- /Source/ASDisplayNode+FluentLayout.h: -------------------------------------------------------------------------------- 1 | // 2 | // ASDisplayNode+FluentLayout.h 3 | // ASDKFluentExtensions 4 | // 5 | // Copyright © 2017 Cesar Estebanez Tascon. 6 | // This software may be modified and distributed under the terms 7 | // of the MIT license. See the LICENSE file for details. 8 | // 9 | 10 | #import 11 | 12 | NS_ASSUME_NONNULL_BEGIN 13 | 14 | /** 15 | * @abstract Extension of ASDisplayNode that enables writting layout code using a fluent API. 16 | * @discussion Methods of this category will create the appropriate ASLayoutSpec subclass 17 | * passing self as its child, and then return the spec. 18 | * This enables a composable idiom for layout and styling code. Since the return value is always 19 | * an ASLayoutElement, calls to fluent methods can be composed with other calls to create complex 20 | * layouts in a very readable style: 21 | * 22 | * @code ASStackLayoutSpec 23 | .vertical() 24 | .withSpacing(20) 25 | .withJustifyContent(.center) 26 | .withChildren([ 27 | topSeparator 28 | .withFlexGrow(1.0), 29 | textNode 30 | .withAlignSelf(.center), 31 | bottomSeparator 32 | .withFlexGrow(1.0) 33 | ]) 34 | .withInset(UIEdgeInsets(top: 60, left: 0, bottom: 60, right: 0)) 35 | * 36 | */ 37 | @interface ASDisplayNode (FluentLayout) 38 | 39 | /** 40 | * Wraps the caller in an ASWrapperLayoutSpec and returns the spec. 41 | */ 42 | - (ASWrapperLayoutSpec *)wrap; 43 | 44 | /** 45 | * Wraps the caller in an ASInsetLayoutSpec with the specified insets, and returns the spec. 46 | */ 47 | - (ASInsetLayoutSpec *)withInset:(UIEdgeInsets)insets; 48 | 49 | /** 50 | * Wraps the caller in an ASOverlayLayoutSpec, passign self as the child of the spec, and 51 | * overlay as the overlay element. Then returns the spec. 52 | */ 53 | - (ASOverlayLayoutSpec *)withOverlay:(id)overlay; 54 | 55 | /** 56 | * Wraps the caller in an ASBackgroundLayoutSpec, passign self as the child of the spec, 57 | * and background as the background element. Then returns the spec. 58 | */ 59 | - (ASBackgroundLayoutSpec *)withBackground:(id)background; 60 | 61 | /** 62 | * Wraps the caller in an ASCenterLayoutSpec with the default parameters, and returns the spec. 63 | */ 64 | - (ASCenterLayoutSpec *)center; 65 | 66 | /** 67 | * Wraps the caller in an ASCenterLayoutSpec with the specified centeringOptions, and returns the spec. 68 | */ 69 | - (ASCenterLayoutSpec *)centerWithCenteringOptions:(ASCenterLayoutSpecCenteringOptions)centeringOptions; 70 | 71 | /** 72 | * Wraps the caller in an ASCenterLayoutSpec with the specified sizingOptions, and returns the spec. 73 | */ 74 | - (ASCenterLayoutSpec *)centerWithSizingOptions:(ASCenterLayoutSpecSizingOptions)sizingOptions; 75 | 76 | /** 77 | * Wraps the caller in an ASCenterLayoutSpec with the specified centeringOptions and sizingOptions, 78 | * and returns the spec. 79 | */ 80 | - (ASCenterLayoutSpec *)centerWithCenteringOptions:(ASCenterLayoutSpecCenteringOptions)centeringOptions sizingOptions:(ASCenterLayoutSpecSizingOptions)sizingOptions; 81 | 82 | /** 83 | * Wraps the caller in an ASRatioLayoutSpec with the specified ratio and returns the spec. 84 | */ 85 | - (ASRatioLayoutSpec *)withRatio:(CGFloat)ratio; 86 | 87 | /** 88 | * Wraps the caller in an ASRelativeLayoutSpec with the specified horizontal position and returns the spec. 89 | */ 90 | - (ASRelativeLayoutSpec *)withRelativePositionHorizontal:(ASRelativeLayoutSpecPosition)horizontal NS_SWIFT_NAME(withRelativePosition(horizontal:)); 91 | 92 | /** 93 | * Wraps the caller in an ASRelativeLayoutSpec with the specified vertical position and returns the spec. 94 | */ 95 | - (ASRelativeLayoutSpec *)withRelativePositionVertical:(ASRelativeLayoutSpecPosition)vertical NS_SWIFT_NAME(withRelativePosition(vertical:)); 96 | 97 | /** 98 | * Wraps the caller in an ASRelativeLayoutSpec with the specified horizontal and vertical position, and 99 | * returns the spec. 100 | */ 101 | - (ASRelativeLayoutSpec *)withRelativePositionHorizontal:(ASRelativeLayoutSpecPosition)horizontal vertical:(ASRelativeLayoutSpecPosition)vertical NS_SWIFT_NAME(withRelativePosition(horizontal:vertical:)); 102 | 103 | /** 104 | * Wraps the caller in an ASRelativeLayoutSpec with the specified horizontal position, vertical position, 105 | * and the sizing options. Then returns the spec. 106 | */ 107 | - (ASRelativeLayoutSpec *)withRelativePositionHorizontal:(ASRelativeLayoutSpecPosition)horizontal vertical:(ASRelativeLayoutSpecPosition)vertical sizing:(ASRelativeLayoutSpecSizingOption)sizing NS_SWIFT_NAME(withRelativePosition(horizontal:vertical:sizing:)); 108 | 109 | @end 110 | 111 | NS_ASSUME_NONNULL_END 112 | -------------------------------------------------------------------------------- /Source/ASLayoutSpec+FluentStyling.h: -------------------------------------------------------------------------------- 1 | // 2 | // ASLayoutSpec+FluentStyling.h 3 | // ASDKFluentExtensions 4 | // 5 | // Copyright © 2017 Cesar Estebanez Tascon. 6 | // This software may be modified and distributed under the terms 7 | // of the MIT license. See the LICENSE file for details. 8 | // 9 | 10 | #import 11 | 12 | NS_ASSUME_NONNULL_BEGIN 13 | 14 | /** 15 | * @abstract Extension of ASLayoutSpec that enables writting layout code using a fluent API. 16 | * @discussion Methods of this category will modify the style property of the caller and return 17 | * self. 18 | * This enables a composable idiom for layout and styling code. Since the return value is always 19 | * an ASLayoutElement, calls to fluent methods can be composed with other calls to create complex 20 | * layouts in a very readable style: 21 | * 22 | * @code ASStackLayoutSpec 23 | .vertical() 24 | .withSpacing(20) 25 | .withJustifyContent(.center) 26 | .withChildren([ 27 | topSeparator 28 | .withFlexGrow(1.0), 29 | textNode 30 | .withAlignSelf(.center), 31 | bottomSeparator 32 | .withFlexGrow(1.0) 33 | ]) 34 | .withInset(UIEdgeInsets(top: 60, left: 0, bottom: 60, right: 0)) 35 | * 36 | */ 37 | @interface ASLayoutSpec (FluentStyling) 38 | 39 | #pragma mark - Sizing 40 | 41 | /** 42 | * Modifies the style.width property of the caller and returns self. 43 | */ 44 | - (instancetype)withWidth:(ASDimension)width; 45 | 46 | /** 47 | * Modifies the style.height property of the caller and returns self. 48 | */ 49 | - (instancetype)withHeight:(ASDimension)height; 50 | 51 | /** 52 | * Modifies the style.minWidth property of the caller and returns self. 53 | */ 54 | - (instancetype)withMinWidth:(ASDimension)minWidth; 55 | 56 | /** 57 | * Modifies the style.maxWidth property of the caller and returns self. 58 | */ 59 | - (instancetype)withMaxWidth:(ASDimension)maxWidth; 60 | 61 | /** 62 | * Modifies the style.minHeight property of the caller and returns self. 63 | */ 64 | - (instancetype)withMinHeight:(ASDimension)minHeight; 65 | 66 | /** 67 | * Modifies the style.maxHeight property of the caller and returns self. 68 | */ 69 | - (instancetype)withMaxHeight:(ASDimension)maxHeight; 70 | 71 | #pragma mark - Size Helpers 72 | 73 | /** 74 | * Modifies the style.preferredSize property of the caller and returns self. 75 | */ 76 | - (instancetype)withPreferredSize:(CGSize)preferredSize; 77 | 78 | /** 79 | * Modifies the style.minSize property of the caller and returns self. 80 | */ 81 | - (instancetype)withMinSize:(CGSize)minSize; 82 | 83 | /** 84 | * Modifies the style.maxSize property of the caller and returns self. 85 | */ 86 | - (instancetype)withMaxSize:(CGSize)maxSize; 87 | 88 | /** 89 | * Modifies the style.preferredLayoutSize property of the caller and returns self. 90 | */ 91 | - (instancetype)withPreferredLayoutSize:(ASLayoutSize)preferredLayoutSize; 92 | 93 | /** 94 | * Modifies the style.minLayoutSize property of the caller and returns self. 95 | */ 96 | - (instancetype)withMinLayoutSize:(ASLayoutSize)minLayoutSize; 97 | 98 | /** 99 | * Modifies the style.maxLayoutSize property of the caller and returns self. 100 | */ 101 | - (instancetype)withMaxLayoutSize:(ASLayoutSize)maxLayoutSize; 102 | 103 | #pragma mark - ASStackLayoutElement 104 | 105 | /** 106 | * Modifies the style.spacingBefore property of the caller and returns self. 107 | */ 108 | - (instancetype)withSpacingBefore:(CGFloat)spacingBefore; 109 | 110 | /** 111 | * Modifies the style.spacingAfter property of the caller and returns self. 112 | */ 113 | - (instancetype)withSpacingAfter:(CGFloat)spacingAfter; 114 | 115 | /** 116 | * Modifies the style.flexGrow property of the caller and returns self. 117 | */ 118 | - (instancetype)withFlexGrow:(CGFloat)flexGrow; 119 | 120 | /** 121 | * Modifies the style.flexShrink property of the caller and returns self. 122 | */ 123 | - (instancetype)withFlexShrink:(CGFloat)flexShrink; 124 | 125 | /** 126 | * Modifies the style.flexBasis property of the caller and returns self. 127 | */ 128 | - (instancetype)withFlexBasis:(ASDimension)flexBasis; 129 | 130 | /** 131 | * Modifies the style.alignSelf property of the caller and returns self. 132 | */ 133 | - (instancetype)withAlignSelf:(ASStackLayoutAlignSelf)alignSelf; 134 | 135 | /** 136 | * Experimental: Modifies the style.alignSelf property of the caller and returns self. 137 | */ 138 | - (instancetype)alignSelf:(ASStackLayoutAlignSelf)alignSelf; 139 | 140 | /** 141 | * Modifies the style.ascender property of the caller and returns self. 142 | */ 143 | - (instancetype)withAscender:(CGFloat)ascender; 144 | 145 | /** 146 | * Modifies the style.descender property of the caller and returns self. 147 | */ 148 | - (instancetype)withDescender:(CGFloat)descender; 149 | 150 | #pragma mark - ASAbsoluteLayoutElement 151 | 152 | /** 153 | * Modifies the style.layoutPosition property of the caller and returns self. 154 | */ 155 | - (instancetype)withLayoutPosition:(CGPoint)layoutPosition; 156 | 157 | @end 158 | 159 | NS_ASSUME_NONNULL_END 160 | -------------------------------------------------------------------------------- /Source/ASDisplayNode+FluentStyling.h: -------------------------------------------------------------------------------- 1 | // 2 | // ASDisplayNode+FluentStyling.h 3 | // ASDKFluentExtensions 4 | // 5 | // Copyright © 2017 Cesar Estebanez Tascon. 6 | // This software may be modified and distributed under the terms 7 | // of the MIT license. See the LICENSE file for details. 8 | // 9 | 10 | #import 11 | 12 | NS_ASSUME_NONNULL_BEGIN 13 | 14 | /** 15 | * @abstract Extension of ASDisplayNode that enables writting layout code using a fluent API. 16 | * @discussion Methods of this category will modify the style property of the caller and return 17 | * self. 18 | * This enables a composable idiom for layout and styling code. Since the return value is always 19 | * an ASLayoutElement, calls to fluent methods can be composed with other calls to create complex 20 | * layouts in a very readable style: 21 | * 22 | * @code ASStackLayoutSpec 23 | .vertical() 24 | .withSpacing(20) 25 | .withJustifyContent(.center) 26 | .withChildren([ 27 | topSeparator 28 | .withFlexGrow(1.0), 29 | textNode 30 | .withAlignSelf(.center), 31 | bottomSeparator 32 | .withFlexGrow(1.0) 33 | ]) 34 | .withInset(UIEdgeInsets(top: 60, left: 0, bottom: 60, right: 0)) 35 | * 36 | */ 37 | @interface ASDisplayNode (FluentStyling) 38 | 39 | #pragma mark - Sizing 40 | 41 | /** 42 | * Modifies the style.width property of the caller and returns self. 43 | */ 44 | - (instancetype)withWidth:(ASDimension)width; 45 | 46 | /** 47 | * Modifies the style.height property of the caller and returns self. 48 | */ 49 | - (instancetype)withHeight:(ASDimension)height; 50 | 51 | /** 52 | * Modifies the style.minWidth property of the caller and returns self. 53 | */ 54 | - (instancetype)withMinWidth:(ASDimension)minWidth; 55 | 56 | /** 57 | * Modifies the style.maxWidth property of the caller and returns self. 58 | */ 59 | - (instancetype)withMaxWidth:(ASDimension)maxWidth; 60 | 61 | /** 62 | * Modifies the style.minHeight property of the caller and returns self. 63 | */ 64 | - (instancetype)withMinHeight:(ASDimension)minHeight; 65 | 66 | /** 67 | * Modifies the style.maxHeight property of the caller and returns self. 68 | */ 69 | - (instancetype)withMaxHeight:(ASDimension)maxHeight; 70 | 71 | #pragma mark - Size Helpers 72 | 73 | /** 74 | * Modifies the style.preferredSize property of the caller and returns self. 75 | */ 76 | - (instancetype)withPreferredSize:(CGSize)preferredSize; 77 | 78 | /** 79 | * Modifies the style.minSize property of the caller and returns self. 80 | */ 81 | - (instancetype)withMinSize:(CGSize)minSize; 82 | 83 | /** 84 | * Modifies the style.maxSize property of the caller and returns self. 85 | */ 86 | - (instancetype)withMaxSize:(CGSize)maxSize; 87 | 88 | /** 89 | * Modifies the style.preferredLayoutSize property of the caller and returns self. 90 | */ 91 | - (instancetype)withPreferredLayoutSize:(ASLayoutSize)preferredLayoutSize; 92 | 93 | /** 94 | * Modifies the style.minLayoutSize property of the caller and returns self. 95 | */ 96 | - (instancetype)withMinLayoutSize:(ASLayoutSize)minLayoutSize; 97 | 98 | /** 99 | * Modifies the style.maxLayoutSize property of the caller and returns self. 100 | */ 101 | - (instancetype)withMaxLayoutSize:(ASLayoutSize)maxLayoutSize; 102 | 103 | #pragma mark - ASStackLayoutElement 104 | 105 | /** 106 | * Modifies the style.spacingBefore property of the caller and returns self. 107 | */ 108 | - (instancetype)withSpacingBefore:(CGFloat)spacingBefore; 109 | 110 | /** 111 | * Modifies the style.spacingAfter property of the caller and returns self. 112 | */ 113 | - (instancetype)withSpacingAfter:(CGFloat)spacingAfter; 114 | 115 | /** 116 | * Modifies the style.flexGrow property of the caller and returns self. 117 | */ 118 | - (instancetype)withFlexGrow:(CGFloat)flexGrow; 119 | 120 | /** 121 | * Modifies the style.flexShrink property of the caller and returns self. 122 | */ 123 | - (instancetype)withFlexShrink:(CGFloat)flexShrink; 124 | 125 | /** 126 | * Modifies the style.flexBasis property of the caller and returns self. 127 | */ 128 | - (instancetype)withFlexBasis:(ASDimension)flexBasis; 129 | 130 | /** 131 | * Modifies the style.alignSelf property of the caller and returns self. 132 | */ 133 | - (instancetype)withAlignSelf:(ASStackLayoutAlignSelf)alignSelf; 134 | 135 | /** 136 | * Experimental: Modifies the style.alignSelf property of the caller and returns self. 137 | */ 138 | - (instancetype)alignSelf:(ASStackLayoutAlignSelf)alignSelf; 139 | 140 | /** 141 | * Modifies the style.ascender property of the caller and returns self. 142 | */ 143 | - (instancetype)withAscender:(CGFloat)ascender; 144 | 145 | /** 146 | * Modifies the style.descender property of the caller and returns self. 147 | */ 148 | - (instancetype)withDescender:(CGFloat)descender; 149 | 150 | #pragma mark - ASAbsoluteLayoutElement 151 | 152 | /** 153 | * Modifies the style.layoutPosition property of the caller and returns self. 154 | */ 155 | - (instancetype)withLayoutPosition:(CGPoint)layoutPosition; 156 | 157 | @end 158 | 159 | NS_ASSUME_NONNULL_END 160 | -------------------------------------------------------------------------------- /Tests/ASLayoutElement+FluentLayoutTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // ASLayoutElement+FluentLayoutTests.m 3 | // ASDKFluentExtensions 4 | // 5 | // Created by César Estébanez Tascón on 20/05/2017. 6 | // Copyright © 2017 Cesar Estebanez Tascon. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | #import 12 | 13 | #import "ASDisplayNode+FluentLayout.h" 14 | #import "ASLayoutSpec+FluentLayout.h" 15 | #import "Helpers.h" 16 | 17 | SharedExamplesBegin(ASLayoutElement_FluentLayout) 18 | 19 | sharedExamplesFor(@"ASLayoutElement_FluentLayout", ^(NSDictionary *data) { 20 | it(@"should be possible to wrap the element", ^{ 21 | id element = data[@"element"]; 22 | 23 | ASWrapperLayoutSpec *spec = asdkfe_invokeSelector(element, @selector(wrap)); 24 | 25 | expect(spec).beInstanceOf([ASWrapperLayoutSpec class]); 26 | expect(spec.child).to.equal(element); 27 | }); 28 | 29 | it(@"should be possible to inset the element", ^{ 30 | id element = data[@"element"]; 31 | UIEdgeInsets insets = UIEdgeInsetsMake(10, 10, 10, 10); 32 | 33 | ASInsetLayoutSpec *spec = asdkfe_invokeSelectorUnary(element, @selector(withInset:), &insets); 34 | 35 | expect(spec).beInstanceOf([ASInsetLayoutSpec class]); 36 | expect(spec.child).to.equal(element); 37 | expect(UIEdgeInsetsEqualToEdgeInsets(spec.insets, insets)).to.beTruthy(); 38 | }); 39 | 40 | it(@"should be possible to overlay the element with another element", ^{ 41 | id element = data[@"element"]; 42 | id overlay = [[ASDisplayNode alloc] init]; 43 | 44 | ASOverlayLayoutSpec *spec = asdkfe_invokeSelectorUnary(element, @selector(withOverlay:), &overlay); 45 | 46 | expect(spec).beInstanceOf([ASOverlayLayoutSpec class]); 47 | expect(spec.child).to.equal(element); 48 | expect(spec.overlay).to.equal(overlay); 49 | }); 50 | 51 | it(@"should be possible to background the element with another element", ^{ 52 | id element = data[@"element"]; 53 | id background = [[ASDisplayNode alloc] init]; 54 | 55 | ASBackgroundLayoutSpec *spec = asdkfe_invokeSelectorUnary(element, @selector(withBackground:), &background); 56 | 57 | expect(spec).beInstanceOf([ASBackgroundLayoutSpec class]); 58 | expect(spec.child).to.equal(element); 59 | expect(spec.background).to.equal(background); 60 | }); 61 | 62 | 63 | it(@"should be possible to center the element", ^{ 64 | id element = data[@"element"]; 65 | 66 | ASCenterLayoutSpec *spec = asdkfe_invokeSelector(element, @selector(center)); 67 | 68 | expect(spec).beInstanceOf([ASCenterLayoutSpec class]); 69 | expect(spec.child).to.equal(element); 70 | }); 71 | 72 | it(@"should be possible to center the element passing centering options", ^{ 73 | id element = data[@"element"]; 74 | ASCenterLayoutSpecCenteringOptions centeringOptions = ASCenterLayoutSpecCenteringXY; 75 | 76 | ASCenterLayoutSpec *spec = asdkfe_invokeSelectorUnary(element, @selector(centerWithCenteringOptions:), ¢eringOptions); 77 | 78 | expect(spec).beInstanceOf([ASCenterLayoutSpec class]); 79 | expect(spec.child).to.equal(element); 80 | expect(spec.centeringOptions).to.equal(centeringOptions); 81 | }); 82 | 83 | it(@"should be possible to center the element passing sizing options", ^{ 84 | id element = data[@"element"]; 85 | ASCenterLayoutSpecSizingOptions sizingOptions = ASCenterLayoutSpecSizingOptionMinimumXY; 86 | 87 | ASCenterLayoutSpec *spec = asdkfe_invokeSelectorUnary(element, @selector(centerWithSizingOptions:), &sizingOptions); 88 | 89 | expect(spec).beInstanceOf([ASCenterLayoutSpec class]); 90 | expect(spec.child).to.equal(element); 91 | expect(spec.sizingOptions).to.equal(sizingOptions); 92 | }); 93 | 94 | it(@"should be possible to center the element passing centering and sizing options", ^{ 95 | id element = data[@"element"]; 96 | ASCenterLayoutSpecCenteringOptions centeringOptions = ASCenterLayoutSpecCenteringXY; 97 | ASCenterLayoutSpecSizingOptions sizingOptions = ASCenterLayoutSpecSizingOptionMinimumXY; 98 | 99 | ASCenterLayoutSpec *spec = asdkfe_invokeSelectorBinary(element, @selector(centerWithCenteringOptions:sizingOptions:), ¢eringOptions, &sizingOptions); 100 | 101 | expect(spec).beInstanceOf([ASCenterLayoutSpec class]); 102 | expect(spec.child).to.equal(element); 103 | expect(spec.centeringOptions).to.equal(centeringOptions); 104 | expect(spec.sizingOptions).to.equal(sizingOptions); 105 | }); 106 | 107 | it(@"should be possible to wrap the element into a ASRatioLayoutSpec", ^{ 108 | id element = data[@"element"]; 109 | CGFloat ratio = 1; 110 | 111 | ASRatioLayoutSpec *spec = asdkfe_invokeSelectorUnary(element, @selector(withRatio:), &ratio); 112 | 113 | expect(spec).beInstanceOf([ASRatioLayoutSpec class]); 114 | expect(spec.child).to.equal(element); 115 | expect(spec.ratio).to.equal(ratio); 116 | }); 117 | 118 | it(@"should be possible to define a relative horizontal position for the element", ^{ 119 | id element = data[@"element"]; 120 | ASRelativeLayoutSpecPosition horizontalPosition = ASRelativeLayoutSpecPositionCenter; 121 | 122 | ASRelativeLayoutSpec *spec = asdkfe_invokeSelectorUnary(element, @selector(withRelativePositionHorizontal:), &horizontalPosition); 123 | 124 | expect(spec).beInstanceOf([ASRelativeLayoutSpec class]); 125 | expect(spec.child).to.equal(element); 126 | expect(spec.horizontalPosition).to.equal(horizontalPosition); 127 | }); 128 | 129 | it(@"should be possible to define a relative vertical position for the element", ^{ 130 | id element = data[@"element"]; 131 | ASRelativeLayoutSpecPosition verticalPosition = ASRelativeLayoutSpecPositionCenter; 132 | 133 | ASRelativeLayoutSpec *spec = asdkfe_invokeSelectorUnary(element, @selector(withRelativePositionVertical:), &verticalPosition); 134 | 135 | expect(spec).beInstanceOf([ASRelativeLayoutSpec class]); 136 | expect(spec.child).to.equal(element); 137 | expect(spec.verticalPosition).to.equal(verticalPosition); 138 | }); 139 | 140 | it(@"should be possible to define relative horizontal and vertical positions for the element", ^{ 141 | id element = data[@"element"]; 142 | ASRelativeLayoutSpecPosition horizontalPosition = ASRelativeLayoutSpecPositionCenter; 143 | ASRelativeLayoutSpecPosition verticalPosition = ASRelativeLayoutSpecPositionCenter; 144 | 145 | ASRelativeLayoutSpec *spec = asdkfe_invokeSelectorBinary(element, @selector(withRelativePositionHorizontal:vertical:), &horizontalPosition, &verticalPosition); 146 | 147 | expect(spec).beInstanceOf([ASRelativeLayoutSpec class]); 148 | expect(spec.child).to.equal(element); 149 | expect(spec.horizontalPosition).to.equal(horizontalPosition); 150 | expect(spec.verticalPosition).to.equal(verticalPosition); 151 | }); 152 | 153 | it(@"should be possible to define relative horizontal and vertical positions for the element with sizing options", ^{ 154 | id element = data[@"element"]; 155 | ASRelativeLayoutSpecPosition horizontalPosition = ASRelativeLayoutSpecPositionCenter; 156 | ASRelativeLayoutSpecPosition verticalPosition = ASRelativeLayoutSpecPositionCenter; 157 | ASRelativeLayoutSpecSizingOption sizingOption = ASRelativeLayoutSpecSizingOptionMinimumSize; 158 | 159 | ASRelativeLayoutSpec *spec = asdkfe_invokeSelectorTernary(element, @selector(withRelativePositionHorizontal:vertical:sizing:), &horizontalPosition, &verticalPosition, &sizingOption); 160 | 161 | expect(spec).beInstanceOf([ASRelativeLayoutSpec class]); 162 | expect(spec.child).to.equal(element); 163 | expect(spec.horizontalPosition).to.equal(horizontalPosition); 164 | expect(spec.verticalPosition).to.equal(verticalPosition); 165 | expect(spec.sizingOption).to.equal(sizingOption); 166 | }); 167 | 168 | }); 169 | 170 | SharedExamplesEnd 171 | 172 | 173 | SpecBegin(ASDisplayNode_FluentLayout) 174 | 175 | itShouldBehaveLike(@"ASLayoutElement_FluentLayout", @{@"element" : [[ASDisplayNode alloc] init]}); 176 | 177 | SpecEnd 178 | 179 | 180 | SpecBegin(ASLayoutSpec_FluentLayout) 181 | 182 | itShouldBehaveLike(@"ASLayoutElement_FluentLayout", @{@"element" : [[ASLayoutSpec alloc] init]}); 183 | 184 | SpecEnd 185 | 186 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ASDKFluentExtensions 2 | 3 | 4 | ASDKFluentExtensions is a set of Objective-C categories that extends [Texture](https://github.com/texturegroup/texture) with a fluent interface for layout code. This fluent style is more visual, improves readability (less visual scanning to grasp layout structure), and makes layout more concise and easier to maintain. It also enables **composition** of layout specs and styling. 5 | 6 | Imagine you want to overlay an image with a gradient. Then overlay the gradient with a title that must be positioned in the bottom right corner of the gradient, with some insets. Finally, the whole thing should have an aspect ratio of 1. With ASDKFluentExtensions you can write layout code like this: 7 | 8 | ```swift 9 | override func layoutSpecThatFits(_ constrainedSize: ASSizeRange) -> ASLayoutSpec { 10 | return imageNode 11 | .withOverlay(gradientNode 12 | .withOverlay(titleNode 13 | .withRelativePosition(horizontal: .end, vertical: .end) 14 | .withInset(UIEdgeInsetsMake(.infinity, .infinity, 4, 4)))) 15 | .withRatio(1) 16 | } 17 | ``` 18 | 19 | Both `ASDisplayNode` and `ASLayoutSpec` subclasses can be wrapped within an `ASLayoutSpec` using this fluent syntax. Just start typing `.with` and look for the appropriate completion: 20 | 21 | ![autocompletion with](Docs/ASDKFluentExtensionsUsageDemo.gif) 22 | 23 | All ASDKFluentExtensions methods return an object conforming to `ASLayoutElement`, so fluent layouts can be chained together. Furthermore, modifications of the `style` property can also be composed with layout definitions. This way the information flows in a meaningful order. Look at the modifications of `flexGrow` and `alignSelf` in the following example: 24 | 25 | ```swift 26 | func layoutSpecThatFits(_ constrainedSize: ASSizeRange) -> ASLayoutSpec { 27 | return ASStackLayoutSpec 28 | .vertical() 29 | .withSpacing(20) 30 | .withJustifyContent(.center) 31 | .withChildren([ 32 | topSeparator 33 | .withFlexGrow(1.0), 34 | textNode 35 | .withAlignSelf(.center), 36 | bottomSeparator 37 | .withFlexGrow(1.0) 38 | ]) 39 | .withInset(UIEdgeInsets(top: 60, left: 0, bottom: 60, right: 0)) 40 | } 41 | ``` 42 | 43 | ASDKFluentExtensions also provide categories over `ASStackLayoutSpec` and `ASAbsoluteLayoutSpec` which makes it possible to inline these specs in layout code with a very readable style: 44 | 45 | ```swift 46 | func fluentLayoutSpecThatFits(_ constrainedSize: ASSizeRange) -> ASLayoutSpec { 47 | return ASAbsoluteLayoutSpec() 48 | .withSizing(.sizeToFit) 49 | .withChildren([ 50 | photoNode 51 | .withPreferredSize(CGSize(width: 150, height: 150)) 52 | .withLayoutPosition(CGPoint(x: 40 / 2.0, y: 40 / 2.0)), 53 | iconNode 54 | .withPreferredSize(CGSize(width: 40, height: 40)) 55 | .withLayoutPosition(CGPoint(x: 150, y: 0))]) 56 | } 57 | ``` 58 | 59 | There is even a category to conveniently create spacers! 60 | 61 | ```swift 62 | let header = ASStackLayoutSpec().withChildren([userName, ASLayoutSpec.spacer(), lastTimeOnline]) 63 | ``` 64 | 65 | Finally, this is a more contrived example, the layout code of `PhotoTableNodeCell` from the well known [ASDKgram-Swift](https://github.com/TextureGroup/Texture/tree/master/examples_extra/ASDKgram-Swift) example rewritten to use fluent layout: 66 | 67 | ```swift 68 | func layoutSpecThatFits(_ constrainedSize: ASSizeRange) -> ASLayoutSpec { 69 | return ASStackLayoutSpec 70 | .vertical() 71 | .withChildren([ 72 | ASStackLayoutSpec() 73 | .withAlignItems(.center) 74 | .withChildren([ 75 | avatarImageNode 76 | .withPreferredSize(CGSize(width: Constants.CellLayout.UserImageHeight, height: Constants.CellLayout.UserImageHeight)) 77 | .withInset(Constants.CellLayout.InsetForAvatar), 78 | usernameLabel 79 | .withFlexShrink(1), 80 | ASLayoutSpec.spacer(), 81 | timeIntervalLabel 82 | .withSpacingBefore(Constants.CellLayout.HorizontalBuffer) 83 | ]) 84 | .withInset(Constants.CellLayout.InsetForHeader), 85 | 86 | photoImageNode.withRatio(1), 87 | 88 | ASStackLayoutSpec 89 | .vertical() 90 | .withSpacing(Constants.CellLayout.VerticalBuffer) 91 | .withChildren([ 92 | photoLikesLabel, 93 | photoDescriptionLabel]) 94 | .withInset(Constants.CellLayout.InsetForFooter) 95 | ]) 96 | } 97 | ``` 98 | 99 | This layout reads from top to bottom without interruptions. The outermost code define the general structure, and inner parts define the details. The information flows in a meaningful order, so less visual scanning is needed. Also, it is much faster to add, remove, and reorganize specs, for example during debugging or prototyping. Finally, note how modifications of style properties are composable with layout specs (see usages of `withPreferredSize` or `withFlexShrink` inline with layout specs definition). This avoids interruptions on how the code visually flows. 100 | 101 | ### More About Fluent Interfaces 102 | 103 | If you want to know more about Fluent API's, make sure to check [this paper](https://martinfowler.com/bliki/FluentInterface.html) in which Martin Fowler and Eric Evans coined the term. 104 | 105 | 106 | ## Documentation 107 | 108 | There are a several examples on how to use ASDKFluentExtensions to write fluent layout code available in this [fork of Texture](https://github.com/cesteban/Texture/tree/fluent-extensions). They are clones of existing examples included in the main Texture repo, modified to illustrate ASDKFluentExtensions. The idea is that people wanting to approach this fluent syntax can have a set of familiar examples to look at. 109 | 110 | This is the list of currently available examples: 111 | 112 | - [ASDKgram-Swift](https://github.com/cesteban/Texture/tree/fluent-extensions/examples_extra/ASDKgram-Swift) 113 | - [LayoutSpecExamples-Swift](https://github.com/cesteban/Texture/tree/fluent-extensions/examples/LayoutSpecExamples-Swift) 114 | - [LayoutSpecExamples](https://github.com/cesteban/Texture/tree/fluent-extensions/examples/LayoutSpecExamples) 115 | - [ASViewController](https://github.com/cesteban/Texture/tree/fluent-extensions/examples/ASViewController) 116 | - [ASMapNode](https://github.com/cesteban/Texture/tree/fluent-extensions/examples/ASMapNode) 117 | - [ASDKTube](https://github.com/cesteban/Texture/tree/fluent-extensions/examples/ASDKTube) 118 | - [ASDKLayoutTransition](https://github.com/cesteban/Texture/tree/fluent-extensions/examples/ASDKLayoutTransition) 119 | - [ASCollectionView](https://github.com/cesteban/Texture/tree/fluent-extensions/examples/ASCollectionView) 120 | - [ASDKgram](https://github.com/cesteban/Texture/tree/fluent-extensions/examples/ASDKgram) 121 | 122 | 123 | ## Installation 124 | 125 | ASDKFluentExtensions currently support Cocoapods and Carthage. 126 | 127 | ### Cocoapods 128 | 129 | You can install ASDKFluentExtensions using CocoaPods. Add the pod to your Podfile: 130 | 131 | ``` 132 | target 'MyApp' do 133 | pod "ASDKFluentExtensions" 134 | end 135 | ``` 136 | 137 | Then run the following command: 138 | 139 | ``` 140 | $ pod install 141 | ``` 142 | 143 | Make sure to import the header: 144 | 145 | ``` 146 | #import 147 | ``` 148 | 149 | ### Carthage 150 | 151 | From version 0.6 you can build ASDKFluentExtensions using Carthage. Add the following line to your Cartfile: 152 | 153 | ``` 154 | github "cesteban/ASDKFluentExtensions" >= 0.6 155 | ``` 156 | 157 | Then build the framework: 158 | 159 | ``` 160 | carthage update 161 | ``` 162 | 163 | Finally, add the generated framework to your project as usual. 164 | 165 | 166 | ## Discussion 167 | 168 | ASDKFluentExtensions are just a bunch of Objective-C categories over `ASDisplayNode`, `ASLayoutSpec`, `ASStackLayoutSpec`, and `ASAbsoluteLayoutSpec` that create and return the desired layout spec passing `self` as child: 169 | 170 | ```objective-c 171 | - (ASOverlayLayoutSpec *)withOverlay:(id)overlay 172 | { 173 | return [ASOverlayLayoutSpec overlayLayoutSpecWithChild:self overlay:overlay]; 174 | } 175 | ``` 176 | 177 | ASDKFluentExtensions also offer categories to modify `style` properties of the `ASDisplayNode` or `ASLayoutSpec` returning `self`: 178 | 179 | ```objective-c 180 | - (instancetype)withPreferredSize:(CGSize)preferredSize 181 | { 182 | self.style.preferredSize = preferredSize; 183 | return self; 184 | } 185 | ``` 186 | 187 | This makes layout and styling **composable**, and enables a very readable fluent API. 188 | 189 | 190 | ### Code Duplication and Swift Protocol Extensions 191 | 192 | There is a lot of code duplication in order to provide the same functionality for both `ASDisplayNode` and `ASLayoutSpec`. 193 | 194 | This could be avoided in Swift using protocol extensions over `ASLayoutElement`, but then the API won't be available from Objective-C. On the other hand, `Texture` is a pure Objective-C framework, so extending it in Swift would introduce limitations. Check [here](https://gist.github.com/cesteban/e5d265989ed319c0f83bfda3bffdcf8c) the original Swift implementation of ASDKFluentExtensions, very early abandoned in favor of the current Objective-C API. 195 | 196 | 197 | ## Contribute 198 | 199 | Send all the feedback you have, and please contribute. Pull Requests and suggestions on how to improve this component are very much appreciated. 200 | -------------------------------------------------------------------------------- /Tests/ASLayoutElement+FluentStylingTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // ASLayoutElement+FluentStylingTests.m 3 | // ASDKFluentExtensions 4 | // 5 | // Created by César Estébanez Tascón on 21/05/2017. 6 | // Copyright © 2017 Cesar Estebanez Tascon. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | #import 12 | 13 | #import "ASDisplayNode+FluentStyling.h" 14 | #import "ASLayoutSpec+FluentStyling.h" 15 | #import "Helpers.h" 16 | 17 | SharedExamplesBegin(ASLayoutElement_FluentStyling) 18 | 19 | sharedExamplesFor(@"ASLayoutElement_FluentSizing", ^(NSDictionary *data) { 20 | 21 | it(@"should be able to fluently modify style.with", ^{ 22 | id element = data[@"element"]; 23 | ASDimension width = ASDimensionMake(10); 24 | 25 | asdkfe_invokeSelectorUnary(element, @selector(withWidth:), &width); 26 | 27 | expect(ASDimensionEqualToDimension(element.style.width, width)).to.beTruthy(); 28 | }); 29 | 30 | it(@"should be able to fluently modify style.height", ^{ 31 | id element = data[@"element"]; 32 | ASDimension height = ASDimensionMake(10); 33 | 34 | asdkfe_invokeSelectorUnary(element, @selector(withHeight:), &height); 35 | 36 | expect(ASDimensionEqualToDimension(element.style.height, height)).to.beTruthy(); 37 | }); 38 | 39 | it(@"should be able to fluently modify style.minWidth", ^{ 40 | id element = data[@"element"]; 41 | ASDimension minWidth = ASDimensionMake(10); 42 | 43 | asdkfe_invokeSelectorUnary(element, @selector(withMinWidth:), &minWidth); 44 | 45 | expect(ASDimensionEqualToDimension(element.style.minWidth, minWidth)).to.beTruthy(); 46 | }); 47 | 48 | it(@"should be able to fluently modify style.maxWidth", ^{ 49 | id element = data[@"element"]; 50 | ASDimension maxWidth = ASDimensionMake(10); 51 | 52 | asdkfe_invokeSelectorUnary(element, @selector(withMaxWidth:), &maxWidth); 53 | 54 | expect(ASDimensionEqualToDimension(element.style.maxWidth, maxWidth)).to.beTruthy(); 55 | }); 56 | 57 | it(@"should be able to fluently modify style.minHeight", ^{ 58 | id element = data[@"element"]; 59 | ASDimension minHeight = ASDimensionMake(10); 60 | 61 | asdkfe_invokeSelectorUnary(element, @selector(withMinHeight:), &minHeight); 62 | 63 | expect(ASDimensionEqualToDimension(element.style.minHeight, minHeight)).to.beTruthy(); 64 | }); 65 | 66 | it(@"should be able to fluently modify style.maxHeight", ^{ 67 | id element = data[@"element"]; 68 | ASDimension maxHeight = ASDimensionMake(10); 69 | 70 | asdkfe_invokeSelectorUnary(element, @selector(withMaxHeight:), &maxHeight); 71 | 72 | expect(ASDimensionEqualToDimension(element.style.maxHeight, maxHeight)).to.beTruthy(); 73 | }); 74 | 75 | }); 76 | 77 | 78 | sharedExamplesFor(@"ASLayoutElement_FluentSizeHelpers", ^(NSDictionary *data) { 79 | 80 | it(@"should be able to fluently modify style.preferredSize", ^{ 81 | id element = data[@"element"]; 82 | CGSize size = CGSizeMake(10, 10); 83 | 84 | asdkfe_invokeSelectorUnary(element, @selector(withPreferredSize:), &size); 85 | 86 | expect(expect(CGSizeEqualToSize(element.style.preferredSize, size))).to.beTruthy(); 87 | }); 88 | 89 | it(@"should be able to fluently modify style.minSize", ^{ 90 | id element = data[@"element"]; 91 | CGSize size = CGSizeMake(10, 10); 92 | 93 | asdkfe_invokeSelectorUnary(element, @selector(withMinSize:), &size); 94 | 95 | expect(ASDimensionEqualToDimension(element.style.minWidth, ASDimensionMakeWithPoints(size.width))).to.beTruthy(); 96 | expect(ASDimensionEqualToDimension(element.style.minHeight, ASDimensionMakeWithPoints(size.height))).to.beTruthy(); 97 | }); 98 | 99 | it(@"should be able to fluently modify style.maxSize", ^{ 100 | id element = data[@"element"]; 101 | CGSize size = CGSizeMake(10, 10); 102 | 103 | asdkfe_invokeSelectorUnary(element, @selector(withMaxSize:), &size); 104 | 105 | expect(ASDimensionEqualToDimension(element.style.maxWidth, ASDimensionMakeWithPoints(size.width))).to.beTruthy(); 106 | expect(ASDimensionEqualToDimension(element.style.maxHeight, ASDimensionMakeWithPoints(size.height))).to.beTruthy(); 107 | }); 108 | 109 | it(@"should be able to fluently modify style.preferredLayoutSize", ^{ 110 | id element = data[@"element"]; 111 | ASLayoutSize layoutSize = ASLayoutSizeMake(ASDimensionMake(10), ASDimensionMake(10)); 112 | 113 | asdkfe_invokeSelectorUnary(element, @selector(withPreferredLayoutSize:), &layoutSize); 114 | 115 | expect(ASDimensionEqualToDimension(element.style.preferredLayoutSize.width, layoutSize.width)).to.beTruthy(); 116 | expect(ASDimensionEqualToDimension(element.style.preferredLayoutSize.height, layoutSize.height)).to.beTruthy(); 117 | }); 118 | 119 | it(@"should be able to fluently modify style.minLayoutSize", ^{ 120 | id element = data[@"element"]; 121 | ASLayoutSize layoutSize = ASLayoutSizeMake(ASDimensionMake(10), ASDimensionMake(10)); 122 | 123 | asdkfe_invokeSelectorUnary(element, @selector(withMinLayoutSize:), &layoutSize); 124 | 125 | expect(ASDimensionEqualToDimension(element.style.minLayoutSize.width, layoutSize.width)).to.beTruthy(); 126 | expect(ASDimensionEqualToDimension(element.style.minLayoutSize.height, layoutSize.height)).to.beTruthy(); 127 | }); 128 | 129 | it(@"should be able to fluently modify style.maxLayoutSize", ^{ 130 | id element = data[@"element"]; 131 | ASLayoutSize layoutSize = ASLayoutSizeMake(ASDimensionMake(10), ASDimensionMake(10)); 132 | 133 | asdkfe_invokeSelectorUnary(element, @selector(withMaxLayoutSize:), &layoutSize); 134 | 135 | expect(ASDimensionEqualToDimension(element.style.maxLayoutSize.width, layoutSize.width)).to.beTruthy(); 136 | expect(ASDimensionEqualToDimension(element.style.maxLayoutSize.height, layoutSize.height)).to.beTruthy(); 137 | }); 138 | 139 | }); 140 | 141 | sharedExamplesFor(@"ASLayoutElement_FluentStackLayoutElement", ^(NSDictionary *data) { 142 | 143 | it(@"should be able to fluently modify style.spacingBefore", ^{ 144 | id element = data[@"element"]; 145 | CGFloat spacingBefore = 10; 146 | 147 | asdkfe_invokeSelectorUnary(element, @selector(withSpacingBefore:), &spacingBefore); 148 | 149 | expect(element.style.spacingBefore).to.equal(spacingBefore); 150 | }); 151 | 152 | it(@"should be able to fluently modify style.spacingAfter", ^{ 153 | id element = data[@"element"]; 154 | CGFloat spacingAfter = 10; 155 | 156 | asdkfe_invokeSelectorUnary(element, @selector(withSpacingAfter:), &spacingAfter); 157 | 158 | expect(element.style.spacingAfter).to.equal(spacingAfter); 159 | }); 160 | 161 | it(@"should be able to fluently modify style.flexGrow", ^{ 162 | id element = data[@"element"]; 163 | CGFloat flexGrow = 1; 164 | 165 | asdkfe_invokeSelectorUnary(element, @selector(withFlexGrow:), &flexGrow); 166 | 167 | expect(element.style.flexGrow).to.equal(flexGrow); 168 | }); 169 | 170 | it(@"should be able to fluently modify style.flexShrink", ^{ 171 | id element = data[@"element"]; 172 | CGFloat flexShrink = 1; 173 | 174 | asdkfe_invokeSelectorUnary(element, @selector(withFlexShrink:), &flexShrink); 175 | 176 | expect(element.style.flexShrink).to.equal(flexShrink); 177 | }); 178 | 179 | 180 | it(@"should be able to fluently modify style.flexBasis", ^{ 181 | id element = data[@"element"]; 182 | ASDimension flexBasis = ASDimensionMake(10); 183 | 184 | asdkfe_invokeSelectorUnary(element, @selector(withFlexBasis:), &flexBasis); 185 | 186 | expect(ASDimensionEqualToDimension(element.style.flexBasis, flexBasis)); 187 | }); 188 | 189 | it(@"should be able to fluently modify style.alignSelf", ^{ 190 | id element = data[@"element"]; 191 | ASStackLayoutAlignSelf alignSelf = ASStackLayoutAlignSelfCenter; 192 | 193 | asdkfe_invokeSelectorUnary(element, @selector(withAlignSelf:), &alignSelf); 194 | 195 | expect(element.style.alignSelf).to.equal(alignSelf); 196 | }); 197 | 198 | 199 | it(@"should be able to fluently modify style.ascender", ^{ 200 | id element = data[@"element"]; 201 | CGFloat ascender = 10; 202 | 203 | asdkfe_invokeSelectorUnary(element, @selector(withAscender:), &ascender); 204 | 205 | expect(element.style.ascender).to.equal(ascender); 206 | }); 207 | 208 | it(@"should be able to fluently modify style.descender", ^{ 209 | id element = data[@"element"]; 210 | CGFloat descender = 10; 211 | 212 | asdkfe_invokeSelectorUnary(element, @selector(withDescender:), &descender); 213 | 214 | expect(element.style.descender).to.equal(descender); 215 | }); 216 | 217 | }); 218 | 219 | SharedExamplesEnd 220 | 221 | 222 | SpecBegin(ASDisplayNode_FluentStyling) 223 | 224 | itShouldBehaveLike(@"ASLayoutElement_FluentSizing", @{@"element": [[ASDisplayNode alloc] init]}); 225 | itShouldBehaveLike(@"ASLayoutElement_FluentSizeHelpers", @{@"element": [[ASDisplayNode alloc] init]}); 226 | itShouldBehaveLike(@"ASLayoutElement_FluentStackLayoutElement", @{@"element": [[ASDisplayNode alloc] init]}); 227 | 228 | SpecEnd 229 | 230 | 231 | SpecBegin(ASLayoutSpec_FluentStyling) 232 | 233 | itShouldBehaveLike(@"ASLayoutElement_FluentSizing", @{@"element": [[ASLayoutSpec alloc] init]}); 234 | itShouldBehaveLike(@"ASLayoutElement_FluentSizeHelpers", @{@"element": [[ASLayoutSpec alloc] init]}); 235 | itShouldBehaveLike(@"ASLayoutElement_FluentStackLayoutElement", @{@"element": [[ASLayoutSpec alloc] init]}); 236 | 237 | SpecEnd 238 | 239 | -------------------------------------------------------------------------------- /ASDKFluentExtensions.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 4E3CCD9E1F0C2D29006FA3B7 /* ASLayoutSpec+FluentChildren.h in Headers */ = {isa = PBXBuildFile; fileRef = 4E3CCD9C1F0C2D29006FA3B7 /* ASLayoutSpec+FluentChildren.h */; settings = {ATTRIBUTES = (Public, ); }; }; 11 | 4E3CCD9F1F0C2D29006FA3B7 /* ASLayoutSpec+FluentChildren.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E3CCD9D1F0C2D29006FA3B7 /* ASLayoutSpec+FluentChildren.m */; }; 12 | 4E3CCDA11F0C2D7A006FA3B7 /* ASLayoutSpec+FluentChildrenTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E3CCDA01F0C2D7A006FA3B7 /* ASLayoutSpec+FluentChildrenTests.m */; }; 13 | 4E4C2C461E88385C006703D5 /* ASDKFluentExtensions.h in Headers */ = {isa = PBXBuildFile; fileRef = 4E4C2C451E88385C006703D5 /* ASDKFluentExtensions.h */; settings = {ATTRIBUTES = (Public, ); }; }; 14 | 4E4C2C501E8838FA006703D5 /* ASDisplayNode+FluentLayout.h in Headers */ = {isa = PBXBuildFile; fileRef = 4E4C2C4A1E8838FA006703D5 /* ASDisplayNode+FluentLayout.h */; settings = {ATTRIBUTES = (Public, ); }; }; 15 | 4E4C2C511E8838FA006703D5 /* ASDisplayNode+FluentLayout.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E4C2C4B1E8838FA006703D5 /* ASDisplayNode+FluentLayout.m */; }; 16 | 4E4C2C521E8838FA006703D5 /* ASLayoutSpec+FluentLayout.h in Headers */ = {isa = PBXBuildFile; fileRef = 4E4C2C4C1E8838FA006703D5 /* ASLayoutSpec+FluentLayout.h */; settings = {ATTRIBUTES = (Public, ); }; }; 17 | 4E4C2C531E8838FA006703D5 /* ASLayoutSpec+FluentLayout.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E4C2C4D1E8838FA006703D5 /* ASLayoutSpec+FluentLayout.m */; }; 18 | 4E4C2C541E8838FA006703D5 /* ASStackLayoutSpec+FluentLayout.h in Headers */ = {isa = PBXBuildFile; fileRef = 4E4C2C4E1E8838FA006703D5 /* ASStackLayoutSpec+FluentLayout.h */; settings = {ATTRIBUTES = (Public, ); }; }; 19 | 4E4C2C551E8838FA006703D5 /* ASStackLayoutSpec+FluentLayout.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E4C2C4F1E8838FA006703D5 /* ASStackLayoutSpec+FluentLayout.m */; }; 20 | 4E4C2C581E883AE1006703D5 /* ASDisplayNode+FluentStyling.h in Headers */ = {isa = PBXBuildFile; fileRef = 4E4C2C561E883AE1006703D5 /* ASDisplayNode+FluentStyling.h */; settings = {ATTRIBUTES = (Public, ); }; }; 21 | 4E4C2C591E883AE1006703D5 /* ASDisplayNode+FluentStyling.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E4C2C571E883AE1006703D5 /* ASDisplayNode+FluentStyling.m */; }; 22 | 4E4C2C5C1E883B54006703D5 /* ASLayoutSpec+FluentStyling.h in Headers */ = {isa = PBXBuildFile; fileRef = 4E4C2C5A1E883B54006703D5 /* ASLayoutSpec+FluentStyling.h */; settings = {ATTRIBUTES = (Public, ); }; }; 23 | 4E4C2C5D1E883B54006703D5 /* ASLayoutSpec+FluentStyling.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E4C2C5B1E883B54006703D5 /* ASLayoutSpec+FluentStyling.m */; }; 24 | 4E54E6CF1ECA3F0600D5A7B8 /* ASAbsoluteLayoutSpec+FluentLayout.h in Headers */ = {isa = PBXBuildFile; fileRef = 4E54E6CD1ECA3F0600D5A7B8 /* ASAbsoluteLayoutSpec+FluentLayout.h */; settings = {ATTRIBUTES = (Public, ); }; }; 25 | 4E54E6D01ECA3F0600D5A7B8 /* ASAbsoluteLayoutSpec+FluentLayout.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E54E6CE1ECA3F0600D5A7B8 /* ASAbsoluteLayoutSpec+FluentLayout.m */; }; 26 | 4E5563F11E88370D00EF65A8 /* ASDKFluentExtensions.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4E5563E71E88370D00EF65A8 /* ASDKFluentExtensions.framework */; }; 27 | 4E72732C1ED1D1A200C46520 /* ASLayoutElement+FluentStylingTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E72732B1ED1D1A200C46520 /* ASLayoutElement+FluentStylingTests.m */; }; 28 | 4E72732E1ED1D9B900C46520 /* Helpers.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E72732D1ED1D9B900C46520 /* Helpers.m */; }; 29 | 4E7273301ED1EF4B00C46520 /* ASStackLayoutSpec+FluentLayoutTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E72732F1ED1EF4B00C46520 /* ASStackLayoutSpec+FluentLayoutTests.m */; }; 30 | 4E7273321ED1EF9300C46520 /* ASLayoutSpec+FluentSpacerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E7273311ED1EF9300C46520 /* ASLayoutSpec+FluentSpacerTests.m */; }; 31 | 4E7273341ED1F52700C46520 /* ASAbsoluteLayoutSpec+FluentLayoutTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E7273331ED1F52700C46520 /* ASAbsoluteLayoutSpec+FluentLayoutTests.m */; }; 32 | 4EA3020D1E8FB75A0081A61B /* ASLayoutSpec+FluentSpacer.h in Headers */ = {isa = PBXBuildFile; fileRef = 4EA3020B1E8FB75A0081A61B /* ASLayoutSpec+FluentSpacer.h */; settings = {ATTRIBUTES = (Public, ); }; }; 33 | 4EA3020E1E8FB75A0081A61B /* ASLayoutSpec+FluentSpacer.m in Sources */ = {isa = PBXBuildFile; fileRef = 4EA3020C1E8FB75A0081A61B /* ASLayoutSpec+FluentSpacer.m */; }; 34 | 4EB03EDE1ED04F660036DF80 /* AsyncDisplayKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4EC0F5E21ECBC95900260159 /* AsyncDisplayKit.framework */; }; 35 | 4EB03EE11ED05D640036DF80 /* Expecta.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4EB03EDF1ED05D640036DF80 /* Expecta.framework */; }; 36 | 4EB03EE21ED05D640036DF80 /* Specta.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4EB03EE01ED05D640036DF80 /* Specta.framework */; }; 37 | 4EB03EE41ED05DB60036DF80 /* ASLayoutElement+FluentLayoutTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 4EB03EE31ED05DB60036DF80 /* ASLayoutElement+FluentLayoutTests.m */; }; 38 | 4EC0F5E31ECBC95900260159 /* AsyncDisplayKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4EC0F5E21ECBC95900260159 /* AsyncDisplayKit.framework */; }; 39 | /* End PBXBuildFile section */ 40 | 41 | /* Begin PBXContainerItemProxy section */ 42 | 4E5563F21E88370D00EF65A8 /* PBXContainerItemProxy */ = { 43 | isa = PBXContainerItemProxy; 44 | containerPortal = 4E5563DE1E88370D00EF65A8 /* Project object */; 45 | proxyType = 1; 46 | remoteGlobalIDString = 4E5563E61E88370D00EF65A8; 47 | remoteInfo = ASDKFluentExtensions; 48 | }; 49 | /* End PBXContainerItemProxy section */ 50 | 51 | /* Begin PBXFileReference section */ 52 | 4E3CCD9C1F0C2D29006FA3B7 /* ASLayoutSpec+FluentChildren.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "ASLayoutSpec+FluentChildren.h"; sourceTree = ""; }; 53 | 4E3CCD9D1F0C2D29006FA3B7 /* ASLayoutSpec+FluentChildren.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "ASLayoutSpec+FluentChildren.m"; sourceTree = ""; }; 54 | 4E3CCDA01F0C2D7A006FA3B7 /* ASLayoutSpec+FluentChildrenTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "ASLayoutSpec+FluentChildrenTests.m"; sourceTree = ""; }; 55 | 4E4C2C451E88385C006703D5 /* ASDKFluentExtensions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASDKFluentExtensions.h; sourceTree = ""; }; 56 | 4E4C2C481E883874006703D5 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 57 | 4E4C2C4A1E8838FA006703D5 /* ASDisplayNode+FluentLayout.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "ASDisplayNode+FluentLayout.h"; sourceTree = ""; }; 58 | 4E4C2C4B1E8838FA006703D5 /* ASDisplayNode+FluentLayout.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "ASDisplayNode+FluentLayout.m"; sourceTree = ""; }; 59 | 4E4C2C4C1E8838FA006703D5 /* ASLayoutSpec+FluentLayout.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "ASLayoutSpec+FluentLayout.h"; sourceTree = ""; }; 60 | 4E4C2C4D1E8838FA006703D5 /* ASLayoutSpec+FluentLayout.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "ASLayoutSpec+FluentLayout.m"; sourceTree = ""; }; 61 | 4E4C2C4E1E8838FA006703D5 /* ASStackLayoutSpec+FluentLayout.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "ASStackLayoutSpec+FluentLayout.h"; sourceTree = ""; }; 62 | 4E4C2C4F1E8838FA006703D5 /* ASStackLayoutSpec+FluentLayout.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "ASStackLayoutSpec+FluentLayout.m"; sourceTree = ""; }; 63 | 4E4C2C561E883AE1006703D5 /* ASDisplayNode+FluentStyling.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "ASDisplayNode+FluentStyling.h"; sourceTree = ""; }; 64 | 4E4C2C571E883AE1006703D5 /* ASDisplayNode+FluentStyling.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "ASDisplayNode+FluentStyling.m"; sourceTree = ""; }; 65 | 4E4C2C5A1E883B54006703D5 /* ASLayoutSpec+FluentStyling.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "ASLayoutSpec+FluentStyling.h"; sourceTree = ""; }; 66 | 4E4C2C5B1E883B54006703D5 /* ASLayoutSpec+FluentStyling.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "ASLayoutSpec+FluentStyling.m"; sourceTree = ""; }; 67 | 4E54E6CD1ECA3F0600D5A7B8 /* ASAbsoluteLayoutSpec+FluentLayout.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "ASAbsoluteLayoutSpec+FluentLayout.h"; sourceTree = ""; }; 68 | 4E54E6CE1ECA3F0600D5A7B8 /* ASAbsoluteLayoutSpec+FluentLayout.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "ASAbsoluteLayoutSpec+FluentLayout.m"; sourceTree = ""; }; 69 | 4E5563E71E88370D00EF65A8 /* ASDKFluentExtensions.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = ASDKFluentExtensions.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 70 | 4E5563F01E88370D00EF65A8 /* ASDKFluentExtensionsTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ASDKFluentExtensionsTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 71 | 4E5563F71E88370D00EF65A8 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 72 | 4E72732A1ED1D13400C46520 /* Helpers.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Helpers.h; sourceTree = ""; }; 73 | 4E72732B1ED1D1A200C46520 /* ASLayoutElement+FluentStylingTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "ASLayoutElement+FluentStylingTests.m"; sourceTree = ""; }; 74 | 4E72732D1ED1D9B900C46520 /* Helpers.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Helpers.m; sourceTree = ""; }; 75 | 4E72732F1ED1EF4B00C46520 /* ASStackLayoutSpec+FluentLayoutTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "ASStackLayoutSpec+FluentLayoutTests.m"; sourceTree = ""; }; 76 | 4E7273311ED1EF9300C46520 /* ASLayoutSpec+FluentSpacerTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "ASLayoutSpec+FluentSpacerTests.m"; sourceTree = ""; }; 77 | 4E7273331ED1F52700C46520 /* ASAbsoluteLayoutSpec+FluentLayoutTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "ASAbsoluteLayoutSpec+FluentLayoutTests.m"; sourceTree = ""; }; 78 | 4EA3020B1E8FB75A0081A61B /* ASLayoutSpec+FluentSpacer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "ASLayoutSpec+FluentSpacer.h"; sourceTree = ""; }; 79 | 4EA3020C1E8FB75A0081A61B /* ASLayoutSpec+FluentSpacer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "ASLayoutSpec+FluentSpacer.m"; sourceTree = ""; }; 80 | 4EB03EDF1ED05D640036DF80 /* Expecta.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Expecta.framework; path = Carthage/Build/iOS/Expecta.framework; sourceTree = ""; }; 81 | 4EB03EE01ED05D640036DF80 /* Specta.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Specta.framework; path = Carthage/Build/iOS/Specta.framework; sourceTree = ""; }; 82 | 4EB03EE31ED05DB60036DF80 /* ASLayoutElement+FluentLayoutTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "ASLayoutElement+FluentLayoutTests.m"; sourceTree = ""; }; 83 | 4EC0F5E21ECBC95900260159 /* AsyncDisplayKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AsyncDisplayKit.framework; path = Carthage/Build/iOS/AsyncDisplayKit.framework; sourceTree = ""; }; 84 | /* End PBXFileReference section */ 85 | 86 | /* Begin PBXFrameworksBuildPhase section */ 87 | 4E5563E31E88370D00EF65A8 /* Frameworks */ = { 88 | isa = PBXFrameworksBuildPhase; 89 | buildActionMask = 2147483647; 90 | files = ( 91 | 4EC0F5E31ECBC95900260159 /* AsyncDisplayKit.framework in Frameworks */, 92 | ); 93 | runOnlyForDeploymentPostprocessing = 0; 94 | }; 95 | 4E5563ED1E88370D00EF65A8 /* Frameworks */ = { 96 | isa = PBXFrameworksBuildPhase; 97 | buildActionMask = 2147483647; 98 | files = ( 99 | 4E5563F11E88370D00EF65A8 /* ASDKFluentExtensions.framework in Frameworks */, 100 | 4EB03EDE1ED04F660036DF80 /* AsyncDisplayKit.framework in Frameworks */, 101 | 4EB03EE11ED05D640036DF80 /* Expecta.framework in Frameworks */, 102 | 4EB03EE21ED05D640036DF80 /* Specta.framework in Frameworks */, 103 | ); 104 | runOnlyForDeploymentPostprocessing = 0; 105 | }; 106 | /* End PBXFrameworksBuildPhase section */ 107 | 108 | /* Begin PBXGroup section */ 109 | 4E4C2C441E88385C006703D5 /* Source */ = { 110 | isa = PBXGroup; 111 | children = ( 112 | 4E4C2C451E88385C006703D5 /* ASDKFluentExtensions.h */, 113 | 4E4C2C4A1E8838FA006703D5 /* ASDisplayNode+FluentLayout.h */, 114 | 4E4C2C4B1E8838FA006703D5 /* ASDisplayNode+FluentLayout.m */, 115 | 4E4C2C4C1E8838FA006703D5 /* ASLayoutSpec+FluentLayout.h */, 116 | 4E4C2C4D1E8838FA006703D5 /* ASLayoutSpec+FluentLayout.m */, 117 | 4E3CCD9C1F0C2D29006FA3B7 /* ASLayoutSpec+FluentChildren.h */, 118 | 4E3CCD9D1F0C2D29006FA3B7 /* ASLayoutSpec+FluentChildren.m */, 119 | 4E4C2C561E883AE1006703D5 /* ASDisplayNode+FluentStyling.h */, 120 | 4E4C2C571E883AE1006703D5 /* ASDisplayNode+FluentStyling.m */, 121 | 4E4C2C5A1E883B54006703D5 /* ASLayoutSpec+FluentStyling.h */, 122 | 4E4C2C5B1E883B54006703D5 /* ASLayoutSpec+FluentStyling.m */, 123 | 4EA3020B1E8FB75A0081A61B /* ASLayoutSpec+FluentSpacer.h */, 124 | 4EA3020C1E8FB75A0081A61B /* ASLayoutSpec+FluentSpacer.m */, 125 | 4E4C2C4E1E8838FA006703D5 /* ASStackLayoutSpec+FluentLayout.h */, 126 | 4E4C2C4F1E8838FA006703D5 /* ASStackLayoutSpec+FluentLayout.m */, 127 | 4E54E6CD1ECA3F0600D5A7B8 /* ASAbsoluteLayoutSpec+FluentLayout.h */, 128 | 4E54E6CE1ECA3F0600D5A7B8 /* ASAbsoluteLayoutSpec+FluentLayout.m */, 129 | ); 130 | path = Source; 131 | sourceTree = ""; 132 | }; 133 | 4E4C2C471E883874006703D5 /* Resources */ = { 134 | isa = PBXGroup; 135 | children = ( 136 | 4E4C2C481E883874006703D5 /* Info.plist */, 137 | ); 138 | path = Resources; 139 | sourceTree = ""; 140 | }; 141 | 4E5563DD1E88370D00EF65A8 = { 142 | isa = PBXGroup; 143 | children = ( 144 | 4E4C2C441E88385C006703D5 /* Source */, 145 | 4E5563F41E88370D00EF65A8 /* Tests */, 146 | 4E4C2C471E883874006703D5 /* Resources */, 147 | 4E5563E81E88370D00EF65A8 /* Products */, 148 | 4EC0F5E11ECBC95800260159 /* Frameworks */, 149 | ); 150 | sourceTree = ""; 151 | }; 152 | 4E5563E81E88370D00EF65A8 /* Products */ = { 153 | isa = PBXGroup; 154 | children = ( 155 | 4E5563E71E88370D00EF65A8 /* ASDKFluentExtensions.framework */, 156 | 4E5563F01E88370D00EF65A8 /* ASDKFluentExtensionsTests.xctest */, 157 | ); 158 | name = Products; 159 | sourceTree = ""; 160 | }; 161 | 4E5563F41E88370D00EF65A8 /* Tests */ = { 162 | isa = PBXGroup; 163 | children = ( 164 | 4E72732A1ED1D13400C46520 /* Helpers.h */, 165 | 4E72732D1ED1D9B900C46520 /* Helpers.m */, 166 | 4EB03EE31ED05DB60036DF80 /* ASLayoutElement+FluentLayoutTests.m */, 167 | 4E72732B1ED1D1A200C46520 /* ASLayoutElement+FluentStylingTests.m */, 168 | 4E3CCDA01F0C2D7A006FA3B7 /* ASLayoutSpec+FluentChildrenTests.m */, 169 | 4E7273311ED1EF9300C46520 /* ASLayoutSpec+FluentSpacerTests.m */, 170 | 4E72732F1ED1EF4B00C46520 /* ASStackLayoutSpec+FluentLayoutTests.m */, 171 | 4E7273331ED1F52700C46520 /* ASAbsoluteLayoutSpec+FluentLayoutTests.m */, 172 | 4E5563F71E88370D00EF65A8 /* Info.plist */, 173 | ); 174 | path = Tests; 175 | sourceTree = ""; 176 | }; 177 | 4EC0F5E11ECBC95800260159 /* Frameworks */ = { 178 | isa = PBXGroup; 179 | children = ( 180 | 4EB03EDF1ED05D640036DF80 /* Expecta.framework */, 181 | 4EB03EE01ED05D640036DF80 /* Specta.framework */, 182 | 4EC0F5E21ECBC95900260159 /* AsyncDisplayKit.framework */, 183 | ); 184 | name = Frameworks; 185 | sourceTree = ""; 186 | }; 187 | /* End PBXGroup section */ 188 | 189 | /* Begin PBXHeadersBuildPhase section */ 190 | 4E5563E41E88370D00EF65A8 /* Headers */ = { 191 | isa = PBXHeadersBuildPhase; 192 | buildActionMask = 2147483647; 193 | files = ( 194 | 4E4C2C541E8838FA006703D5 /* ASStackLayoutSpec+FluentLayout.h in Headers */, 195 | 4E4C2C461E88385C006703D5 /* ASDKFluentExtensions.h in Headers */, 196 | 4E4C2C581E883AE1006703D5 /* ASDisplayNode+FluentStyling.h in Headers */, 197 | 4E4C2C521E8838FA006703D5 /* ASLayoutSpec+FluentLayout.h in Headers */, 198 | 4E54E6CF1ECA3F0600D5A7B8 /* ASAbsoluteLayoutSpec+FluentLayout.h in Headers */, 199 | 4E4C2C5C1E883B54006703D5 /* ASLayoutSpec+FluentStyling.h in Headers */, 200 | 4E4C2C501E8838FA006703D5 /* ASDisplayNode+FluentLayout.h in Headers */, 201 | 4E3CCD9E1F0C2D29006FA3B7 /* ASLayoutSpec+FluentChildren.h in Headers */, 202 | 4EA3020D1E8FB75A0081A61B /* ASLayoutSpec+FluentSpacer.h in Headers */, 203 | ); 204 | runOnlyForDeploymentPostprocessing = 0; 205 | }; 206 | /* End PBXHeadersBuildPhase section */ 207 | 208 | /* Begin PBXNativeTarget section */ 209 | 4E5563E61E88370D00EF65A8 /* ASDKFluentExtensions */ = { 210 | isa = PBXNativeTarget; 211 | buildConfigurationList = 4E5563FB1E88370D00EF65A8 /* Build configuration list for PBXNativeTarget "ASDKFluentExtensions" */; 212 | buildPhases = ( 213 | 4E5563E21E88370D00EF65A8 /* Sources */, 214 | 4E5563E31E88370D00EF65A8 /* Frameworks */, 215 | 4E5563E41E88370D00EF65A8 /* Headers */, 216 | 4E5563E51E88370D00EF65A8 /* Resources */, 217 | ); 218 | buildRules = ( 219 | ); 220 | dependencies = ( 221 | ); 222 | name = ASDKFluentExtensions; 223 | productName = ASDKFluentExtensions; 224 | productReference = 4E5563E71E88370D00EF65A8 /* ASDKFluentExtensions.framework */; 225 | productType = "com.apple.product-type.framework"; 226 | }; 227 | 4E5563EF1E88370D00EF65A8 /* ASDKFluentExtensionsTests */ = { 228 | isa = PBXNativeTarget; 229 | buildConfigurationList = 4E5563FE1E88370D00EF65A8 /* Build configuration list for PBXNativeTarget "ASDKFluentExtensionsTests" */; 230 | buildPhases = ( 231 | 4E5563EC1E88370D00EF65A8 /* Sources */, 232 | 4E5563ED1E88370D00EF65A8 /* Frameworks */, 233 | 4E5563EE1E88370D00EF65A8 /* Resources */, 234 | ); 235 | buildRules = ( 236 | ); 237 | dependencies = ( 238 | 4E5563F31E88370D00EF65A8 /* PBXTargetDependency */, 239 | ); 240 | name = ASDKFluentExtensionsTests; 241 | productName = ASDKFluentExtensionsTests; 242 | productReference = 4E5563F01E88370D00EF65A8 /* ASDKFluentExtensionsTests.xctest */; 243 | productType = "com.apple.product-type.bundle.unit-test"; 244 | }; 245 | /* End PBXNativeTarget section */ 246 | 247 | /* Begin PBXProject section */ 248 | 4E5563DE1E88370D00EF65A8 /* Project object */ = { 249 | isa = PBXProject; 250 | attributes = { 251 | LastUpgradeCheck = 0820; 252 | ORGANIZATIONNAME = "Cesar Estebanez Tascon"; 253 | TargetAttributes = { 254 | 4E5563E61E88370D00EF65A8 = { 255 | CreatedOnToolsVersion = 8.2.1; 256 | DevelopmentTeam = SU2K8SQQ8Y; 257 | ProvisioningStyle = Automatic; 258 | }; 259 | 4E5563EF1E88370D00EF65A8 = { 260 | CreatedOnToolsVersion = 8.2.1; 261 | DevelopmentTeam = SU2K8SQQ8Y; 262 | ProvisioningStyle = Automatic; 263 | }; 264 | }; 265 | }; 266 | buildConfigurationList = 4E5563E11E88370D00EF65A8 /* Build configuration list for PBXProject "ASDKFluentExtensions" */; 267 | compatibilityVersion = "Xcode 3.2"; 268 | developmentRegion = English; 269 | hasScannedForEncodings = 0; 270 | knownRegions = ( 271 | en, 272 | ); 273 | mainGroup = 4E5563DD1E88370D00EF65A8; 274 | productRefGroup = 4E5563E81E88370D00EF65A8 /* Products */; 275 | projectDirPath = ""; 276 | projectRoot = ""; 277 | targets = ( 278 | 4E5563E61E88370D00EF65A8 /* ASDKFluentExtensions */, 279 | 4E5563EF1E88370D00EF65A8 /* ASDKFluentExtensionsTests */, 280 | ); 281 | }; 282 | /* End PBXProject section */ 283 | 284 | /* Begin PBXResourcesBuildPhase section */ 285 | 4E5563E51E88370D00EF65A8 /* Resources */ = { 286 | isa = PBXResourcesBuildPhase; 287 | buildActionMask = 2147483647; 288 | files = ( 289 | ); 290 | runOnlyForDeploymentPostprocessing = 0; 291 | }; 292 | 4E5563EE1E88370D00EF65A8 /* Resources */ = { 293 | isa = PBXResourcesBuildPhase; 294 | buildActionMask = 2147483647; 295 | files = ( 296 | ); 297 | runOnlyForDeploymentPostprocessing = 0; 298 | }; 299 | /* End PBXResourcesBuildPhase section */ 300 | 301 | /* Begin PBXSourcesBuildPhase section */ 302 | 4E5563E21E88370D00EF65A8 /* Sources */ = { 303 | isa = PBXSourcesBuildPhase; 304 | buildActionMask = 2147483647; 305 | files = ( 306 | 4E54E6D01ECA3F0600D5A7B8 /* ASAbsoluteLayoutSpec+FluentLayout.m in Sources */, 307 | 4E4C2C5D1E883B54006703D5 /* ASLayoutSpec+FluentStyling.m in Sources */, 308 | 4E4C2C551E8838FA006703D5 /* ASStackLayoutSpec+FluentLayout.m in Sources */, 309 | 4E4C2C531E8838FA006703D5 /* ASLayoutSpec+FluentLayout.m in Sources */, 310 | 4E4C2C511E8838FA006703D5 /* ASDisplayNode+FluentLayout.m in Sources */, 311 | 4EA3020E1E8FB75A0081A61B /* ASLayoutSpec+FluentSpacer.m in Sources */, 312 | 4E4C2C591E883AE1006703D5 /* ASDisplayNode+FluentStyling.m in Sources */, 313 | 4E3CCD9F1F0C2D29006FA3B7 /* ASLayoutSpec+FluentChildren.m in Sources */, 314 | ); 315 | runOnlyForDeploymentPostprocessing = 0; 316 | }; 317 | 4E5563EC1E88370D00EF65A8 /* Sources */ = { 318 | isa = PBXSourcesBuildPhase; 319 | buildActionMask = 2147483647; 320 | files = ( 321 | 4E7273321ED1EF9300C46520 /* ASLayoutSpec+FluentSpacerTests.m in Sources */, 322 | 4E72732C1ED1D1A200C46520 /* ASLayoutElement+FluentStylingTests.m in Sources */, 323 | 4EB03EE41ED05DB60036DF80 /* ASLayoutElement+FluentLayoutTests.m in Sources */, 324 | 4E7273301ED1EF4B00C46520 /* ASStackLayoutSpec+FluentLayoutTests.m in Sources */, 325 | 4E72732E1ED1D9B900C46520 /* Helpers.m in Sources */, 326 | 4E7273341ED1F52700C46520 /* ASAbsoluteLayoutSpec+FluentLayoutTests.m in Sources */, 327 | 4E3CCDA11F0C2D7A006FA3B7 /* ASLayoutSpec+FluentChildrenTests.m in Sources */, 328 | ); 329 | runOnlyForDeploymentPostprocessing = 0; 330 | }; 331 | /* End PBXSourcesBuildPhase section */ 332 | 333 | /* Begin PBXTargetDependency section */ 334 | 4E5563F31E88370D00EF65A8 /* PBXTargetDependency */ = { 335 | isa = PBXTargetDependency; 336 | target = 4E5563E61E88370D00EF65A8 /* ASDKFluentExtensions */; 337 | targetProxy = 4E5563F21E88370D00EF65A8 /* PBXContainerItemProxy */; 338 | }; 339 | /* End PBXTargetDependency section */ 340 | 341 | /* Begin XCBuildConfiguration section */ 342 | 4E5563F91E88370D00EF65A8 /* Debug */ = { 343 | isa = XCBuildConfiguration; 344 | buildSettings = { 345 | ALWAYS_SEARCH_USER_PATHS = NO; 346 | CLANG_ANALYZER_NONNULL = YES; 347 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 348 | CLANG_CXX_LIBRARY = "libc++"; 349 | CLANG_ENABLE_MODULES = YES; 350 | CLANG_ENABLE_OBJC_ARC = YES; 351 | CLANG_WARN_BOOL_CONVERSION = YES; 352 | CLANG_WARN_CONSTANT_CONVERSION = YES; 353 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 354 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 355 | CLANG_WARN_EMPTY_BODY = YES; 356 | CLANG_WARN_ENUM_CONVERSION = YES; 357 | CLANG_WARN_INFINITE_RECURSION = YES; 358 | CLANG_WARN_INT_CONVERSION = YES; 359 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 360 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 361 | CLANG_WARN_UNREACHABLE_CODE = YES; 362 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 363 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 364 | COPY_PHASE_STRIP = NO; 365 | CURRENT_PROJECT_VERSION = 1; 366 | DEBUG_INFORMATION_FORMAT = dwarf; 367 | ENABLE_STRICT_OBJC_MSGSEND = YES; 368 | ENABLE_TESTABILITY = YES; 369 | GCC_C_LANGUAGE_STANDARD = gnu99; 370 | GCC_DYNAMIC_NO_PIC = NO; 371 | GCC_NO_COMMON_BLOCKS = YES; 372 | GCC_OPTIMIZATION_LEVEL = 0; 373 | GCC_PREPROCESSOR_DEFINITIONS = ( 374 | "DEBUG=1", 375 | "$(inherited)", 376 | ); 377 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 378 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 379 | GCC_WARN_UNDECLARED_SELECTOR = YES; 380 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 381 | GCC_WARN_UNUSED_FUNCTION = YES; 382 | GCC_WARN_UNUSED_VARIABLE = YES; 383 | IPHONEOS_DEPLOYMENT_TARGET = 10.2; 384 | MTL_ENABLE_DEBUG_INFO = YES; 385 | ONLY_ACTIVE_ARCH = YES; 386 | SDKROOT = iphoneos; 387 | TARGETED_DEVICE_FAMILY = "1,2"; 388 | VERSIONING_SYSTEM = "apple-generic"; 389 | VERSION_INFO_PREFIX = ""; 390 | }; 391 | name = Debug; 392 | }; 393 | 4E5563FA1E88370D00EF65A8 /* Release */ = { 394 | isa = XCBuildConfiguration; 395 | buildSettings = { 396 | ALWAYS_SEARCH_USER_PATHS = NO; 397 | CLANG_ANALYZER_NONNULL = YES; 398 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 399 | CLANG_CXX_LIBRARY = "libc++"; 400 | CLANG_ENABLE_MODULES = YES; 401 | CLANG_ENABLE_OBJC_ARC = YES; 402 | CLANG_WARN_BOOL_CONVERSION = YES; 403 | CLANG_WARN_CONSTANT_CONVERSION = YES; 404 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 405 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 406 | CLANG_WARN_EMPTY_BODY = YES; 407 | CLANG_WARN_ENUM_CONVERSION = YES; 408 | CLANG_WARN_INFINITE_RECURSION = YES; 409 | CLANG_WARN_INT_CONVERSION = YES; 410 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 411 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 412 | CLANG_WARN_UNREACHABLE_CODE = YES; 413 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 414 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 415 | COPY_PHASE_STRIP = NO; 416 | CURRENT_PROJECT_VERSION = 1; 417 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 418 | ENABLE_NS_ASSERTIONS = NO; 419 | ENABLE_STRICT_OBJC_MSGSEND = YES; 420 | GCC_C_LANGUAGE_STANDARD = gnu99; 421 | GCC_NO_COMMON_BLOCKS = YES; 422 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 423 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 424 | GCC_WARN_UNDECLARED_SELECTOR = YES; 425 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 426 | GCC_WARN_UNUSED_FUNCTION = YES; 427 | GCC_WARN_UNUSED_VARIABLE = YES; 428 | IPHONEOS_DEPLOYMENT_TARGET = 10.2; 429 | MTL_ENABLE_DEBUG_INFO = NO; 430 | SDKROOT = iphoneos; 431 | TARGETED_DEVICE_FAMILY = "1,2"; 432 | VALIDATE_PRODUCT = YES; 433 | VERSIONING_SYSTEM = "apple-generic"; 434 | VERSION_INFO_PREFIX = ""; 435 | }; 436 | name = Release; 437 | }; 438 | 4E5563FC1E88370D00EF65A8 /* Debug */ = { 439 | isa = XCBuildConfiguration; 440 | buildSettings = { 441 | CODE_SIGN_IDENTITY = ""; 442 | DEFINES_MODULE = YES; 443 | DEVELOPMENT_TEAM = SU2K8SQQ8Y; 444 | DYLIB_COMPATIBILITY_VERSION = 1; 445 | DYLIB_CURRENT_VERSION = 1; 446 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 447 | FRAMEWORK_SEARCH_PATHS = ( 448 | "$(inherited)", 449 | "$(PROJECT_DIR)/Carthage/Build/iOS", 450 | ); 451 | INFOPLIST_FILE = Resources/Info.plist; 452 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 453 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 454 | PRODUCT_BUNDLE_IDENTIFIER = com.cestebanez.ASDKFluentExtensions; 455 | PRODUCT_NAME = "$(TARGET_NAME)"; 456 | SKIP_INSTALL = YES; 457 | }; 458 | name = Debug; 459 | }; 460 | 4E5563FD1E88370D00EF65A8 /* Release */ = { 461 | isa = XCBuildConfiguration; 462 | buildSettings = { 463 | CODE_SIGN_IDENTITY = ""; 464 | DEFINES_MODULE = YES; 465 | DEVELOPMENT_TEAM = SU2K8SQQ8Y; 466 | DYLIB_COMPATIBILITY_VERSION = 1; 467 | DYLIB_CURRENT_VERSION = 1; 468 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 469 | FRAMEWORK_SEARCH_PATHS = ( 470 | "$(inherited)", 471 | "$(PROJECT_DIR)/Carthage/Build/iOS", 472 | ); 473 | INFOPLIST_FILE = Resources/Info.plist; 474 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 475 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 476 | PRODUCT_BUNDLE_IDENTIFIER = com.cestebanez.ASDKFluentExtensions; 477 | PRODUCT_NAME = "$(TARGET_NAME)"; 478 | SKIP_INSTALL = YES; 479 | }; 480 | name = Release; 481 | }; 482 | 4E5563FF1E88370D00EF65A8 /* Debug */ = { 483 | isa = XCBuildConfiguration; 484 | buildSettings = { 485 | DEVELOPMENT_TEAM = SU2K8SQQ8Y; 486 | FRAMEWORK_SEARCH_PATHS = ( 487 | "$(inherited)", 488 | "$(PROJECT_DIR)/Carthage/Build/iOS", 489 | ); 490 | INFOPLIST_FILE = Resources/Info.plist; 491 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks \"$(PROJECT_DIR)/Carthage/Build/iOS\""; 492 | PRODUCT_BUNDLE_IDENTIFIER = com.cestebanez.ASDKFluentExtensionsTests; 493 | PRODUCT_NAME = "$(TARGET_NAME)"; 494 | }; 495 | name = Debug; 496 | }; 497 | 4E5564001E88370D00EF65A8 /* Release */ = { 498 | isa = XCBuildConfiguration; 499 | buildSettings = { 500 | DEVELOPMENT_TEAM = SU2K8SQQ8Y; 501 | FRAMEWORK_SEARCH_PATHS = ( 502 | "$(inherited)", 503 | "$(PROJECT_DIR)/Carthage/Build/iOS", 504 | ); 505 | INFOPLIST_FILE = Resources/Info.plist; 506 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks \"$(PROJECT_DIR)/Carthage/Build/iOS\""; 507 | PRODUCT_BUNDLE_IDENTIFIER = com.cestebanez.ASDKFluentExtensionsTests; 508 | PRODUCT_NAME = "$(TARGET_NAME)"; 509 | }; 510 | name = Release; 511 | }; 512 | /* End XCBuildConfiguration section */ 513 | 514 | /* Begin XCConfigurationList section */ 515 | 4E5563E11E88370D00EF65A8 /* Build configuration list for PBXProject "ASDKFluentExtensions" */ = { 516 | isa = XCConfigurationList; 517 | buildConfigurations = ( 518 | 4E5563F91E88370D00EF65A8 /* Debug */, 519 | 4E5563FA1E88370D00EF65A8 /* Release */, 520 | ); 521 | defaultConfigurationIsVisible = 0; 522 | defaultConfigurationName = Release; 523 | }; 524 | 4E5563FB1E88370D00EF65A8 /* Build configuration list for PBXNativeTarget "ASDKFluentExtensions" */ = { 525 | isa = XCConfigurationList; 526 | buildConfigurations = ( 527 | 4E5563FC1E88370D00EF65A8 /* Debug */, 528 | 4E5563FD1E88370D00EF65A8 /* Release */, 529 | ); 530 | defaultConfigurationIsVisible = 0; 531 | defaultConfigurationName = Release; 532 | }; 533 | 4E5563FE1E88370D00EF65A8 /* Build configuration list for PBXNativeTarget "ASDKFluentExtensionsTests" */ = { 534 | isa = XCConfigurationList; 535 | buildConfigurations = ( 536 | 4E5563FF1E88370D00EF65A8 /* Debug */, 537 | 4E5564001E88370D00EF65A8 /* Release */, 538 | ); 539 | defaultConfigurationIsVisible = 0; 540 | defaultConfigurationName = Release; 541 | }; 542 | /* End XCConfigurationList section */ 543 | }; 544 | rootObject = 4E5563DE1E88370D00EF65A8 /* Project object */; 545 | } 546 | --------------------------------------------------------------------------------