Skip to content

Commit

Permalink
Fixed playground
Browse files Browse the repository at this point in the history
  • Loading branch information
k-o-d-e-n committed Jun 28, 2018
1 parent b0b384e commit 5a5fcbc
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
20 changes: 10 additions & 10 deletions Example/CGLayout.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1001,7 +1001,7 @@
MODULE_NAME = ExampleApp;
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 4.0;
};
name = Debug;
};
Expand All @@ -1017,7 +1017,7 @@
MODULE_NAME = ExampleApp;
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 4.0;
};
name = Release;
};
Expand All @@ -1039,7 +1039,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 4.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/CGLayout_Example.app/CGLayout_Example";
};
name = Debug;
Expand All @@ -1058,7 +1058,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 4.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/CGLayout_Example.app/CGLayout_Example";
};
name = Release;
Expand All @@ -1082,7 +1082,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = macosx;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 4.0;
};
name = Debug;
};
Expand All @@ -1103,7 +1103,7 @@
PRODUCT_BUNDLE_IDENTIFIER = "ru.koden.CGLayout-macOS";
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = macosx;
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 4.0;
};
name = Release;
};
Expand All @@ -1126,7 +1126,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = macosx;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 4.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/CGLayout-macOS.app/Contents/MacOS/CGLayout-macOS";
};
name = Debug;
Expand All @@ -1148,7 +1148,7 @@
PRODUCT_BUNDLE_IDENTIFIER = "ru.koden.CGLayout-macOSTests";
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = macosx;
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 4.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/CGLayout-macOS.app/Contents/MacOS/CGLayout-macOS";
};
name = Release;
Expand All @@ -1170,7 +1170,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = appletvos;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 4.0;
TARGETED_DEVICE_FAMILY = 3;
TVOS_DEPLOYMENT_TARGET = 10.2;
};
Expand All @@ -1191,7 +1191,7 @@
PRODUCT_BUNDLE_IDENTIFIER = "ru.koden..CGLayout-tvOS";
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = appletvos;
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 4.0;
TARGETED_DEVICE_FAMILY = 3;
TVOS_DEPLOYMENT_TARGET = 10.2;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@ sourceView.addSubview(targetView)

PlaygroundPage.current.liveView = sourceView

let layout = targetView.layout { (anchors) in
anchors.size.equal(to: CGSize(width: 200, height: 40))
anchors.center.align(by: sourceView.anchors.center)
let layout = targetView.block { (anchors) in
anchors.width.equal(to: 200)
anchors.height.equal(to: 40)
anchors.centerX.align(by: sourceView.layoutAnchors.centerX)
anchors.centerY.align(by: sourceView.layoutAnchors.centerY)
}

layout.layout()

0 comments on commit 5a5fcbc

Please sign in to comment.