Commit 08b2badf by Daniel Dahan

updated examples

parent 1c44f2a1
......@@ -9,13 +9,6 @@
name = "Programmatic">
<Group
location = "container:"
name = "Grid">
<FileRef
location = "group:Programmatic/Grid/Grid.xcodeproj">
</FileRef>
</Group>
<Group
location = "container:"
name = "MaterialLayout">
<FileRef
location = "group:Programmatic/MaterialLayout/MaterialLayout.xcodeproj">
......
......@@ -3,7 +3,7 @@
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "Material-Icon-29@2x-1.png",
"filename" : "Material-Icon-29@2x.png",
"scale" : "2x"
},
{
......@@ -15,7 +15,7 @@
{
"size" : "40x40",
"idiom" : "iphone",
"filename" : "Material-Icon-40@2x.png",
"filename" : "Material-Icon-40@2x-1.png",
"scale" : "2x"
},
{
......@@ -45,7 +45,7 @@
{
"size" : "29x29",
"idiom" : "ipad",
"filename" : "Material-Icon-29@2x.png",
"filename" : "Material-Icon-29@2x-1.png",
"scale" : "2x"
},
{
......@@ -57,7 +57,7 @@
{
"size" : "40x40",
"idiom" : "ipad",
"filename" : "Material-Icon-40@2x-1.png",
"filename" : "Material-Icon-40@2x.png",
"scale" : "2x"
},
{
......
......@@ -3,7 +3,7 @@
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "Material-Icon-29@2x-1.png",
"filename" : "Material-Icon-29@2x.png",
"scale" : "2x"
},
{
......@@ -15,7 +15,7 @@
{
"size" : "40x40",
"idiom" : "iphone",
"filename" : "Material-Icon-40@2x.png",
"filename" : "Material-Icon-40@2x-1.png",
"scale" : "2x"
},
{
......@@ -45,7 +45,7 @@
{
"size" : "29x29",
"idiom" : "ipad",
"filename" : "Material-Icon-29@2x.png",
"filename" : "Material-Icon-29@2x-1.png",
"scale" : "2x"
},
{
......@@ -57,7 +57,7 @@
{
"size" : "40x40",
"idiom" : "ipad",
"filename" : "Material-Icon-40@2x-1.png",
"filename" : "Material-Icon-40@2x.png",
"scale" : "2x"
},
{
......
......@@ -2,11 +2,11 @@
"images" : [
{
"idiom" : "universal",
"filename" : "Material-iTunesArtWork.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "iTunesArtwork@2x.png",
"scale" : "2x"
},
{
......
......@@ -39,8 +39,8 @@ class ViewController: UIViewController {
// Examples of using CardView.
// Uncomment different examples and read
// the comments below.
prepareGeneralCardViewExample()
// prepareCardViewWithoutPulseBackgroundImageExample()
// prepareGeneralCardViewExample()
prepareCardViewWithoutPulseBackgroundImageExample()
// prepareCardViewWithAlteredAlignmentExample()
// prepareCardViewButtonBarExample()
}
......@@ -107,11 +107,11 @@ class ViewController: UIViewController {
private func prepareCardViewWithoutPulseBackgroundImageExample() {
let cardView: CardView = CardView()
cardView.divider = false
cardView.backgroundColor = MaterialColor.red.darken1
cardView.backgroundColor = MaterialColor.red.base
cardView.pulseScale = false
cardView.pulseColor = nil
cardView.image = UIImage(named: "iTunesArtwork")?.resize(toWidth: 400)
cardView.image = UIImage(named: "Material-iTunesArtWork")?.resize(toHeight: 150)
cardView.contentsGravity = .BottomRight
// Title label.
......@@ -123,7 +123,7 @@ class ViewController: UIViewController {
// Detail label.
let detailLabel: UILabel = UILabel()
detailLabel.text = "Build beautiful software."
detailLabel.text = "Beautiful Material Design"
detailLabel.textColor = MaterialColor.white
detailLabel.numberOfLines = 0
cardView.detailLabel = detailLabel
......@@ -159,7 +159,7 @@ class ViewController: UIViewController {
cardView.pulseColor = MaterialColor.teal.lighten4
// Image.
cardView.image = UIImage(named: "GraphKit")
cardView.image = UIImage(named: "GraphKit")?.resize(toHeight: 100)
cardView.contentsGravity = .TopLeft
// Title label.
......
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "self:Grid.xcodeproj">
</FileRef>
</Workspace>
/*
* Copyright (C) 2015 - 2016, Daniel Dahan and CosmicMind, Inc. <http://cosmicmind.io>.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* * Neither the name of Material nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
// Override point for customization after application launch.
window = UIWindow(frame: UIScreen.mainScreen().bounds)
window!.rootViewController = ViewController()
window!.makeKeyAndVisible()
return true
}
func applicationWillResignActive(application: UIApplication) {
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
}
func applicationDidEnterBackground(application: UIApplication) {
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}
func applicationWillEnterForeground(application: UIApplication) {
// Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
}
func applicationDidBecomeActive(application: UIApplication) {
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}
func applicationWillTerminate(application: UIApplication) {
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}
}
{
"images" : [
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "Material-Icon-29@2x-1.png",
"scale" : "2x"
},
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "Material-Icon-29@3x.png",
"scale" : "3x"
},
{
"size" : "40x40",
"idiom" : "iphone",
"filename" : "Material-Icon-40@2x.png",
"scale" : "2x"
},
{
"size" : "40x40",
"idiom" : "iphone",
"filename" : "Material-Icon-40@3x.png",
"scale" : "3x"
},
{
"size" : "60x60",
"idiom" : "iphone",
"filename" : "Material-Icon-60@2x.png",
"scale" : "2x"
},
{
"size" : "60x60",
"idiom" : "iphone",
"filename" : "Material-Icon-60@3x.png",
"scale" : "3x"
},
{
"size" : "29x29",
"idiom" : "ipad",
"filename" : "Material-Icon-29.png",
"scale" : "1x"
},
{
"size" : "29x29",
"idiom" : "ipad",
"filename" : "Material-Icon-29@2x.png",
"scale" : "2x"
},
{
"size" : "40x40",
"idiom" : "ipad",
"filename" : "Material-Icon-40.png",
"scale" : "1x"
},
{
"size" : "40x40",
"idiom" : "ipad",
"filename" : "Material-Icon-40@2x-1.png",
"scale" : "2x"
},
{
"size" : "76x76",
"idiom" : "ipad",
"filename" : "Material-Icon-76.png",
"scale" : "1x"
},
{
"size" : "76x76",
"idiom" : "ipad",
"filename" : "Material-Icon-76@2x.png",
"scale" : "2x"
},
{
"size" : "83.5x83.5",
"idiom" : "ipad",
"filename" : "Material-Icon-83.5@2x.png",
"scale" : "2x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="8150" systemVersion="15A204g" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" initialViewController="01J-lp-oVM">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="8122"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="EHf-IW-A2E">
<objects>
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="Llm-lL-Icb"/>
<viewControllerLayoutGuide type="bottom" id="xb3-aO-Qok"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<animations/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="53" y="375"/>
</scene>
</scenes>
</document>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
</dict>
</plist>
/*
* Copyright (C) 2015 - 2016, Daniel Dahan and CosmicMind, Inc. <http://cosmicmind.io>.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* * Neither the name of Material nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
import UIKit
import Material
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
prepareView()
let gridView: GridView = GridView(frame: CGRectMake(0, 0, view.bounds.width, view.bounds.height))
gridView.backgroundColor = MaterialColor.red.base
view.addSubview(gridView)
let rowView: RowView = RowView()
rowView.backgroundColor = MaterialColor.blue.base
gridView.addSubview(rowView)
let columnView: ColumnView = ColumnView()
columnView.backgroundColor = MaterialColor.green.base
rowView.addSubview(columnView)
let label: UILabel = UILabel()
label.text = "Hello"
label.backgroundColor = MaterialColor.purple.base
columnView.addSubview(label)
}
/// General preparation statements are placed here.
private func prepareView() {
view.backgroundColor = MaterialColor.white
}
}
......@@ -3,7 +3,7 @@
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "Material-Icon-29@2x-1.png",
"filename" : "Material-Icon-29@2x.png",
"scale" : "2x"
},
{
......@@ -15,7 +15,7 @@
{
"size" : "40x40",
"idiom" : "iphone",
"filename" : "Material-Icon-40@2x.png",
"filename" : "Material-Icon-40@2x-1.png",
"scale" : "2x"
},
{
......@@ -45,7 +45,7 @@
{
"size" : "29x29",
"idiom" : "ipad",
"filename" : "Material-Icon-29@2x.png",
"filename" : "Material-Icon-29@2x-1.png",
"scale" : "2x"
},
{
......@@ -57,7 +57,7 @@
{
"size" : "40x40",
"idiom" : "ipad",
"filename" : "Material-Icon-40@2x-1.png",
"filename" : "Material-Icon-40@2x.png",
"scale" : "2x"
},
{
......
......@@ -2,7 +2,7 @@
"images" : [
{
"idiom" : "universal",
"filename" : "MaterialImageCardViewBackgroundImage.png",
"filename" : "MaterialKitImageCardViewBackgroundImage.png",
"scale" : "1x"
},
{
......
......@@ -3,7 +3,7 @@
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "Material-Icon-29@2x-1.png",
"filename" : "Material-Icon-29@2x.png",
"scale" : "2x"
},
{
......@@ -15,7 +15,7 @@
{
"size" : "40x40",
"idiom" : "iphone",
"filename" : "Material-Icon-40@2x.png",
"filename" : "Material-Icon-40@2x-1.png",
"scale" : "2x"
},
{
......@@ -45,7 +45,7 @@
{
"size" : "29x29",
"idiom" : "ipad",
"filename" : "Material-Icon-29@2x.png",
"filename" : "Material-Icon-29@2x-1.png",
"scale" : "2x"
},
{
......@@ -57,7 +57,7 @@
{
"size" : "40x40",
"idiom" : "ipad",
"filename" : "Material-Icon-40@2x-1.png",
"filename" : "Material-Icon-40@2x.png",
"scale" : "2x"
},
{
......
......@@ -3,7 +3,7 @@
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "Material-Icon-29@2x-1.png",
"filename" : "Material-Icon-29@2x.png",
"scale" : "2x"
},
{
......@@ -15,7 +15,7 @@
{
"size" : "40x40",
"idiom" : "iphone",
"filename" : "Material-Icon-40@2x.png",
"filename" : "Material-Icon-40@2x-1.png",
"scale" : "2x"
},
{
......@@ -45,7 +45,7 @@
{
"size" : "29x29",
"idiom" : "ipad",
"filename" : "Material-Icon-29@2x.png",
"filename" : "Material-Icon-29@2x-1.png",
"scale" : "2x"
},
{
......@@ -57,7 +57,7 @@
{
"size" : "40x40",
"idiom" : "ipad",
"filename" : "Material-Icon-40@2x-1.png",
"filename" : "Material-Icon-40@2x.png",
"scale" : "2x"
},
{
......
......@@ -14,7 +14,7 @@
/* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */
961F5F3E1C17299C00C94B43 /* Embed Frameworks */ = {
9653E8D51C55BAE30089038D /* Embed Frameworks */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "";
......@@ -84,7 +84,7 @@
961F5F221C1726A300C94B43 /* Sources */,
961F5F231C1726A300C94B43 /* Frameworks */,
961F5F241C1726A300C94B43 /* Resources */,
961F5F3E1C17299C00C94B43 /* Embed Frameworks */,
9653E8D51C55BAE30089038D /* Embed Frameworks */,
);
buildRules = (
);
......
......@@ -3,7 +3,7 @@
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "Material-Icon-29@2x-1.png",
"filename" : "Material-Icon-29@2x.png",
"scale" : "2x"
},
{
......@@ -15,7 +15,7 @@
{
"size" : "40x40",
"idiom" : "iphone",
"filename" : "Material-Icon-40@2x.png",
"filename" : "Material-Icon-40@2x-1.png",
"scale" : "2x"
},
{
......@@ -45,7 +45,7 @@
{
"size" : "29x29",
"idiom" : "ipad",
"filename" : "Material-Icon-29@2x.png",
"filename" : "Material-Icon-29@2x-1.png",
"scale" : "2x"
},
{
......@@ -57,7 +57,7 @@
{
"size" : "40x40",
"idiom" : "ipad",
"filename" : "Material-Icon-40@2x-1.png",
"filename" : "Material-Icon-40@2x.png",
"scale" : "2x"
},
{
......
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