Commit 667e7ed7 by danieldahan

updated MaterialView example project to show how to center a view

parent 3d198dfc
......@@ -52,15 +52,15 @@ class ViewController: UIViewController {
/// Prepares the MaterialView.
private func prepareMaterialView() {
let diameter: CGFloat = 150
let point: CGFloat = (MaterialDevice.width - diameter) / 2
let width: CGFloat = 200
let height: CGFloat = 200
let materialView: MaterialView = MaterialView(frame: CGRectMake(point, point, diameter, diameter))
let materialView: MaterialView = MaterialView(frame: CGRectMake(0, 0, width, height))
materialView.image = UIImage(named: "CosmicMind")
materialView.shape = .Circle
materialView.depth = .Depth2
materialView.center = view.center
// Add materialView to UIViewController.
view.addSubview(materialView)
}
}
......
......@@ -252,10 +252,12 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
INFOPLIST_FILE = TextField/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = io.cosmicmind.TextField;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "";
};
name = Debug;
};
......@@ -264,10 +266,12 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
INFOPLIST_FILE = TextField/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = io.cosmicmind.TextField;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "";
};
name = Release;
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment