Commit 6c6dd27b by Daniel Dahan

updated example projects and README

parent 053fa6f6
......@@ -65,6 +65,13 @@
</Group>
<Group
location = "container:"
name = "SideNavigationViewController">
<FileRef
location = "group:Programmatic/SideNavigationViewController/SideNavigationViewController.xcodeproj">
</FileRef>
</Group>
<Group
location = "container:"
name = "CardView">
<FileRef
location = "group:Programmatic/CardView/CardView.xcodeproj">
......@@ -84,13 +91,6 @@
location = "group:Programmatic/CaptureView/CaptureView.xcodeproj">
</FileRef>
</Group>
<Group
location = "container:"
name = "SideNavigationViewController">
<FileRef
location = "group:Programmatic/SideNavigationViewController/SideNavigationViewController.xcodeproj">
</FileRef>
</Group>
</Group>
<Group
location = "container:"
......@@ -118,23 +118,23 @@
</Group>
<Group
location = "container:"
name = "CardView">
name = "SideNavigationViewController">
<FileRef
location = "group:Storyboards/CardView/CardView.xcodeproj">
location = "group:Storyboards/SideNavigationViewController/SideNavigationViewController.xcodeproj">
</FileRef>
</Group>
<Group
location = "container:"
name = "ImageCardView">
name = "CardView">
<FileRef
location = "group:Storyboards/ImageCardView/ImageCardView.xcodeproj">
location = "group:Storyboards/CardView/CardView.xcodeproj">
</FileRef>
</Group>
<Group
location = "container:"
name = "SideNavigationViewController">
name = "ImageCardView">
<FileRef
location = "group:Storyboards/SideNavigationViewController/SideNavigationViewController.xcodeproj">
location = "group:Storyboards/ImageCardView/ImageCardView.xcodeproj">
</FileRef>
</Group>
</Group>
......
......@@ -7,6 +7,8 @@
objects = {
/* Begin PBXBuildFile section */
96607DFA1C436523008D47D8 /* MaterialKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 96607DF91C436523008D47D8 /* MaterialKit.framework */; };
96607DFB1C436523008D47D8 /* MaterialKit.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 96607DF91C436523008D47D8 /* MaterialKit.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
967513CA1C136BB7009F455A /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 967513C91C136BB7009F455A /* AppDelegate.swift */; };
967513CC1C136BB7009F455A /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 967513CB1C136BB7009F455A /* ViewController.swift */; };
967513D11C136BB7009F455A /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 967513D01C136BB7009F455A /* Assets.xcassets */; };
......@@ -20,6 +22,7 @@
dstPath = "";
dstSubfolderSpec = 10;
files = (
96607DFB1C436523008D47D8 /* MaterialKit.framework in Embed Frameworks */,
);
name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0;
......@@ -27,6 +30,7 @@
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
96607DF91C436523008D47D8 /* MaterialKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; name = MaterialKit.framework; path = "/Users/danieldahan/Library/Developer/Xcode/DerivedData/MaterialKit-gdulktuccbcfwbdfadtpxkworhyc/Build/Products/Debug-iphoneos/MaterialKit.framework"; sourceTree = "<absolute>"; };
967513C61C136BB7009F455A /* CardView.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = CardView.app; sourceTree = BUILT_PRODUCTS_DIR; };
967513C91C136BB7009F455A /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
967513CB1C136BB7009F455A /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
......@@ -40,6 +44,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
96607DFA1C436523008D47D8 /* MaterialKit.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......@@ -49,6 +54,7 @@
967513BD1C136BB7009F455A = {
isa = PBXGroup;
children = (
96607DF91C436523008D47D8 /* MaterialKit.framework */,
967513C81C136BB7009F455A /* CardView */,
967513C71C136BB7009F455A /* Products */,
);
......
......@@ -28,6 +28,11 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
There are 3 button types that may be easily customized -- a FlatButton,
RaisedButton, and FabButton. Below are examples of their usage.
*/
import UIKit
import MaterialKit
......@@ -35,58 +40,44 @@ class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
prepareView()
// Examples of using MaterialButton.
prepareFlatButtonExample()
prepareRaisedButtonExample()
prepareFabButtonExample()
}
/**
:name: prepareView
:description: General preparation statements.
*/
/// General preparation statements.
private func prepareView() {
view.backgroundColor = MaterialColor.white
}
/**
:name: prepareFlatButtonExample
:description: FlatButton example.
*/
/// Prepares the FlatButton.
private func prepareFlatButtonExample() {
let button: FlatButton = FlatButton(frame: CGRectMake(107, 107, 200, 65))
button.setTitle("Flat", forState: .Normal)
button.titleLabel!.font = RobotoFont.mediumWithSize(32)
// Add to UIViewController.
// Add button to UIViewController.
view.addSubview(button)
}
/**
:name: prepareRaisedButtonExample
:description: RaisedButton example.
*/
/// Prepares the RaisedButton.
private func prepareRaisedButtonExample() {
let button: RaisedButton = RaisedButton(frame: CGRectMake(107, 207, 200, 65))
button.setTitle("Raised", forState: .Normal)
button.titleLabel!.font = RobotoFont.mediumWithSize(32)
// Add to UIViewController.
// Add button to UIViewController.
view.addSubview(button)
}
/**
:name: prepareFabButtonExample
:description: FabButton example.
*/
/// Prepares the FabButton.
private func prepareFabButtonExample() {
let img: UIImage? = UIImage(named: "ic_create_white")
let button: FabButton = FabButton(frame: CGRectMake(175, 315, 64, 64))
button.setImage(img, forState: .Normal)
button.setImage(img, forState: .Highlighted)
// Add to UIViewController.
// Add button to UIViewController.
view.addSubview(button)
}
}
......
......@@ -28,6 +28,12 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
MaterialLayer is a lightweight extension of CAShapeLayer that includes
an extended API to create beautiful visual graphics. An animation
interface is available to add awesome animations with ease.
*/
import UIKit
import MaterialKit
......@@ -58,8 +64,11 @@ class ViewController: UIViewController {
materialLayer.shape = .Circle
materialLayer.depth = .Depth2
// Add layer to UIViewController.
// Add materialLayer to UIViewController.
view.layer.addSublayer(materialLayer)
// Add a rotate animation.
materialLayer.animate(MaterialAnimation.rotate(3, duration: 3))
}
}
......@@ -28,6 +28,12 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
MaterialPulseView is at the heart of all pulse animations. Any view that subclasses
MaterialPulseView instantly inherits the pulse animation with full customizability.
Below is an example of using MaterialPulseView.
*/
import UIKit
import MaterialKit
......@@ -35,30 +41,23 @@ class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
prepareView()
// Examples of using MaterialPulseView.
prepareGeneralMaterialPulseViewExample()
}
/**
:name: prepareView
:description: General preparation statements.
*/
/// General preparation statements.
private func prepareView() {
view.backgroundColor = MaterialColor.white
}
/**
:name: prepareGeneralMaterialPulseViewExample
:description: General usage example.
*/
/// Prepares the MaterialPulseView example.
private func prepareGeneralMaterialPulseViewExample() {
let pulseView: MaterialPulseView = MaterialPulseView(frame: CGRectMake(132, 132, 150, 150))
pulseView.image = UIImage(named: "ContentAppIcon")
pulseView.shape = .Circle
pulseView.image = UIImage(named: "GraphKitAppIcon")
pulseView.shape = .Square
pulseView.depth = .Depth2
pulseView.cornerRadius = .Radius4
// Add view to UIViewController.
// Add pulseView to UIViewController.
view.addSubview(pulseView)
}
}
......
......@@ -28,6 +28,13 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
MaterialView is the base UIView class used throughout MaterialKit. It is designed
to easily take shape, depth, and animations. The major difference is that
MaterialView has all the added features of the UIView class. Below is an example
of setting a MaterialView's cornerRadius, shape, and depth.
*/
import UIKit
import MaterialKit
......@@ -35,23 +42,15 @@ class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
prepareView()
// Examples of using MaterialView.
prepareGeneralMaterialViewExample()
}
/**
:name: prepareView
:description: General preparation statements.
*/
/// General preparation statements.
private func prepareView() {
view.backgroundColor = MaterialColor.white
}
/**
:name: prepareGeneralMaterialViewExample
:description: General usage example.
*/
/// Prepare the MaterialView.
private func prepareGeneralMaterialViewExample() {
let materialView: MaterialView = MaterialView(frame: CGRectMake(132, 132, 150, 150))
materialView.image = UIImage(named: "FocusAppIcon")
......@@ -59,7 +58,7 @@ class ViewController: UIViewController {
materialView.depth = .Depth2
materialView.cornerRadius = .Radius3
// Add view to UIViewController.
// Add materialView to UIViewController.
view.addSubview(materialView)
}
}
......
......@@ -28,6 +28,12 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
A NavigationBarView is a fully featured NavigationBar that supports orientation
changes, background images, title and detail labels, both left and right button
sets, and status bar settings. Below are examples of its usage.
*/
import UIKit
import MaterialKit
......@@ -36,37 +42,34 @@ class ViewController: UIViewController {
super.viewDidLoad()
prepareView()
// Examples of using NavigationBarView.
// Uncomment different examples and read
// the comments below.
/*
Examples of using NavigationBarView.
Uncomment different examples and read
the comments below.
*/
// prepareGeneralUsageExample()
// prepareOrientationSupportExample()
// prepareDetailLabelExample()
// prepareBackgroundImageExample()
prepareButtonExample()
// prepareAlignTitleAndDetailLabelToLeftExample()
// prepareButtonExample()
prepareAlignTitleAndDetailLabelToLeftExample()
}
/**
:name: prepareView
:description: General preparation statements.
*/
/// General preparation statements.
private func prepareView() {
view.backgroundColor = MaterialColor.white
}
/**
:name: prepareGeneralUsageExample
:description: General usage example.
*/
/// Prepares a general usage example.
private func prepareGeneralUsageExample() {
let navigationBarView: NavigationBarView = NavigationBarView()
// Stylize.
navigationBarView.backgroundColor = MaterialColor.blue.darken1
// To lighten the status bar add the "View controller-based status bar appearance = NO"
// to your info.plist file and set the following property.
/*
To lighten the status bar - add the
"View controller-based status bar appearance = NO"
to your info.plist file and set the following property.
*/
navigationBarView.statusBarStyle = .LightContent
// Title label.
......@@ -81,18 +84,16 @@ class ViewController: UIViewController {
view.addSubview(navigationBarView)
}
/**
:name: prepareOrientationSupportExample
:description: Orientation support example with MaterialLayout.
*/
/// Prepare an example using MaterialLayout that support orientation change.
private func prepareOrientationSupportExample() {
let navigationBarView: NavigationBarView = NavigationBarView()
// Stylize.
navigationBarView.backgroundColor = MaterialColor.red.darken1
// To lighten the status bar add the "View controller-based status bar appearance = NO"
// to your info.plist file and set the following property.
/*
To lighten the status bar - add the
"View controller-based status bar appearance = NO"
to your info.plist file and set the following property.
*/
navigationBarView.statusBarStyle = .LightContent
// Title label.
......@@ -112,18 +113,16 @@ class ViewController: UIViewController {
MaterialLayout.height(view, child: navigationBarView, height: 70)
}
/**
:name: prepareDetailLabelExample
:description: Using a detail label to add subtext to the NavigationBarView.
*/
/// Prepares an example that uses a detailLabel.
private func prepareDetailLabelExample() {
let navigationBarView: NavigationBarView = NavigationBarView()
// Stylize.
navigationBarView.backgroundColor = MaterialColor.purple.darken1
// To lighten the status bar add the "View controller-based status bar appearance = NO"
// to your info.plist file and set the following property.
/*
To lighten the status bar - add the
"View controller-based status bar appearance = NO"
to your info.plist file and set the following property.
*/
navigationBarView.statusBarStyle = .LightContent
// Title label.
......@@ -150,19 +149,17 @@ class ViewController: UIViewController {
MaterialLayout.height(view, child: navigationBarView, height: 70)
}
/**
:name: prepareBackgroundImageExample
:description: Using a background image for the NavigationBarView.
*/
/// Prepares an example that uses a background image.
private func prepareBackgroundImageExample() {
let navigationBarView: NavigationBarView = NavigationBarView()
// Stylize.
navigationBarView.image = UIImage(named: "NavigationBarViewTexture")
navigationBarView.contentsGravity = .ResizeAspectFill
// To lighten the status bar add the "View controller-based status bar appearance = NO"
// to your info.plist file and set the following property.
/*
To lighten the status bar - add the
"View controller-based status bar appearance = NO"
to your info.plist file and set the following property.
*/
navigationBarView.statusBarStyle = .LightContent
// Title label.
......@@ -181,18 +178,16 @@ class ViewController: UIViewController {
MaterialLayout.height(view, child: navigationBarView, height: 70)
}
/**
:name: prepareButtonExample
:description: Adding buttons to the NavigationBarView.
*/
/// Prepares an example that uses buttons.
private func prepareButtonExample() {
let navigationBarView: NavigationBarView = NavigationBarView()
// Stylize.
navigationBarView.backgroundColor = MaterialColor.blueGrey.darken4
// To lighten the status bar add the "View controller-based status bar appearance = NO"
// to your info.plist file and set the following property.
/*
To lighten the status bar - add the
"View controller-based status bar appearance = NO"
to your info.plist file and set the following property.
*/
navigationBarView.statusBarStyle = .LightContent
// Title label.
......@@ -244,18 +239,16 @@ class ViewController: UIViewController {
MaterialLayout.height(view, child: navigationBarView, height: 70)
}
/**
:name: prepareAlignTitleAndDetailLabelToLeftExample
:description: Aligning the title and detail labes to the left.
*/
/// Prepares a text alignment example.
private func prepareAlignTitleAndDetailLabelToLeftExample() {
let navigationBarView: NavigationBarView = NavigationBarView()
// Stylize.
navigationBarView.backgroundColor = MaterialColor.indigo.darken1
// To lighten the status bar add the "View controller-based status bar appearance = NO"
// to your info.plist file and set the following property.
/*
To lighten the status bar - add the
"View controller-based status bar appearance = NO"
to your info.plist file and set the following property.
*/
navigationBarView.statusBarStyle = .LightContent
// Title label.
......
......@@ -7,8 +7,6 @@
objects = {
/* Begin PBXBuildFile section */
96607DE31C42C872008D47D8 /* MaterialKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 96607DE21C42C872008D47D8 /* MaterialKit.framework */; };
96607DE41C42C872008D47D8 /* MaterialKit.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 96607DE21C42C872008D47D8 /* MaterialKit.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
966F57A11C226BAA009185B7 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 966F57A01C226BAA009185B7 /* AppDelegate.swift */; };
966F57A31C226BAA009185B7 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 966F57A21C226BAA009185B7 /* ViewController.swift */; };
966F57A81C226BAA009185B7 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 966F57A71C226BAA009185B7 /* Assets.xcassets */; };
......@@ -22,7 +20,6 @@
dstPath = "";
dstSubfolderSpec = 10;
files = (
96607DE41C42C872008D47D8 /* MaterialKit.framework in Embed Frameworks */,
);
name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0;
......@@ -30,7 +27,6 @@
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
96607DE21C42C872008D47D8 /* MaterialKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; name = MaterialKit.framework; path = "/Users/danieldahan/Library/Developer/Xcode/DerivedData/MaterialKit-gdulktuccbcfwbdfadtpxkworhyc/Build/Products/Debug-iphoneos/MaterialKit.framework"; sourceTree = "<absolute>"; };
966F579D1C226BAA009185B7 /* TextField.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = TextField.app; sourceTree = BUILT_PRODUCTS_DIR; };
966F57A01C226BAA009185B7 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
966F57A21C226BAA009185B7 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
......@@ -44,7 +40,6 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
96607DE31C42C872008D47D8 /* MaterialKit.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......@@ -54,7 +49,6 @@
966F57941C226BAA009185B7 = {
isa = PBXGroup;
children = (
96607DE21C42C872008D47D8 /* MaterialKit.framework */,
966F579F1C226BAA009185B7 /* TextField */,
966F579E1C226BAA009185B7 /* Products */,
);
......
......@@ -30,8 +30,8 @@
/*
The following is an example of using a TextField. TextFields offer details
that describe the usage and input results of text. For example, when an
error enters an incorrect email, it is possible to display an error message
that describe the usage and input results of text. For example, when a
user enters an incorrect email, it is possible to display an error message
under the TextField.
*/
......@@ -67,7 +67,7 @@ class ViewController: UIViewController, TextFieldDelegate {
nameField.titleLabel = UILabel()
nameField.titleLabel!.font = RobotoFont.mediumWithSize(12)
nameField.titleLabelColor = MaterialColor.grey.lighten1
nameField.titleLabelColor = MaterialColor.grey.base
nameField.titleLabelActiveColor = MaterialColor.blue.accent3
view.addSubview(nameField)
}
......@@ -82,7 +82,7 @@ class ViewController: UIViewController, TextFieldDelegate {
emailField.titleLabel = UILabel()
emailField.titleLabel!.font = RobotoFont.mediumWithSize(12)
emailField.titleLabelColor = MaterialColor.grey.lighten1
emailField.titleLabelColor = MaterialColor.grey.base
emailField.titleLabelActiveColor = MaterialColor.blue.accent3
emailField.clearButtonMode = .WhileEditing
......
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