Commit 525c1ef3 by Daniel Dahan

precheck for release 1.19.0

parent ad0a7302
Pod::Spec.new do |s|
s.name = 'MK'
s.version = '1.18.1'
s.version = '1.19.0'
s.license = { :type => "AGPLv3+", :file => "LICENSE" }
s.summary = 'A Material Design Framework In Swift'
s.homepage = 'http://materialkit.io'
......
......@@ -579,6 +579,7 @@
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "iPhone Developer";
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
......@@ -597,6 +598,7 @@
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "iPhone Developer";
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
......
......@@ -2,16 +2,16 @@
### CocoaPods Support
MaterialKit is on CocoaPods under the name [MK][1].
MaterialKit is on CocoaPods under the name [MK](https://cocoapods.org/?q=MK).
### Basic MaterialView
To get started, let's introduce MaterialView, a lightweight UIView Object that has flexibility in mind. Common controls have been added to make things easier. For example, let's make a circle view that has a shadow, border, and image.
![MaterialKitPreview][image-1]
![MaterialKitPreview](http://www.materialkit.io/github/img1.png)
```swift
`let v: MaterialView = MaterialView(frame: CGRectMake(100, 100, 200, 200))
let v: MaterialView = MaterialView(frame: CGRectMake(100, 100, 200, 200))
v.shape = .Circle
v.shadowDepth = .Depth2
v.borderWidth = .Border1
......@@ -20,15 +20,15 @@ v.image = UIImage(named: "focus")
// Add to UIViewController.
view.addSubview(v)
```
`
### Animated MaterialPulseView
Let's expand on the basic MaterialView and use an animated MaterialPulseView. In this example, we will make the shape a square with some rounded corners.
![MaterialKitPreview][image-2]
![MaterialKitPreview](http://www.materialkit.io/github/img2.gif)
```swift
`let v: MaterialPulseView = MaterialPulseView(frame: CGRectMake(100, 100, 200, 200))
let v: MaterialPulseView = MaterialPulseView(frame: CGRectMake(100, 100, 200, 200))
v.shape = .Square
v.cornerRadius = .Radius2
v.shadowDepth = .Depth2
......@@ -37,104 +37,115 @@ v.image = UIImage(named: "focus")
// Add to UIViewController.
view.addSubview(v)
```
`
### Simple FlatButton
A FlatButton is the best place to start when introducing MaterialKit buttons. It is simple, clean, and very effective. Below is an example of a FlatButton in action.
![MaterialKitPreview][image-3]
![MaterialKitPreview](http://www.materialkit.io/github/img3.gif)
```swift
`let v: FlatButton = FlatButton(frame: CGRectMake(100, 100, 200, 64))
let v: FlatButton = FlatButton(frame: CGRectMake(100, 100, 200, 64))
v.setTitle("Flat", forState: .Normal)
v.titleLabel!.font = RobotoFont.mediumWithSize(32)
// Add to UIViewController.
view.addSubview(v)
```
`
### Noticeable RaisedButton
A RaisedButton is sure to get attention. Take a look at the following code sample.
![MaterialKitPreview][image-4]
![MaterialKitPreview](http://www.materialkit.io/github/img4.gif)
```swift
`let v: RaisedButton = RaisedButton(frame: CGRectMake(100, 100, 200, 64))
let v: RaisedButton = RaisedButton(frame: CGRectMake(100, 100, 200, 64))
v.setTitle("Raised", forState: .Normal)
v.titleLabel!.font = RobotoFont.mediumWithSize(32)
// Add to UIViewController.
view.addSubview(v)
```
`
### Actionable FabButton
A FabButton is essential to Material Design's overall look. I leave this example as simple as possible to showcase its beauty.
![MaterialKitPreview][image-5]
![MaterialKitPreview](http://www.materialkit.io/github/img5.gif)
```swift
`let v: FabButton = FabButton(frame: CGRectMake(100, 100, 64, 64))
v.setImage(UIImage(named: "ic\_create\_white"), forState: .Normal)
v.setImage(UIImage(named: "ic\_create\_white"), forState: .Highlighted)
let v: FabButton = FabButton(frame: CGRectMake(100, 100, 64, 64))
v.setImage(UIImage(named: "ic_create_white"), forState: .Normal)
v.setImage(UIImage(named: "ic_create_white"), forState: .Highlighted)
// Add to UIViewController.
view.addSubview(v)
```
`
### Sleek NavigationBarView
A NavigationBarView is a very common UI element and the more presentable it is, the better. The following example shows how to setup a NavigationBarView on the fly.
![MaterialKitPreview][image-6]
![MaterialKitPreview](http://www.materialkit.io/github/img6.gif)
```swift
`let v: NavigationBarView = NavigationBarView(titleLabel: MaterialLabel())!
let v: NavigationBarView = NavigationBarView(titleLabel: MaterialLabel())!
v.backgroundColor = MaterialColor.blue.accent3
v.statusBarStyle = .LightContent
v.titleLabel = MaterialLabel()
v.titleLabel!.text = "Title"
v.titleLabel!.textAlignment = .Center
v.titleLabel!.textColor = MaterialColor.white
v.titleLabel!.font = RobotoFont.regularWithSize(20)
v.titleLabelInsetsRef = (top: 12, left: 0, bottom: 0, right: 0)
v.detailLabel = MaterialLabel()
v.detailLabel!.text = "Detail Text"
v.detailLabel!.textAlignment = .Center
v.detailLabel!.textColor = MaterialColor.white
v.detailLabel!.font = RobotoFont.regularWithSize(12)
// left buttons
let b1: FlatButton = FlatButton()
b1.setTitle("B1", forState: .Normal)
b1.setTitleColor(MaterialColor.white, forState: .Normal)
b1.pulseScale = false
b1.pulseFill = true
b1.pulseColor = MaterialColor.white
b1.setImage(UIImage(named: "ic_menu_white"), forState: .Normal)
b1.setImage(UIImage(named: "ic_menu_white"), forState: .Highlighted)
v.leftButtons = [b1]
// right buttons
let b2: FlatButton = FlatButton()
b2.setTitle("B2", forState: .Normal)
b2.setTitleColor(MaterialColor.white, forState: .Normal)
b2.pulseScale = false
b2.pulseFill = true
b2.pulseColor = MaterialColor.white
v.leftButtons = [b1, b2]
b2.setImage(UIImage(named: "ic_check_circle_white"), forState: .Normal)
b2.setImage(UIImage(named: "ic_check_circle_white"), forState: .Highlighted)
let b3: FlatButton = FlatButton()
b3.setTitle("B3", forState: .Normal)
b3.setTitleColor(MaterialColor.white, forState: .Normal)
b3.pulseScale = false
b3.pulseFill = true
b3.pulseColor = MaterialColor.white
b3.setImage(UIImage(named: "ic_stars_white"), forState: .Normal)
b3.setImage(UIImage(named: "ic_stars_white"), forState: .Highlighted)
let b4: FlatButton = FlatButton()
b4.setTitle("B4", forState: .Normal)
b4.setTitleColor(MaterialColor.white, forState: .Normal)
b4.pulseColor = MaterialColor.white
v.rightButtons = [b3, b4]
v.rightButtons = [b2, b3]
// Add to UIViewController.
view.addSubview(v)
```
`
### Flexible BasicCardView
A BasicCardView is super flexible with all its options - including a title, detail, left buttons, and right buttons. Below is an example of a simple setup.
![MaterialKitPreview][image-7]
![MaterialKitPreview](http://www.materialkit.io/github/img7.gif)
```swift
`let v: BasicCardView = BasicCardView(titleLabel: UILabel(), detailLabel: UILabel())!
let v: BasicCardView = BasicCardView(titleLabel: UILabel(), detailLabel: UILabel())!
v.backgroundColor = MaterialColor.blueGrey.darken1
v.dividerColor = MaterialColor.blueGrey.base
......@@ -166,13 +177,13 @@ v.translatesAutoresizingMaskIntoConstraints = false
MaterialLayout.alignToParentHorizontallyWithInsets(view, child: v, left: 20, right: 20)
MaterialLayout.alignFromTop(view, child: v, top: 100)
```
`
A BasicCardView can easily add an image as its background, below is the code that shows how to do this.
![MaterialKitPreview][image-8]
![MaterialKitPreview](http://www.materialkit.io/github/img8.gif)
```swift
`let v: BasicCardView = BasicCardView(titleLabel: UILabel(), detailLabel: UILabel())!
let v: BasicCardView = BasicCardView(titleLabel: UILabel(), detailLabel: UILabel())!
v.image = UIImage(named: "forest")
......@@ -182,6 +193,8 @@ v.titleLabel!.text = "Card Title"
v.detailLabel!.textColor = MaterialColor.white
v.detailLabel!.font = RobotoFont.regularWithSize(14)
v.detailLabel!.lineBreakMode = .ByWordWrapping
v.detailLabel!.numberOfLines = 0
v.detailLabel!.text = "I am a very simple card. I am good at containing small bits of information. I am convenient because I require little code to use effectively."
// Add to UIViewController.
......@@ -190,15 +203,15 @@ v.translatesAutoresizingMaskIntoConstraints = false
MaterialLayout.alignToParentHorizontallyWithInsets(view, child: v, left: 20, right: 20)
MaterialLayout.alignFromTop(view, child: v, top: 100)
```
`
### Easy MaterialAnimation
Animations are a wonderful way to add life to your application. MaterialAnimation is a lightweight API for constructing complex animations. Below is an example of an animation.
![MaterialKitPreview][image-9]
![MaterialKitPreview](http://www.materialkit.io/github/img9.gif)
```swift
`let v: MaterialPulseView = MaterialPulseView(frame: CGRectMake(50, 50, 200, 200))
let v: MaterialPulseView = MaterialPulseView(frame: CGRectMake(50, 50, 200, 200))
v.shape = .Circle
v.shadowDepth = .Depth2
v.borderWidth = .Border1
......@@ -209,34 +222,19 @@ view.addSubview(v)
// Play a group of animations.
v.animation(MaterialAnimation.animationGroup([
MaterialAnimation.rotation(3),
MaterialAnimation.position(CGPointMake(225, 400)),
MaterialAnimation.cornerRadius(30),
MaterialAnimation.backgroundColor(MaterialColor.red.darken1)
MaterialAnimation.rotation(3),
MaterialAnimation.position(CGPointMake(225, 400)),
MaterialAnimation.cornerRadius(30),
MaterialAnimation.backgroundColor(MaterialColor.red.darken1)
], duration: 1))
```
`### License
[AGPLv3][2]
### License
[AGPLv3](http://choosealicense.com/licenses/agpl-3.0/)
### Contributors
* [Daniel Dahan][3]
* [Adam Dahan][4]
* [Michael Reyder][5]
[1]: https://cocoapods.org/?q=MK
[2]: http://choosealicense.com/licenses/agpl-3.0/
[3]: https://github.com/danieldahan
[4]: https://github.com/adamdahan
[5]: https://github.com/michaelReyder
[image-1]: http://www.materialkit.io/github/img1.png
[image-2]: http://www.materialkit.io/github/img2.gif
[image-3]: http://www.materialkit.io/github/img3.gif
[image-4]: http://www.materialkit.io/github/img4.gif
[image-5]: http://www.materialkit.io/github/img5.gif
[image-6]: http://www.materialkit.io/github/img6.gif
[image-7]: http://www.materialkit.io/github/img7.gif
[image-8]: http://www.materialkit.io/github/img8.gif
[image-9]: http://www.materialkit.io/github/img9.gif
\ No newline at end of file
* [Daniel Dahan](https://github.com/danieldahan)
* [Adam Dahan](https://github.com/adamdahan)
* [Michael Reyder](https://github.com/michaelReyder)
......@@ -142,7 +142,7 @@ public class BasicCardView : MaterialPulseView {
/**
:name: leftButtons
*/
public var leftButtons: Array<MaterialButton>? {
public var leftButtons: Array<UIButton>? {
didSet {
if let v = leftButtons {
for b in v {
......@@ -175,7 +175,7 @@ public class BasicCardView : MaterialPulseView {
/**
:name: rightButtons
*/
public var rightButtons: Array<MaterialButton>? {
public var rightButtons: Array<UIButton>? {
didSet {
if let v = rightButtons {
for b in v {
......@@ -210,7 +210,7 @@ public class BasicCardView : MaterialPulseView {
/**
:name: init
*/
public convenience init?(titleLabel: UILabel? = nil, detailLabel: UILabel? = nil, leftButtons: Array<MaterialButton>? = nil, rightButtons: Array<MaterialButton>? = nil) {
public convenience init?(titleLabel: UILabel? = nil, detailLabel: UILabel? = nil, leftButtons: Array<UIButton>? = nil, rightButtons: Array<UIButton>? = nil) {
self.init(frame: CGRectNull)
prepareProperties(titleLabel, detailLabel: detailLabel, leftButtons: leftButtons, rightButtons: rightButtons)
}
......@@ -224,9 +224,9 @@ public class BasicCardView : MaterialPulseView {
if true == divider {
var y: CGFloat = 0
if 0 < leftButtons?.count {
y += contentInsetsRef!.bottom + leftButtonsInsetsRef!.top + leftButtonsInsetsRef!.bottom + leftButtons![0].height
y += contentInsetsRef!.bottom + leftButtonsInsetsRef!.top + leftButtonsInsetsRef!.bottom + leftButtons![0].frame.size.height
} else if 0 < rightButtons?.count {
y += contentInsetsRef!.bottom + rightButtonsInsetsRef!.top + rightButtonsInsetsRef!.bottom + rightButtons![0].height
y += contentInsetsRef!.bottom + rightButtonsInsetsRef!.top + rightButtonsInsetsRef!.bottom + rightButtons![0].frame.size.height
}
if 0 < y {
prepareDivider(bounds.size.height - y - 0.5, width: bounds.size.width)
......@@ -385,7 +385,7 @@ public class BasicCardView : MaterialPulseView {
//
// :name: prepareProperties
//
internal func prepareProperties(titleLabel: UILabel?, detailLabel: UILabel?, leftButtons: Array<MaterialButton>?, rightButtons: Array<MaterialButton>?) {
internal func prepareProperties(titleLabel: UILabel?, detailLabel: UILabel?, leftButtons: Array<UIButton>?, rightButtons: Array<UIButton>?) {
self.titleLabel = titleLabel
self.detailLabel = detailLabel
self.leftButtons = leftButtons
......
......@@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.18.1</string>
<string>1.19.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
......
......@@ -305,13 +305,6 @@ public class MaterialButton : UIButton {
}
/**
:name: layerClass
*/
public override class func layerClass() -> AnyClass {
return MaterialLayer.self
}
/**
:name: layoutSubviews
*/
public override func layoutSubviews() {
......
......@@ -148,10 +148,10 @@ public extension MaterialTheme.navigationBarView {
public static var masksToBounds: Bool = true
public static var cornerRadius: MaterialRadius = .None
public static var contentInsetsRef: MaterialInsetsType = MaterialInsetsToValue(.Square2)
public static var titleLabelInsetsRef: MaterialInsetsType = MaterialInsetsToValue(.None)
public static var titleLabelInsetsRef: MaterialInsetsType = (top: 20, left: 0, bottom: 0, right: 0)
public static var detailLabelInsetsRef: MaterialInsetsType = MaterialInsetsToValue(.None)
public static var leftButtonsInsetsRef: MaterialInsetsType = (top: 8, left: 8, bottom: 0, right: 0)
public static var rightButtonsInsetsRef: MaterialInsetsType = (top: 8, left: 0, bottom: 0, right: 8)
public static var leftButtonsInsetsRef: MaterialInsetsType = (top: 8, left: 8, bottom: 0, right: -8)
public static var rightButtonsInsetsRef: MaterialInsetsType = (top: 8, left: -8, bottom: 0, right: 8)
// border
public static var borderWidth: MaterialBorder = .None
......
......@@ -309,13 +309,6 @@ public class MaterialView : UIView {
}
/**
:name: layerClass
*/
public override class func layerClass() -> AnyClass {
return CAShapeLayer.self
}
/**
:name: layoutSubviews
*/
public override func layoutSubviews() {
......
......@@ -127,7 +127,7 @@ public class NavigationBarView : MaterialView {
/**
:name: leftButtons
*/
public var leftButtons: Array<MaterialButton>? {
public var leftButtons: Array<UIButton>? {
didSet {
if let v = leftButtons {
for b in v {
......@@ -160,7 +160,7 @@ public class NavigationBarView : MaterialView {
/**
:name: rightButtons
*/
public var rightButtons: Array<MaterialButton>? {
public var rightButtons: Array<UIButton>? {
didSet {
if let v = rightButtons {
for b in v {
......@@ -189,13 +189,13 @@ public class NavigationBarView : MaterialView {
:name: init
*/
public convenience init() {
self.init(frame: CGRectNull)
self.init(frame: CGRectMake(MaterialTheme.navigationBarView.x, MaterialTheme.navigationBarView.y, MaterialTheme.navigationBarView.width, MaterialTheme.navigationBarView.height))
}
/**
:name: init
*/
public convenience init?(titleLabel: UILabel? = nil, detailLabel: UILabel? = nil, leftButtons: Array<MaterialButton>? = nil, rightButtons: Array<MaterialButton>? = nil) {
public convenience init?(titleLabel: UILabel? = nil, detailLabel: UILabel? = nil, leftButtons: Array<UIButton>? = nil, rightButtons: Array<UIButton>? = nil) {
self.init(frame: CGRectNull)
prepareProperties(titleLabel, detailLabel: detailLabel, leftButtons: leftButtons, rightButtons: rightButtons)
}
......@@ -323,7 +323,7 @@ public class NavigationBarView : MaterialView {
//
// :name: prepareProperties
//
internal func prepareProperties(titleLabel: UILabel?, detailLabel: UILabel?, leftButtons: Array<MaterialButton>?, rightButtons: Array<MaterialButton>?) {
internal func prepareProperties(titleLabel: UILabel?, detailLabel: UILabel?, leftButtons: Array<UIButton>?, rightButtons: Array<UIButton>?) {
self.titleLabel = titleLabel
self.detailLabel = detailLabel
self.leftButtons = leftButtons
......
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