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.
......
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
96F040821C50290800C7E304 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96F040811C50290800C7E304 /* AppDelegate.swift */; };
96F040841C50290800C7E304 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96F040831C50290800C7E304 /* ViewController.swift */; };
96F040891C50290800C7E304 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 96F040881C50290800C7E304 /* Assets.xcassets */; };
96F0408C1C50290800C7E304 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 96F0408A1C50290800C7E304 /* LaunchScreen.storyboard */; };
/* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */
96F040961C502E7700C7E304 /* Embed Frameworks */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "";
dstSubfolderSpec = 10;
files = (
);
name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
96F0407E1C50290800C7E304 /* Grid.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Grid.app; sourceTree = BUILT_PRODUCTS_DIR; };
96F040811C50290800C7E304 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
96F040831C50290800C7E304 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
96F040881C50290800C7E304 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
96F0408B1C50290800C7E304 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
96F0408D1C50290800C7E304 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
96F0407B1C50290800C7E304 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
96F040751C50290800C7E304 = {
isa = PBXGroup;
children = (
96F040801C50290800C7E304 /* Grid */,
96F0407F1C50290800C7E304 /* Products */,
);
sourceTree = "<group>";
};
96F0407F1C50290800C7E304 /* Products */ = {
isa = PBXGroup;
children = (
96F0407E1C50290800C7E304 /* Grid.app */,
);
name = Products;
sourceTree = "<group>";
};
96F040801C50290800C7E304 /* Grid */ = {
isa = PBXGroup;
children = (
96F040811C50290800C7E304 /* AppDelegate.swift */,
96F040831C50290800C7E304 /* ViewController.swift */,
96F040881C50290800C7E304 /* Assets.xcassets */,
96F0408A1C50290800C7E304 /* LaunchScreen.storyboard */,
96F0408D1C50290800C7E304 /* Info.plist */,
);
path = Grid;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
96F0407D1C50290800C7E304 /* Grid */ = {
isa = PBXNativeTarget;
buildConfigurationList = 96F040901C50290800C7E304 /* Build configuration list for PBXNativeTarget "Grid" */;
buildPhases = (
96F0407A1C50290800C7E304 /* Sources */,
96F0407B1C50290800C7E304 /* Frameworks */,
96F0407C1C50290800C7E304 /* Resources */,
96F040961C502E7700C7E304 /* Embed Frameworks */,
);
buildRules = (
);
dependencies = (
);
name = Grid;
productName = Grid;
productReference = 96F0407E1C50290800C7E304 /* Grid.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
96F040761C50290800C7E304 /* Project object */ = {
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0720;
LastUpgradeCheck = 0720;
ORGANIZATIONNAME = "CosmicMind, Inc.";
TargetAttributes = {
96F0407D1C50290800C7E304 = {
CreatedOnToolsVersion = 7.2;
};
};
};
buildConfigurationList = 96F040791C50290800C7E304 /* Build configuration list for PBXProject "Grid" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = 96F040751C50290800C7E304;
productRefGroup = 96F0407F1C50290800C7E304 /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
96F0407D1C50290800C7E304 /* Grid */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
96F0407C1C50290800C7E304 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
96F0408C1C50290800C7E304 /* LaunchScreen.storyboard in Resources */,
96F040891C50290800C7E304 /* Assets.xcassets in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
96F0407A1C50290800C7E304 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
96F040841C50290800C7E304 /* ViewController.swift in Sources */,
96F040821C50290800C7E304 /* AppDelegate.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXVariantGroup section */
96F0408A1C50290800C7E304 /* LaunchScreen.storyboard */ = {
isa = PBXVariantGroup;
children = (
96F0408B1C50290800C7E304 /* Base */,
);
name = LaunchScreen.storyboard;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
96F0408E1C50290800C7E304 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
96F0408F1C50290800C7E304 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
};
name = Release;
};
96F040911C50290800C7E304 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
INFOPLIST_FILE = Grid/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = io.cosmicmind.Grid;
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Debug;
};
96F040921C50290800C7E304 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
INFOPLIST_FILE = Grid/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = io.cosmicmind.Grid;
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
96F040791C50290800C7E304 /* Build configuration list for PBXProject "Grid" */ = {
isa = XCConfigurationList;
buildConfigurations = (
96F0408E1C50290800C7E304 /* Debug */,
96F0408F1C50290800C7E304 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
96F040901C50290800C7E304 /* Build configuration list for PBXNativeTarget "Grid" */ = {
isa = XCConfigurationList;
buildConfigurations = (
96F040911C50290800C7E304 /* Debug */,
96F040921C50290800C7E304 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 96F040761C50290800C7E304 /* Project object */;
}
<?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"
},
{
......
......@@ -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"
},
{
......
......@@ -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"
},
{
......
......@@ -119,15 +119,15 @@ class SideViewController: UIViewController {
tableView.delegate = self
tableView.separatorStyle = .None
if !UIAccessibilityIsReduceTransparencyEnabled() {
tableView.backgroundColor = UIColor.clearColor()
let blurEffect = UIBlurEffect(style: .Light)
let blurEffectView = UIVisualEffectView(effect: blurEffect)
tableView.backgroundView = blurEffectView
//if you want translucent vibrant table view separator lines
tableView.separatorEffect = UIVibrancyEffect(forBlurEffect: blurEffect)
}
// if !UIAccessibilityIsReduceTransparencyEnabled() {
// tableView.backgroundColor = MaterialColor.clear
// let blurEffect = UIBlurEffect(style: .Light)
// let blurEffectView = UIVisualEffectView(effect: blurEffect)
// tableView.backgroundView = blurEffectView
//
// //if you want translucent vibrant table view separator lines
// tableView.separatorEffect = UIVibrancyEffect(forBlurEffect: blurEffect)
// }
// Use MaterialLayout to easily align the tableView.
view.addSubview(tableView)
......
......@@ -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"
},
{
......
......@@ -31,8 +31,6 @@
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
......
......@@ -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"
},
{
......
......@@ -101,7 +101,7 @@ class ViewController: UIViewController {
secondCardView.pulseColor = MaterialColor.teal.lighten4
// Image.
secondCardView.image = UIImage(named: "GraphKit")
secondCardView.image = UIImage(named: "GraphKit")?.resize(toHeight: 100)
secondCardView.contentsGravity = .TopLeft
// Title label.
......
......@@ -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"
},
{
......
......@@ -89,7 +89,6 @@ class ViewController: UIViewController {
// Add buttons to right side.
imageCardView.rightButtons = [btn1, btn2, btn3]
imageCardView.rightButtonsInset.top = imageCardView.contentInset.top
}
}
......@@ -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"
},
{
......
......@@ -11,7 +11,6 @@
96212DCA1C1696D000F31053 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 96212DC21C1696D000F31053 /* Assets.xcassets */; };
96212DCB1C1696D000F31053 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 96212DC31C1696D000F31053 /* LaunchScreen.storyboard */; };
96212DCC1C1696D000F31053 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 96212DC51C1696D000F31053 /* Main.storyboard */; };
96212DCD1C1696D000F31053 /* Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 96212DC71C1696D000F31053 /* Info.plist */; };
96212DCE1C1696D000F31053 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96212DC81C1696D000F31053 /* ViewController.swift */; };
/* End PBXBuildFile section */
......@@ -106,7 +105,7 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0710;
LastUpgradeCheck = 0710;
LastUpgradeCheck = 0720;
ORGANIZATIONNAME = "Adam Dahan";
TargetAttributes = {
9ABEC4EE1C14F08200F6895E = {
......@@ -137,7 +136,6 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
96212DCD1C1696D000F31053 /* Info.plist in Resources */,
96212DCC1C1696D000F31053 /* Main.storyboard in Resources */,
96212DCA1C1696D000F31053 /* Assets.xcassets in Resources */,
96212DCB1C1696D000F31053 /* LaunchScreen.storyboard in Resources */,
......
......@@ -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"
},
{
......
......@@ -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"
},
{
......
......@@ -28,7 +28,6 @@
960B23511C38490D00E96216 /* TextStorage.swift in Headers */ = {isa = PBXBuildFile; fileRef = 960B23441C38480E00E96216 /* TextStorage.swift */; settings = {ATTRIBUTES = (Public, ); }; };
960B23521C38490D00E96216 /* TextView.swift in Headers */ = {isa = PBXBuildFile; fileRef = 960B23451C38480E00E96216 /* TextView.swift */; settings = {ATTRIBUTES = (Public, ); }; };
963832421B88DFD80015F710 /* Material.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 963832361B88DFD80015F710 /* Material.framework */; };
9638325A1B88E31A0015F710 /* MaterialTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 963832581B88E31A0015F710 /* MaterialTests.swift */; };
96442ADB1C28EEFA00C3C574 /* TextField.swift in Headers */ = {isa = PBXBuildFile; fileRef = 966F57B71C226D75009185B7 /* TextField.swift */; settings = {ATTRIBUTES = (Public, ); }; };
96442ADE1C28EF3700C3C574 /* MaterialTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96442ADD1C28EF3700C3C574 /* MaterialTableViewCell.swift */; };
96442ADF1C28EF3E00C3C574 /* MaterialTableViewCell.swift in Headers */ = {isa = PBXBuildFile; fileRef = 96442ADD1C28EF3700C3C574 /* MaterialTableViewCell.swift */; settings = {ATTRIBUTES = (Public, ); }; };
......@@ -101,10 +100,6 @@
96D88C731C132ACC00B91418 /* MaterialAnimation.swift in Headers */ = {isa = PBXBuildFile; fileRef = 96D88BFF1C1328D800B91418 /* MaterialAnimation.swift */; settings = {ATTRIBUTES = (Public, ); }; };
96D88C741C132ACC00B91418 /* MaterialBasicAnimation.swift in Headers */ = {isa = PBXBuildFile; fileRef = 96D88C001C1328D800B91418 /* MaterialBasicAnimation.swift */; settings = {ATTRIBUTES = (Public, ); }; };
96D88C751C132AD500B91418 /* NavigationBarView.swift in Headers */ = {isa = PBXBuildFile; fileRef = 96D88C151C1328D800B91418 /* NavigationBarView.swift */; settings = {ATTRIBUTES = (Public, ); }; };
96F040721C50272600C7E304 /* RowView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96F040711C50272600C7E304 /* RowView.swift */; };
96F040741C50274500C7E304 /* ColumnView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96F040731C50274500C7E304 /* ColumnView.swift */; };
96F040981C5031F500C7E304 /* Axis.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96F040971C5031F500C7E304 /* Axis.swift */; };
96F0409A1C50323A00C7E304 /* GridView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96F040991C50323A00C7E304 /* GridView.swift */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
......@@ -130,7 +125,6 @@
960B23451C38480E00E96216 /* TextView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TextView.swift; sourceTree = "<group>"; };
963832361B88DFD80015F710 /* Material.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Material.framework; sourceTree = BUILT_PRODUCTS_DIR; };
963832411B88DFD80015F710 /* Material.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = Material.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
963832581B88E31A0015F710 /* MaterialTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MaterialTests.swift; sourceTree = "<group>"; };
963832591B88E31A0015F710 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
96442ADD1C28EF3700C3C574 /* MaterialTableViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MaterialTableViewCell.swift; sourceTree = "<group>"; };
966F57B71C226D75009185B7 /* TextField.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TextField.swift; sourceTree = "<group>"; };
......@@ -173,10 +167,6 @@
96D88C1B1C1328D800B91418 /* Roboto-Thin.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Roboto-Thin.ttf"; sourceTree = "<group>"; };
96D88C1C1C1328D800B91418 /* RobotoFont.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RobotoFont.swift; sourceTree = "<group>"; };
96D88C1D1C1328D800B91418 /* SideNavigationViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SideNavigationViewController.swift; sourceTree = "<group>"; };
96F040711C50272600C7E304 /* RowView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RowView.swift; sourceTree = "<group>"; };
96F040731C50274500C7E304 /* ColumnView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ColumnView.swift; sourceTree = "<group>"; };
96F040971C5031F500C7E304 /* Axis.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Axis.swift; sourceTree = "<group>"; };
96F040991C50323A00C7E304 /* GridView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GridView.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
......@@ -220,7 +210,6 @@
isa = PBXGroup;
children = (
963832591B88E31A0015F710 /* Info.plist */,
963832581B88E31A0015F710 /* MaterialTests.swift */,
);
path = Tests;
sourceTree = "<group>";
......@@ -247,7 +236,6 @@
96D88BF41C1328D800B91418 /* Sources */ = {
isa = PBXGroup;
children = (
96F040701C50270D00C7E304 /* Grid */,
96D88BFD1C1328D800B91418 /* LICENSE */,
96D88BFC1C1328D800B91418 /* Info.plist */,
96D88C091C1328D800B91418 /* Material.h */,
......@@ -412,17 +400,6 @@
name = Color;
sourceTree = "<group>";
};
96F040701C50270D00C7E304 /* Grid */ = {
isa = PBXGroup;
children = (
96F040971C5031F500C7E304 /* Axis.swift */,
96F040991C50323A00C7E304 /* GridView.swift */,
96F040711C50272600C7E304 /* RowView.swift */,
96F040731C50274500C7E304 /* ColumnView.swift */,
);
name = Grid;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXHeadersBuildPhase section */
......@@ -591,8 +568,6 @@
96D88C311C1328D800B91418 /* MaterialKeyframeAnimation.swift in Sources */,
96D88C2E1C1328D800B91418 /* MaterialFont.swift in Sources */,
96D88C2A1C1328D800B91418 /* MaterialBorder.swift in Sources */,
96F0409A1C50323A00C7E304 /* GridView.swift in Sources */,
96F040741C50274500C7E304 /* ColumnView.swift in Sources */,
960B23461C38480E00E96216 /* Text.swift in Sources */,
96D88C351C1328D800B91418 /* MaterialLayout.swift in Sources */,
96D88C2F1C1328D800B91418 /* MaterialGravity.swift in Sources */,
......@@ -610,7 +585,6 @@
96D88C1E1C1328D800B91418 /* CaptureView.swift in Sources */,
96D88C2D1C1328D800B91418 /* MaterialDepth.swift in Sources */,
96D88C331C1328D800B91418 /* MaterialLabel.swift in Sources */,
96F040721C50272600C7E304 /* RowView.swift in Sources */,
96D88C281C1328D800B91418 /* MaterialAnimation.swift in Sources */,
960B232E1C383EAA00E96216 /* Material+UIImage.swift in Sources */,
96D88C451C1328D800B91418 /* RobotoFont.swift in Sources */,
......@@ -625,7 +599,6 @@
96D88C461C1328D800B91418 /* SideNavigationViewController.swift in Sources */,
96D88C381C1328D800B91418 /* MaterialShape.swift in Sources */,
960B23331C383EAA00E96216 /* Material+UIImage+Size.swift in Sources */,
96F040981C5031F500C7E304 /* Axis.swift in Sources */,
96D88C271C1328D800B91418 /* Material+UIFont.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
......@@ -634,7 +607,6 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
9638325A1B88E31A0015F710 /* MaterialTests.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0710"
LastUpgradeVersion = "0720"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
......
/*
* 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.
*/
public enum Axis {
case Vertical
case Horizontal
}
/*
* 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
public class ColumnView : MaterialView {
public private(set) var axis: Axis = .Vertical
public private(set) var arrangedSubviews: Array<UIView>!
public required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
}
public init() {
super.init(frame: CGRectNull)
}
public func reloadView() {
// Remove constraints.
removeConstraints(constraints)
for x in arrangedSubviews {
MaterialLayout.alignToParent(self, child: x)
}
}
public override func prepareView() {
super.prepareView()
arrangedSubviews = Array<UIView>()
}
public override func addSubview(view: UIView) {
super.addSubview(view)
view.translatesAutoresizingMaskIntoConstraints = false
reloadView()
}
public func removeSubview(view: UIView) {
for v in arrangedSubviews {
if v == view {
v.removeFromSuperview()
reloadView()
break
}
}
}
}
/*
* 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
public class GridView : MaterialView {
public private(set) var arrangedSubviews: Array<UIView>!
public required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
}
public override init(frame: CGRect) {
super.init(frame: frame)
}
public init() {
super.init(frame: CGRectNull)
}
public func reloadView() {
// Remove constraints.
removeConstraints(constraints)
MaterialLayout.alignToParentVertically(self, children: arrangedSubviews)
for v in arrangedSubviews {
MaterialLayout.alignToParentHorizontally(self, child: v)
}
}
public override func prepareView() {
super.prepareView()
arrangedSubviews = Array<UIView>()
}
public override func addSubview(view: UIView) {
super.addSubview(view)
view.translatesAutoresizingMaskIntoConstraints = false
reloadView()
}
public func removeSubview(view: UIView) {
for v in arrangedSubviews {
if v == view {
v.removeFromSuperview()
reloadView()
break
}
}
}
}
......@@ -73,7 +73,7 @@ public enum MaterialEdgeInsetPreset {
public func MaterialEdgeInsetPresetToValue(inset: MaterialEdgeInsetPreset) -> UIEdgeInsets {
switch inset {
case .None:
return UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 0)
return UIEdgeInsetsZero
// square
case .Square1:
......
/*
* 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
public class RowView : MaterialView {
public private(set) var axis: Axis = .Horizontal
public private(set) var arrangedSubviews: Array<UIView>!
public required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
}
public init() {
super.init(frame: CGRectNull)
}
public func reloadView() {
// Remove constraints.
removeConstraints(constraints)
MaterialLayout.alignToParentHorizontally(self, children: arrangedSubviews)
for v in arrangedSubviews {
MaterialLayout.alignToParentVertically(self, child: v)
}
}
public override func prepareView() {
super.prepareView()
arrangedSubviews = Array<UIView>()
}
public override func addSubview(view: UIView) {
super.addSubview(view)
view.translatesAutoresizingMaskIntoConstraints = false
reloadView()
}
public func removeSubview(view: UIView) {
for v in arrangedSubviews {
if v == view {
v.removeFromSuperview()
reloadView()
break
}
}
}
}
......@@ -269,7 +269,7 @@ public class TextField : UITextField {
A property that sets the distance between the textField and
titleLabel.
*/
public var titleLabelAnimationDistance: CGFloat = 16
public var titleLabelAnimationDistance: CGFloat = 8
/// An override to the text property.
public override var text: String? {
......
......@@ -259,7 +259,7 @@ public class TextView: UITextView {
A property that sets the distance between the textView and
titleLabel.
*/
public var titleLabelAnimationDistance: CGFloat = 16
public var titleLabelAnimationDistance: CGFloat = 8
/// Placeholder UILabel view.
public var placeholderLabel: UILabel? {
......@@ -466,7 +466,7 @@ public class TextView: UITextView {
when subclassing.
*/
private func prepareView() {
textContainerInset = UIEdgeInsets(top: 0, left: 0, bottom: 16, right: 0)
textContainerInset = MaterialEdgeInsetPresetToValue(.None)
backgroundColor = MaterialColor.white
masksToBounds = false
removeNotificationHandlers()
......
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