Commit 9db71ae2 by Daniel Dahan

initial commit for MaterialSwitch

parent 30d06aeb
......@@ -75,6 +75,13 @@
</Group>
<Group
location = "container:"
name = "MaterialSwitch">
<FileRef
location = "group:Programmatic/MaterialSwitch/MaterialSwitch.xcodeproj">
</FileRef>
</Group>
<Group
location = "container:"
name = "NavigationBarView">
<FileRef
location = "group:Programmatic/NavigationBarView/NavigationBarView.xcodeproj">
......
......@@ -57,7 +57,7 @@ class ViewController: UIViewController {
pulseView.image = UIImage(named: "Graph")
pulseView.shape = .Square
pulseView.depth = .Depth1
pulseView.cornerRadius = .Radius3
pulseView.cornerRadiusPreset = .Radius3
// Add pulseView to UIViewController.
view.addSubview(pulseView)
......
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "self:MaterialSwitch.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.png",
"scale" : "2x"
},
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "Material-Icon-29@3x.png",
"scale" : "3x"
},
{
"size" : "40x40",
"idiom" : "iphone",
"filename" : "Material-Icon-40@2x-1.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-1.png",
"scale" : "2x"
},
{
"size" : "40x40",
"idiom" : "ipad",
"filename" : "Material-Icon-40.png",
"scale" : "1x"
},
{
"size" : "40x40",
"idiom" : "ipad",
"filename" : "Material-Icon-40@2x.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>
</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.
*/
/*
The following is an example of MaterialSwitch.
*/
import UIKit
import Material
class ViewController: UIViewController, MaterialSwitchDelegate {
/// Reference for MaterialSwitch.
private var materialSwitch: MaterialSwitch!
override func viewDidLoad() {
super.viewDidLoad()
prepareView()
prepareSmallMaterialSwitch()
prepareNormalMaterialSwitch()
prepareLargeMaterialSwitch()
prepareLightDisabledMaterialSwitch()
prepareDarkDisabledMaterialSwitch()
}
/// General preparation statements.
private func prepareView() {
view.backgroundColor = MaterialColor.white
}
/// Prepares the Small MaterialSwitch.
private func prepareSmallMaterialSwitch() {
materialSwitch = MaterialSwitch(state: .Off, style: .Light, size: .Small)
materialSwitch.center = view.center
materialSwitch.y -= 100
materialSwitch.delegate = self
view.addSubview(materialSwitch)
}
/// Prepares the Normal MaterialSwitch.
private func prepareNormalMaterialSwitch() {
materialSwitch = MaterialSwitch(state: .On, style: .Dark, size: .Normal)
materialSwitch.center = view.center
materialSwitch.delegate = self
view.addSubview(materialSwitch)
}
/// Prepares the Large MaterialSwitch.
private func prepareLargeMaterialSwitch() {
materialSwitch = MaterialSwitch(state: .Off, style: .Light, size: .Large)
materialSwitch.center = view.center
materialSwitch.y += 100
materialSwitch.delegate = self
view.addSubview(materialSwitch)
}
/// Prepares the Light disabled MaterialSwitch.
private func prepareLightDisabledMaterialSwitch() {
materialSwitch = MaterialSwitch(state: .Off, style: .Light, size: .Normal)
materialSwitch.enabled = false
materialSwitch.center = view.center
materialSwitch.y += 200
materialSwitch.delegate = self
view.addSubview(materialSwitch)
}
/// Prepares the Dark disabled MaterialSwitch.
private func prepareDarkDisabledMaterialSwitch() {
materialSwitch = MaterialSwitch(state: .On, style: .Dark, size: .Normal)
materialSwitch.enabled = false
materialSwitch.center = view.center
materialSwitch.y += 300
materialSwitch.delegate = self
view.addSubview(materialSwitch)
}
internal func materialSwitchStateChanged(control: MaterialSwitch, state: MaterialSwitchState) {
print("MaterialSwitch - Size: \(control.switchSize) State: \(state)")
}
}
......@@ -85,11 +85,19 @@ class ViewController: UIViewController {
func prepareCardView() {
let cardView: CardView = CardView()
cardView.pulseColor = nil
cardView.backgroundColor = MaterialColor.grey.lighten5
cardView.cornerRadiusPreset = .Radius1
cardView.divider = false
cardView.contentInsetPreset = .None
cardView.leftButtonsInsetPreset = .Square2
cardView.rightButtonsInsetPreset = .Square2
cardView.detailViewInsetPreset = .None
let titleLabel: UILabel = UILabel()
titleLabel.font = RobotoFont.mediumWithSize(20)
titleLabel.text = "Messages"
titleLabel.textAlignment = .Center
titleLabel.font = RobotoFont.mediumWithSize(24)
titleLabel.textColor = MaterialColor.blueGrey.darken4
let v: UIView = UIView()
v.backgroundColor = MaterialColor.blue.accent1
......@@ -106,8 +114,6 @@ class ViewController: UIViewController {
// Use MaterialLayout to easily align the tableView.
cardView.titleLabel = titleLabel
cardView.detailView = tableView
cardView.detailViewInsetPreset = .None
cardView.dividerInset.top = 0
cardView.leftButtons = [closeButton]
cardView.rightButtons = [settingButton]
......
Pod::Spec.new do |s|
s.name = 'Material'
s.version = '1.32.2'
s.version = '1.32.3'
s.license = 'BSD'
s.summary = 'Express your creativity with Material, an animation and graphics framework for Google\'s Material Design and Apple\'s Flat UI in Swift.'
s.homepage = 'http://cosmicmind.io'
......
......@@ -39,6 +39,7 @@
96A71EB91C6FCFA300C0C4AE /* Grid.swift in Headers */ = {isa = PBXBuildFile; fileRef = 9656CD0B1C6BD33700EBCEF1 /* Grid.swift */; settings = {ATTRIBUTES = (Public, ); }; };
96A71EBA1C6FCFA300C0C4AE /* Menu.swift in Headers */ = {isa = PBXBuildFile; fileRef = 65FDC2EA1C66858A00103AC2 /* Menu.swift */; settings = {ATTRIBUTES = (Public, ); }; };
96A71EBB1C6FCFA300C0C4AE /* MenuView.swift in Headers */ = {isa = PBXBuildFile; fileRef = 96A71E901C6FBC2200C0C4AE /* MenuView.swift */; settings = {ATTRIBUTES = (Public, ); }; };
96A71EC71C6FFF0500C0C4AE /* MaterialSwitch.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96A71EC61C6FFF0500C0C4AE /* MaterialSwitch.swift */; };
96D88C1E1C1328D800B91418 /* CaptureView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96D88BF51C1328D800B91418 /* CaptureView.swift */; };
96D88C1F1C1328D800B91418 /* CardView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96D88BF61C1328D800B91418 /* CardView.swift */; };
96D88C201C1328D800B91418 /* CapturePreviewView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96D88BF71C1328D800B91418 /* CapturePreviewView.swift */; };
......@@ -54,7 +55,7 @@
96D88C2D1C1328D800B91418 /* MaterialDepth.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96D88C041C1328D800B91418 /* MaterialDepth.swift */; };
96D88C2E1C1328D800B91418 /* MaterialFont.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96D88C051C1328D800B91418 /* MaterialFont.swift */; };
96D88C2F1C1328D800B91418 /* MaterialGravity.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96D88C061C1328D800B91418 /* MaterialGravity.swift */; };
96D88C301C1328D800B91418 /* MaterialEdgeInsetPreset.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96D88C071C1328D800B91418 /* MaterialEdgeInsetPreset.swift */; };
96D88C301C1328D800B91418 /* MaterialEdgeInset.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96D88C071C1328D800B91418 /* MaterialEdgeInset.swift */; };
96D88C311C1328D800B91418 /* MaterialKeyframeAnimation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96D88C081C1328D800B91418 /* MaterialKeyframeAnimation.swift */; };
96D88C321C1328D800B91418 /* Material.h in Headers */ = {isa = PBXBuildFile; fileRef = 96D88C091C1328D800B91418 /* Material.h */; settings = {ATTRIBUTES = (Public, ); }; };
96D88C331C1328D800B91418 /* MaterialLabel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96D88C0A1C1328D800B91418 /* MaterialLabel.swift */; };
......@@ -83,7 +84,7 @@
96D88C5D1C132ABF00B91418 /* MaterialColor.swift in Headers */ = {isa = PBXBuildFile; fileRef = 96D88C031C1328D800B91418 /* MaterialColor.swift */; settings = {ATTRIBUTES = (Public, ); }; };
96D88C5E1C132ABF00B91418 /* MaterialDepth.swift in Headers */ = {isa = PBXBuildFile; fileRef = 96D88C041C1328D800B91418 /* MaterialDepth.swift */; settings = {ATTRIBUTES = (Public, ); }; };
96D88C5F1C132ABF00B91418 /* MaterialGravity.swift in Headers */ = {isa = PBXBuildFile; fileRef = 96D88C061C1328D800B91418 /* MaterialGravity.swift */; settings = {ATTRIBUTES = (Public, ); }; };
96D88C601C132ABF00B91418 /* MaterialEdgeInsetPreset.swift in Headers */ = {isa = PBXBuildFile; fileRef = 96D88C071C1328D800B91418 /* MaterialEdgeInsetPreset.swift */; settings = {ATTRIBUTES = (Public, ); }; };
96D88C601C132ABF00B91418 /* MaterialEdgeInset.swift in Headers */ = {isa = PBXBuildFile; fileRef = 96D88C071C1328D800B91418 /* MaterialEdgeInset.swift */; settings = {ATTRIBUTES = (Public, ); }; };
96D88C611C132ABF00B91418 /* CaptureView.swift in Headers */ = {isa = PBXBuildFile; fileRef = 96D88BF51C1328D800B91418 /* CaptureView.swift */; settings = {ATTRIBUTES = (Public, ); }; };
96D88C621C132ABF00B91418 /* CapturePreviewView.swift in Headers */ = {isa = PBXBuildFile; fileRef = 96D88BF71C1328D800B91418 /* CapturePreviewView.swift */; settings = {ATTRIBUTES = (Public, ); }; };
96D88C631C132ABF00B91418 /* CaptureSession.swift in Headers */ = {isa = PBXBuildFile; fileRef = 96D88BF81C1328D800B91418 /* CaptureSession.swift */; settings = {ATTRIBUTES = (Public, ); }; };
......@@ -137,6 +138,7 @@
9656CD0B1C6BD33700EBCEF1 /* Grid.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Grid.swift; sourceTree = "<group>"; };
966F57B71C226D75009185B7 /* TextField.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TextField.swift; sourceTree = "<group>"; };
96A71E901C6FBC2200C0C4AE /* MenuView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MenuView.swift; sourceTree = "<group>"; };
96A71EC61C6FFF0500C0C4AE /* MaterialSwitch.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MaterialSwitch.swift; sourceTree = "<group>"; };
96D88BF51C1328D800B91418 /* CaptureView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CaptureView.swift; sourceTree = "<group>"; };
96D88BF61C1328D800B91418 /* CardView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CardView.swift; sourceTree = "<group>"; };
96D88BF71C1328D800B91418 /* CapturePreviewView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CapturePreviewView.swift; sourceTree = "<group>"; };
......@@ -154,7 +156,7 @@
96D88C041C1328D800B91418 /* MaterialDepth.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MaterialDepth.swift; sourceTree = "<group>"; };
96D88C051C1328D800B91418 /* MaterialFont.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MaterialFont.swift; sourceTree = "<group>"; };
96D88C061C1328D800B91418 /* MaterialGravity.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MaterialGravity.swift; sourceTree = "<group>"; };
96D88C071C1328D800B91418 /* MaterialEdgeInsetPreset.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MaterialEdgeInsetPreset.swift; sourceTree = "<group>"; };
96D88C071C1328D800B91418 /* MaterialEdgeInset.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MaterialEdgeInset.swift; sourceTree = "<group>"; };
96D88C081C1328D800B91418 /* MaterialKeyframeAnimation.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MaterialKeyframeAnimation.swift; sourceTree = "<group>"; };
96D88C091C1328D800B91418 /* Material.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Material.h; sourceTree = "<group>"; };
96D88C0A1C1328D800B91418 /* MaterialLabel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MaterialLabel.swift; sourceTree = "<group>"; };
......@@ -259,6 +261,14 @@
name = Menu;
sourceTree = "<group>";
};
96A71EC51C6FFEF300C0C4AE /* Switch */ = {
isa = PBXGroup;
children = (
96A71EC61C6FFF0500C0C4AE /* MaterialSwitch.swift */,
);
name = Switch;
sourceTree = "<group>";
};
96D88BF41C1328D800B91418 /* Sources */ = {
isa = PBXGroup;
children = (
......@@ -282,6 +292,7 @@
96442ADC1C28EF1400C3C574 /* TableView */,
965C58BD1C6B8D3300CFB4E1 /* Grid */,
96A71E921C6FBC2900C0C4AE /* Menu */,
96A71EC51C6FFEF300C0C4AE /* Switch */,
);
path = Sources;
sourceTree = "<group>";
......@@ -325,7 +336,7 @@
96D88C0F1C1328D800B91418 /* MaterialShape.swift */,
96D88C041C1328D800B91418 /* MaterialDepth.swift */,
96D88C061C1328D800B91418 /* MaterialGravity.swift */,
96D88C071C1328D800B91418 /* MaterialEdgeInsetPreset.swift */,
96D88C071C1328D800B91418 /* MaterialEdgeInset.swift */,
);
name = Type;
sourceTree = "<group>";
......@@ -459,7 +470,7 @@
96D88C5D1C132ABF00B91418 /* MaterialColor.swift in Headers */,
96D88C5E1C132ABF00B91418 /* MaterialDepth.swift in Headers */,
96D88C5F1C132ABF00B91418 /* MaterialGravity.swift in Headers */,
96D88C601C132ABF00B91418 /* MaterialEdgeInsetPreset.swift in Headers */,
96D88C601C132ABF00B91418 /* MaterialEdgeInset.swift in Headers */,
96D88C611C132ABF00B91418 /* CaptureView.swift in Headers */,
96D88C621C132ABF00B91418 /* CapturePreviewView.swift in Headers */,
96D88C631C132ABF00B91418 /* CaptureSession.swift in Headers */,
......@@ -606,6 +617,7 @@
966F57B81C226D75009185B7 /* TextField.swift in Sources */,
96DBA7361C61198400844821 /* Material+UIImage+Color.swift in Sources */,
96D88C201C1328D800B91418 /* CapturePreviewView.swift in Sources */,
96A71EC71C6FFF0500C0C4AE /* MaterialSwitch.swift in Sources */,
96D88C3E1C1328D800B91418 /* NavigationBarView.swift in Sources */,
96D88C221C1328D800B91418 /* FabButton.swift in Sources */,
96D88C3F1C1328D800B91418 /* RaisedButton.swift in Sources */,
......@@ -623,7 +635,7 @@
96D88C451C1328D800B91418 /* RobotoFont.swift in Sources */,
96D88C1F1C1328D800B91418 /* CardView.swift in Sources */,
96D88C2C1C1328D800B91418 /* MaterialColor.swift in Sources */,
96D88C301C1328D800B91418 /* MaterialEdgeInsetPreset.swift in Sources */,
96D88C301C1328D800B91418 /* MaterialEdgeInset.swift in Sources */,
96D88C211C1328D800B91418 /* CaptureSession.swift in Sources */,
96442ADE1C28EF3700C3C574 /* MaterialTableViewCell.swift in Sources */,
960B23271C383E5500E96216 /* Material+String.swift in Sources */,
......
......@@ -185,16 +185,16 @@ public class CaptureView : MaterialView, UIGestureRecognizerDelegate {
/**
:name: contentInsets
*/
public var contentInsetPreset: MaterialEdgeInsetPreset = .None {
public var contentInsetPreset: MaterialEdgeInset = .None {
didSet {
contentInset = MaterialEdgeInsetPresetToValue(contentInsetPreset)
contentInset = MaterialEdgeInsetToValue(contentInsetPreset)
}
}
/**
:name: contentInset
*/
public var contentInset: UIEdgeInsets = MaterialEdgeInsetPresetToValue(.Square4) {
public var contentInset: UIEdgeInsets = MaterialEdgeInsetToValue(.Square4) {
didSet {
reloadView()
}
......
......@@ -57,9 +57,9 @@ public class CardView : MaterialPulseView {
/**
:name: dividerInsets
*/
public var dividerInsetPreset: MaterialEdgeInsetPreset = .None {
public var dividerInsetPreset: MaterialEdgeInset = .None {
didSet {
dividerInset = MaterialEdgeInsetPresetToValue(dividerInsetPreset)
dividerInset = MaterialEdgeInsetToValue(dividerInsetPreset)
}
}
......@@ -75,16 +75,16 @@ public class CardView : MaterialPulseView {
/**
:name: contentInsets
*/
public var contentInsetPreset: MaterialEdgeInsetPreset = .None {
public var contentInsetPreset: MaterialEdgeInset = .None {
didSet {
contentInset = MaterialEdgeInsetPresetToValue(contentInsetPreset)
contentInset = MaterialEdgeInsetToValue(contentInsetPreset)
}
}
/**
:name: contentInset
*/
public var contentInset: UIEdgeInsets = MaterialEdgeInsetPresetToValue(.Square2) {
public var contentInset: UIEdgeInsets = MaterialEdgeInsetToValue(.Square2) {
didSet {
reloadView()
}
......@@ -93,16 +93,16 @@ public class CardView : MaterialPulseView {
/**
:name: titleLabelInsets
*/
public var titleLabelInsetPreset: MaterialEdgeInsetPreset = .None {
public var titleLabelInsetPreset: MaterialEdgeInset = .None {
didSet {
titleLabelInset = MaterialEdgeInsetPresetToValue(titleLabelInsetPreset)
titleLabelInset = MaterialEdgeInsetToValue(titleLabelInsetPreset)
}
}
/**
:name: titleLabelInset
*/
public var titleLabelInset: UIEdgeInsets = MaterialEdgeInsetPresetToValue(.Square2) {
public var titleLabelInset: UIEdgeInsets = MaterialEdgeInsetToValue(.Square2) {
didSet {
reloadView()
}
......@@ -121,16 +121,16 @@ public class CardView : MaterialPulseView {
/**
:name: detailViewInsets
*/
public var detailViewInsetPreset: MaterialEdgeInsetPreset = .None {
public var detailViewInsetPreset: MaterialEdgeInset = .None {
didSet {
detailViewInset = MaterialEdgeInsetPresetToValue(detailViewInsetPreset)
detailViewInset = MaterialEdgeInsetToValue(detailViewInsetPreset)
}
}
/**
:name: detailViewInset
*/
public var detailViewInset: UIEdgeInsets = MaterialEdgeInsetPresetToValue(.Square2) {
public var detailViewInset: UIEdgeInsets = MaterialEdgeInsetToValue(.Square2) {
didSet {
reloadView()
}
......@@ -149,16 +149,16 @@ public class CardView : MaterialPulseView {
/**
:name: leftButtonsInsets
*/
public var leftButtonsInsetPreset: MaterialEdgeInsetPreset = .None {
public var leftButtonsInsetPreset: MaterialEdgeInset = .None {
didSet {
leftButtonsInset = MaterialEdgeInsetPresetToValue(leftButtonsInsetPreset)
leftButtonsInset = MaterialEdgeInsetToValue(leftButtonsInsetPreset)
}
}
/**
:name: leftButtonsInset
*/
public var leftButtonsInset: UIEdgeInsets = MaterialEdgeInsetPresetToValue(.None) {
public var leftButtonsInset: UIEdgeInsets = MaterialEdgeInsetToValue(.None) {
didSet {
reloadView()
}
......@@ -181,16 +181,16 @@ public class CardView : MaterialPulseView {
/**
:name: rightButtonsInsets
*/
public var rightButtonsInsetPreset: MaterialEdgeInsetPreset = .None {
public var rightButtonsInsetPreset: MaterialEdgeInset = .None {
didSet {
rightButtonsInset = MaterialEdgeInsetPresetToValue(rightButtonsInsetPreset)
rightButtonsInset = MaterialEdgeInsetToValue(rightButtonsInsetPreset)
}
}
/**
:name: rightButtonsInset
*/
public var rightButtonsInset: UIEdgeInsets = MaterialEdgeInsetPresetToValue(.None) {
public var rightButtonsInset: UIEdgeInsets = MaterialEdgeInsetToValue(.None) {
didSet {
reloadView()
}
......
......@@ -42,7 +42,7 @@ public class FlatButton : MaterialButton {
super.prepareView()
setTitleColor(MaterialColor.blue.accent3, forState: .Normal)
pulseColor = MaterialColor.blue.accent3
cornerRadius = .Radius1
cornerRadiusPreset = .Radius1
contentInsetPreset = .WideRectangle3
}
}
\ No newline at end of file
......@@ -126,14 +126,14 @@ public class Grid {
public private(set) var axis: GridAxis!
/// Preset inset value for grid.
public var contentInsetPreset: MaterialEdgeInsetPreset = .None {
public var contentInsetPreset: MaterialEdgeInset = .None {
didSet {
contentInset = MaterialEdgeInsetPresetToValue(contentInsetPreset)
contentInset = MaterialEdgeInsetToValue(contentInsetPreset)
}
}
/// Insets value for grid.
public var contentInset: UIEdgeInsets = MaterialEdgeInsetPresetToValue(.None) {
public var contentInset: UIEdgeInsets = MaterialEdgeInsetToValue(.None) {
didSet {
reloadLayout()
}
......
......@@ -57,9 +57,9 @@ public class ImageCardView : MaterialPulseView {
/**
:name: dividerInsets
*/
public var dividerInsetPreset: MaterialEdgeInsetPreset = .None {
public var dividerInsetPreset: MaterialEdgeInset = .None {
didSet {
dividerInset = MaterialEdgeInsetPresetToValue(dividerInsetPreset)
dividerInset = MaterialEdgeInsetToValue(dividerInsetPreset)
}
}
......@@ -165,16 +165,16 @@ public class ImageCardView : MaterialPulseView {
/**
:name: contentInsets
*/
public var contentInsetPreset: MaterialEdgeInsetPreset = .None {
public var contentInsetPreset: MaterialEdgeInset = .None {
didSet {
contentInset = MaterialEdgeInsetPresetToValue(contentInsetPreset)
contentInset = MaterialEdgeInsetToValue(contentInsetPreset)
}
}
/**
:name: contentInset
*/
public var contentInset: UIEdgeInsets = MaterialEdgeInsetPresetToValue(.Square2) {
public var contentInset: UIEdgeInsets = MaterialEdgeInsetToValue(.Square2) {
didSet {
reloadView()
}
......@@ -183,16 +183,16 @@ public class ImageCardView : MaterialPulseView {
/**
:name: titleLabelInsets
*/
public var titleLabelInsetPreset: MaterialEdgeInsetPreset = .None {
public var titleLabelInsetPreset: MaterialEdgeInset = .None {
didSet {
titleLabelInset = MaterialEdgeInsetPresetToValue(titleLabelInsetPreset)
titleLabelInset = MaterialEdgeInsetToValue(titleLabelInsetPreset)
}
}
/**
:name: titleLabelInset
*/
public var titleLabelInset: UIEdgeInsets = MaterialEdgeInsetPresetToValue(.Square2) {
public var titleLabelInset: UIEdgeInsets = MaterialEdgeInsetToValue(.Square2) {
didSet {
reloadView()
}
......@@ -211,16 +211,16 @@ public class ImageCardView : MaterialPulseView {
/**
:name: detailViewInsets
*/
public var detailViewInsetPreset: MaterialEdgeInsetPreset = .None {
public var detailViewInsetPreset: MaterialEdgeInset = .None {
didSet {
detailViewInset = MaterialEdgeInsetPresetToValue(detailViewInsetPreset)
detailViewInset = MaterialEdgeInsetToValue(detailViewInsetPreset)
}
}
/**
:name: detailViewInset
*/
public var detailViewInset: UIEdgeInsets = MaterialEdgeInsetPresetToValue(.Square2) {
public var detailViewInset: UIEdgeInsets = MaterialEdgeInsetToValue(.Square2) {
didSet {
reloadView()
}
......@@ -239,16 +239,16 @@ public class ImageCardView : MaterialPulseView {
/**
:name: leftButtonsInsets
*/
public var leftButtonsInsetPreset: MaterialEdgeInsetPreset = .None {
public var leftButtonsInsetPreset: MaterialEdgeInset = .None {
didSet {
leftButtonsInset = MaterialEdgeInsetPresetToValue(leftButtonsInsetPreset)
leftButtonsInset = MaterialEdgeInsetToValue(leftButtonsInsetPreset)
}
}
/**
:name: leftButtonsInset
*/
public var leftButtonsInset: UIEdgeInsets = MaterialEdgeInsetPresetToValue(.None) {
public var leftButtonsInset: UIEdgeInsets = MaterialEdgeInsetToValue(.None) {
didSet {
reloadView()
}
......@@ -271,16 +271,16 @@ public class ImageCardView : MaterialPulseView {
/**
:name: rightButtonsInsets
*/
public var rightButtonsInsetPreset: MaterialEdgeInsetPreset = .None {
public var rightButtonsInsetPreset: MaterialEdgeInset = .None {
didSet {
rightButtonsInset = MaterialEdgeInsetPresetToValue(rightButtonsInsetPreset)
rightButtonsInset = MaterialEdgeInsetToValue(rightButtonsInsetPreset)
}
}
/**
:name: rightButtonsInset
*/
public var rightButtonsInset: UIEdgeInsets = MaterialEdgeInsetPresetToValue(.None) {
public var rightButtonsInset: UIEdgeInsets = MaterialEdgeInsetToValue(.None) {
didSet {
reloadView()
}
......
......@@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.32.2</string>
<string>1.32.3</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
......
......@@ -188,10 +188,10 @@ public class MaterialButton : UIButton {
property has a value of .Circle when the cornerRadius is set, it will
become .None, as it no longer maintains its circle shape.
*/
public var cornerRadius: MaterialRadius {
public var cornerRadiusPreset: MaterialRadius {
didSet {
if let v: MaterialRadius = cornerRadius {
layer.cornerRadius = MaterialRadiusToValue(v)
if let v: MaterialRadius = cornerRadiusPreset {
cornerRadius = MaterialRadiusToValue(v)
if .Circle == shape {
shape = .None
}
......@@ -199,6 +199,13 @@ public class MaterialButton : UIButton {
}
}
/// A property that accesses the layer.cornerRadius.
public var cornerRadius: CGFloat = 0 {
didSet {
layer.cornerRadius = cornerRadius
}
}
/**
A property that manages the overall shape for the object. If either the
width or height property is set, the other will be automatically adjusted
......@@ -216,10 +223,8 @@ public class MaterialButton : UIButton {
}
}
/**
A property that accesses the layer.borderWith.
*/
public var borderWidth: CGFloat = 0 {
/// A property that accesses the layer.borderWith.
public var borderWidth: CGFloat {
didSet {
layer.borderWidth = borderWidth
}
......@@ -255,9 +260,9 @@ public class MaterialButton : UIButton {
/**
:name: contentInsets
*/
public var contentInsetPreset: MaterialEdgeInsetPreset {
public var contentInsetPreset: MaterialEdgeInset {
didSet {
let value: UIEdgeInsets = MaterialEdgeInsetPresetToValue(contentInsetPreset)
let value: UIEdgeInsets = MaterialEdgeInsetToValue(contentInsetPreset)
contentEdgeInsets = UIEdgeInsetsMake(value.top, value.left, value.bottom, value.right)
}
}
......@@ -268,8 +273,9 @@ public class MaterialButton : UIButton {
*/
public required init?(coder aDecoder: NSCoder) {
depth = .None
cornerRadiusPreset = .None
shape = .None
cornerRadius = .None
borderWidth = 0
contentInsetPreset = .None
super.init(coder: aDecoder)
prepareView()
......@@ -283,8 +289,9 @@ public class MaterialButton : UIButton {
*/
public override init(frame: CGRect) {
depth = .None
cornerRadiusPreset = .None
shape = .None
cornerRadius = .None
borderWidth = 0
contentInsetPreset = .None
super.init(frame: frame)
prepareView()
......
......@@ -30,7 +30,7 @@
import UIKit
public enum MaterialEdgeInsetPreset {
public enum MaterialEdgeInset {
case None
// square
......@@ -68,9 +68,9 @@ public enum MaterialEdgeInsetPreset {
}
/**
:name: MaterialEdgeInsetPresetToValue
:name: MaterialEdgeInsetToValue
*/
public func MaterialEdgeInsetPresetToValue(inset: MaterialEdgeInsetPreset) -> UIEdgeInsets {
public func MaterialEdgeInsetToValue(inset: MaterialEdgeInset) -> UIEdgeInsets {
switch inset {
case .None:
return UIEdgeInsetsZero
......
......@@ -231,10 +231,10 @@ public class MaterialView : UIView {
property has a value of .Circle when the cornerRadius is set, it will
become .None, as it no longer maintains its circle shape.
*/
public var cornerRadius: MaterialRadius {
public var cornerRadiusPreset: MaterialRadius {
didSet {
if let v: MaterialRadius = cornerRadius {
layer.cornerRadius = MaterialRadiusToValue(v)
if let v: MaterialRadius = cornerRadiusPreset {
cornerRadius = MaterialRadiusToValue(v)
if .Circle == shape {
shape = .None
}
......@@ -242,6 +242,13 @@ public class MaterialView : UIView {
}
}
/// A property that accesses the layer.cornerRadius.
public var cornerRadius: CGFloat = 0 {
didSet {
layer.cornerRadius = cornerRadius
}
}
/**
A property that manages the overall shape for the object. If either the
width or height property is set, the other will be automatically adjusted
......@@ -259,10 +266,8 @@ public class MaterialView : UIView {
}
}
/**
A property that accesses the layer.borderWith.
*/
public var borderWidth: CGFloat = 0 {
/// A property that accesses the layer.borderWith.
public var borderWidth: CGFloat {
didSet {
layer.borderWidth = borderWidth
}
......@@ -305,8 +310,9 @@ public class MaterialView : UIView {
contentsScale = UIScreen.mainScreen().scale
contentsGravity = .ResizeAspectFill
depth = .None
cornerRadiusPreset = .None
shape = .None
cornerRadius = .None
borderWidth = 0
super.init(coder: aDecoder)
prepareView()
}
......@@ -323,8 +329,9 @@ public class MaterialView : UIView {
contentsScale = UIScreen.mainScreen().scale
contentsGravity = .ResizeAspectFill
depth = .None
cornerRadiusPreset = .None
shape = .None
cornerRadius = .None
borderWidth = 0
super.init(frame: frame)
prepareView()
}
......
......@@ -43,16 +43,16 @@ public class NavigationBarView : MaterialView {
/**
:name: contentInsets
*/
public var contentInsetPreset: MaterialEdgeInsetPreset = .None {
public var contentInsetPreset: MaterialEdgeInset = .None {
didSet {
contentInset = MaterialEdgeInsetPresetToValue(contentInsetPreset)
contentInset = MaterialEdgeInsetToValue(contentInsetPreset)
}
}
/**
:name: contentInset
*/
public var contentInset: UIEdgeInsets = MaterialEdgeInsetPresetToValue(.Square2) {
public var contentInset: UIEdgeInsets = MaterialEdgeInsetToValue(.Square2) {
didSet {
reloadView()
}
......@@ -61,9 +61,9 @@ public class NavigationBarView : MaterialView {
/**
:name: titleLabelInsets
*/
public var titleLabelInsetPreset: MaterialEdgeInsetPreset = .None {
public var titleLabelInsetPreset: MaterialEdgeInset = .None {
didSet {
titleLabelInset = MaterialEdgeInsetPresetToValue(titleLabelInsetPreset)
titleLabelInset = MaterialEdgeInsetToValue(titleLabelInsetPreset)
}
}
......@@ -89,16 +89,16 @@ public class NavigationBarView : MaterialView {
/**
:name: detailLabelInsets
*/
public var detailLabelInsetPreset: MaterialEdgeInsetPreset = .None {
public var detailLabelInsetPreset: MaterialEdgeInset = .None {
didSet {
detailLabelInset = MaterialEdgeInsetPresetToValue(detailLabelInsetPreset)
detailLabelInset = MaterialEdgeInsetToValue(detailLabelInsetPreset)
}
}
/**
:name: detailLabelInset
*/
public var detailLabelInset: UIEdgeInsets = MaterialEdgeInsetPresetToValue(.None) {
public var detailLabelInset: UIEdgeInsets = MaterialEdgeInsetToValue(.None) {
didSet {
reloadView()
}
......@@ -117,9 +117,9 @@ public class NavigationBarView : MaterialView {
/**
:name: leftButtonsInsets
*/
public var leftButtonsInsetPreset: MaterialEdgeInsetPreset = .None {
public var leftButtonsInsetPreset: MaterialEdgeInset = .None {
didSet {
leftButtonsInset = MaterialEdgeInsetPresetToValue(leftButtonsInsetPreset)
leftButtonsInset = MaterialEdgeInsetToValue(leftButtonsInsetPreset)
}
}
......@@ -149,9 +149,9 @@ public class NavigationBarView : MaterialView {
/**
:name: rightButtonsInsets
*/
public var rightButtonsInsetPreset: MaterialEdgeInsetPreset = .None {
public var rightButtonsInsetPreset: MaterialEdgeInset = .None {
didSet {
rightButtonsInset = MaterialEdgeInsetPresetToValue(rightButtonsInsetPreset)
rightButtonsInset = MaterialEdgeInsetToValue(rightButtonsInsetPreset)
}
}
......
......@@ -43,7 +43,7 @@ public class RaisedButton : MaterialButton {
setTitleColor(MaterialColor.white, forState: .Normal)
backgroundColor = MaterialColor.blue.accent3
depth = .Depth1
cornerRadius = .Radius1
cornerRadiusPreset = .Radius1
contentInsetPreset = .WideRectangle3
}
}
\ No newline at end of file
......@@ -167,10 +167,10 @@ public class TextField : UITextField {
property has a value of .Circle when the cornerRadius is set, it will
become .None, as it no longer maintains its circle shape.
*/
public var cornerRadius: MaterialRadius {
public var cornerRadiusPreset: MaterialRadius {
didSet {
if let v: MaterialRadius = cornerRadius {
layer.cornerRadius = MaterialRadiusToValue(v)
if let v: MaterialRadius = cornerRadiusPreset {
cornerRadius = MaterialRadiusToValue(v)
if .Circle == shape {
shape = .None
}
......@@ -178,6 +178,13 @@ public class TextField : UITextField {
}
}
/// A property that accesses the layer.cornerRadius.
public var cornerRadius: CGFloat = 0 {
didSet {
layer.cornerRadius = cornerRadius
}
}
/**
A property that manages the overall shape for the object. If either the
width or height property is set, the other will be automatically adjusted
......@@ -195,10 +202,8 @@ public class TextField : UITextField {
}
}
/**
A property that accesses the layer.borderWith.
*/
public var borderWidth: CGFloat = 0 {
/// A property that accesses the layer.borderWith.
public var borderWidth: CGFloat {
didSet {
layer.borderWidth = borderWidth
}
......@@ -335,8 +340,9 @@ public class TextField : UITextField {
*/
public required init?(coder aDecoder: NSCoder) {
depth = .None
cornerRadiusPreset = .None
shape = .None
cornerRadius = .None
borderWidth = 0
super.init(coder: aDecoder)
prepareView()
}
......@@ -349,8 +355,9 @@ public class TextField : UITextField {
*/
public override init(frame: CGRect) {
depth = .None
cornerRadiusPreset = .None
shape = .None
cornerRadius = .None
borderWidth = 0
super.init(frame: frame)
prepareView()
}
......
......@@ -169,10 +169,10 @@ public class TextView: UITextView {
property has a value of .Circle when the cornerRadius is set, it will
become .None, as it no longer maintains its circle shape.
*/
public var cornerRadius: MaterialRadius {
public var cornerRadiusPreset: MaterialRadius {
didSet {
if let v: MaterialRadius = cornerRadius {
layer.cornerRadius = MaterialRadiusToValue(v)
if let v: MaterialRadius = cornerRadiusPreset {
cornerRadius = MaterialRadiusToValue(v)
if .Circle == shape {
shape = .None
}
......@@ -180,6 +180,13 @@ public class TextView: UITextView {
}
}
/// A property that accesses the layer.cornerRadius.
public var cornerRadius: CGFloat = 0 {
didSet {
layer.cornerRadius = cornerRadius
}
}
/**
A property that manages the overall shape for the object. If either the
width or height property is set, the other will be automatically adjusted
......@@ -197,10 +204,8 @@ public class TextView: UITextView {
}
}
/**
A property that accesses the layer.borderWith.
*/
public var borderWidth: CGFloat = 0 {
/// A property that accesses the layer.borderWith.
public var borderWidth: CGFloat {
didSet {
layer.borderWidth = borderWidth
}
......@@ -285,9 +290,9 @@ public class TextView: UITextView {
Text container UIEdgeInset preset property. This updates the
textContainerInset property with a preset value.
*/
public var textContainerInsetPreset: MaterialEdgeInsetPreset = .None {
public var textContainerInsetPreset: MaterialEdgeInset = .None {
didSet {
textContainerInset = MaterialEdgeInsetPresetToValue(textContainerInsetPreset)
textContainerInset = MaterialEdgeInsetToValue(textContainerInsetPreset)
}
}
......@@ -304,8 +309,9 @@ public class TextView: UITextView {
*/
public required init?(coder aDecoder: NSCoder) {
depth = .None
cornerRadiusPreset = .None
shape = .None
cornerRadius = .None
borderWidth = 0
super.init(coder: aDecoder)
prepareView()
}
......@@ -319,8 +325,9 @@ public class TextView: UITextView {
*/
public override init(frame: CGRect, textContainer: NSTextContainer?) {
depth = .None
cornerRadiusPreset = .None
shape = .None
cornerRadius = .None
borderWidth = 0
super.init(frame: frame, textContainer: textContainer)
prepareView()
}
......@@ -461,7 +468,7 @@ public class TextView: UITextView {
when subclassing.
*/
private func prepareView() {
textContainerInset = MaterialEdgeInsetPresetToValue(.None)
textContainerInset = MaterialEdgeInsetToValue(.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