Skip to content

Commit

Permalink
Merge pull request #99 from JakeLin/hotfix/sample_layout_ipad
Browse files Browse the repository at this point in the history
Fixed border designable and mask border
  • Loading branch information
JakeLin committed Feb 15, 2016
2 parents e7fe721 + 0d4a50f commit d629a21
Show file tree
Hide file tree
Showing 14 changed files with 252 additions and 86 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Expand Up @@ -16,11 +16,14 @@ TBD
- Customise mask draw from interface builder [#50](https://github.com/JakeLin/IBAnimatable/issues/50) [#8](https://github.com/JakeLin/IBAnimatable/issues/8) [#76](https://github.com/JakeLin/IBAnimatable/issues/76):
- Star(6) -> draw star mask with 6 sides.
- Wave(up,50,100) -> draw a wave up mask with 50 as width, and 100 as offset.
- `BorderDesignable` can be used directly in playground

#### Bugfixes

- Fixed `GradientDesignable` rotation. [#86](https://github.com/JakeLin/IBAnimatable/issues/86)
- Fixed `BorderDesignable` after rotation.
- Fixed mask star drawing bug. [#95](https://github.com/JakeLin/IBAnimatable/issues/95)
- Fixed the border color / width when using with a mask. [#95](https://github.com/JakeLin/IBAnimatable/issues/101)

### [1.1](https://github.com/JakeLin/IBAnimatable/releases/tag/V1.1)

Expand Down
Expand Up @@ -22,8 +22,11 @@ view.configAnimatableProperties()
iPhoneView.addSubview(view)

view.fillColor = UIColor(red: 0xba/0xff, green: 0x77/0xff, blue: 1, alpha: 1)
view.borderWidth = 2
view.borderColor = UIColor.purpleColor()
view.maskType = "Circle"


//: Animations, all supported predefined animations can be found in `enum AnimationType`

// Uncomment one line to play the animation
Expand Down
26 changes: 22 additions & 4 deletions IBAnimatable/AnimatableButton.swift
Expand Up @@ -34,9 +34,23 @@ import UIKit
}

// MARK: - BorderDesignable
@IBInspectable public var borderColor: UIColor?
@IBInspectable public var borderWidth: CGFloat = CGFloat.NaN
@IBInspectable public var borderSide: String?
@IBInspectable public var borderColor: UIColor? {
didSet {
configBorder()
}
}

@IBInspectable public var borderWidth: CGFloat = CGFloat.NaN {
didSet {
configBorder()
}
}

@IBInspectable public var borderSide: String? {
didSet {
configBorder()
}
}

// MARK: - ShadowDesignable
@IBInspectable public var shadowColor: UIColor? {
Expand Down Expand Up @@ -67,6 +81,7 @@ import UIKit
@IBInspectable public var maskType: String? {
didSet {
configMask()
configBorder()
}
}

Expand All @@ -93,13 +108,16 @@ import UIKit

public override func layoutSubviews() {
super.layoutSubviews()

configAfterLayoutSubviews()
autoRunAnimation()
}

// MARK: - Private
private func configInspectableProperties() {
configAnimatableProperties()
}

private func configAfterLayoutSubviews() {
configBorder()
}
}
26 changes: 22 additions & 4 deletions IBAnimatable/AnimatableCheckBox.swift
Expand Up @@ -53,9 +53,23 @@ import UIKit
}

// MARK: - BorderDesignable
@IBInspectable public var borderColor: UIColor?
@IBInspectable public var borderWidth: CGFloat = CGFloat.NaN
@IBInspectable public var borderSide: String?
@IBInspectable public var borderColor: UIColor? {
didSet {
configBorder()
}
}

@IBInspectable public var borderWidth: CGFloat = CGFloat.NaN {
didSet {
configBorder()
}
}

@IBInspectable public var borderSide: String? {
didSet {
configBorder()
}
}

// MARK: - ShadowDesignable
@IBInspectable public var shadowColor: UIColor? {
Expand Down Expand Up @@ -86,6 +100,7 @@ import UIKit
@IBInspectable public var maskType: String? {
didSet {
configMask()
configBorder()
}
}

Expand Down Expand Up @@ -114,7 +129,7 @@ import UIKit

public override func layoutSubviews() {
super.layoutSubviews()

configAfterLayoutSubviews()
autoRunAnimation()
}

Expand All @@ -135,6 +150,9 @@ import UIKit

private func configInspectableProperties() {
configAnimatableProperties()
}

private func configAfterLayoutSubviews() {
configBorder()
}
}
27 changes: 23 additions & 4 deletions IBAnimatable/AnimatableImageView.swift
Expand Up @@ -34,9 +34,23 @@ import UIKit
}

// MARK: - BorderDesignable
@IBInspectable public var borderColor: UIColor?
@IBInspectable public var borderWidth: CGFloat = CGFloat.NaN
@IBInspectable public var borderSide: String?
@IBInspectable public var borderColor: UIColor? {
didSet {
configBorder()
}
}

@IBInspectable public var borderWidth: CGFloat = CGFloat.NaN {
didSet {
configBorder()
}
}

@IBInspectable public var borderSide: String? {
didSet {
configBorder()
}
}

// MARK: - RotationDesignable
@IBInspectable public var rotate: CGFloat = CGFloat.NaN {
Expand Down Expand Up @@ -90,6 +104,7 @@ import UIKit
@IBInspectable public var maskType: String? {
didSet {
configMask()
configBorder()
}
}

Expand All @@ -116,15 +131,19 @@ import UIKit

public override func layoutSubviews() {
super.layoutSubviews()
configAfterLayoutSubviews()
autoRunAnimation()
}

// MARK: - Private
private func configInspectableProperties() {
configAnimatableProperties()
configBorder()
configTintedColor()
configBlurEffectStyle()
configGradient()
}

private func configAfterLayoutSubviews() {
configBorder()
}
}
27 changes: 23 additions & 4 deletions IBAnimatable/AnimatableStackView.swift
Expand Up @@ -36,9 +36,23 @@ import UIKit
}

// MARK: - BorderDesignable
@IBInspectable public var borderColor: UIColor?
@IBInspectable public var borderWidth: CGFloat = CGFloat.NaN
@IBInspectable public var borderSide: String?
@IBInspectable public var borderColor: UIColor? {
didSet {
configBorder()
}
}

@IBInspectable public var borderWidth: CGFloat = CGFloat.NaN {
didSet {
configBorder()
}
}

@IBInspectable public var borderSide: String? {
didSet {
configBorder()
}
}

// MARK: - RotationDesignable
@IBInspectable public var rotate: CGFloat = CGFloat.NaN {
Expand Down Expand Up @@ -92,6 +106,7 @@ import UIKit
@IBInspectable public var maskType: String? {
didSet {
configMask()
configBorder()
}
}

Expand All @@ -118,15 +133,19 @@ import UIKit

public override func layoutSubviews() {
super.layoutSubviews()
configAfterLayoutSubviews()
autoRunAnimation()
}

// MARK: - Private
private func configInspectableProperties() {
configAnimatableProperties()
configBorder()
configTintedColor()
configBlurEffectStyle()
configGradient()
}

private func configAfterLayoutSubviews() {
configBorder()
}
}
26 changes: 22 additions & 4 deletions IBAnimatable/AnimatableTableView.swift
Expand Up @@ -27,9 +27,23 @@ import UIKit
}

// MARK: - BorderDesignable
@IBInspectable public var borderColor: UIColor?
@IBInspectable public var borderWidth: CGFloat = CGFloat.NaN
@IBInspectable public var borderSide: String?
@IBInspectable public var borderColor: UIColor? {
didSet {
configBorder()
}
}

@IBInspectable public var borderWidth: CGFloat = CGFloat.NaN {
didSet {
configBorder()
}
}

@IBInspectable public var borderSide: String? {
didSet {
configBorder()
}
}

// MARK: - GradientDesignable
@IBInspectable public var startColor: UIColor?
Expand Down Expand Up @@ -61,13 +75,17 @@ import UIKit
public override func layoutSubviews() {
super.layoutSubviews()
autoRunAnimation()
configAfterLayoutSubviews()
}

// MARK: - Private
private func configInspectableProperties() {
configAnimatableProperties()
configOpacity()
configBorder()
configGradient()
}

private func configAfterLayoutSubviews() {
configBorder()
}
}
26 changes: 22 additions & 4 deletions IBAnimatable/AnimatableTableViewCell.swift
Expand Up @@ -27,9 +27,23 @@ import UIKit
}

// MARK: - BorderDesignable
@IBInspectable public var borderColor: UIColor?
@IBInspectable public var borderWidth: CGFloat = CGFloat.NaN
@IBInspectable public var borderSide: String?
@IBInspectable public var borderColor: UIColor? {
didSet {
configBorder()
}
}

@IBInspectable public var borderWidth: CGFloat = CGFloat.NaN {
didSet {
configBorder()
}
}

@IBInspectable public var borderSide: String? {
didSet {
configBorder()
}
}

// MARK: - TableViewCellDesignable
@IBInspectable public var removeSeparatorMargins: Bool = false
Expand Down Expand Up @@ -63,15 +77,19 @@ import UIKit

public override func layoutSubviews() {
super.layoutSubviews()
configAfterLayoutSubviews()
autoRunAnimation()
}

// MARK: - Private
private func configInspectableProperties() {
configAnimatableProperties()
configOpacity()
configBorder()
configSeparatorMargins()
configGradient()
}

private func configAfterLayoutSubviews() {
configBorder()
}
}
27 changes: 22 additions & 5 deletions IBAnimatable/AnimatableTextField.swift
Expand Up @@ -34,9 +34,23 @@ import UIKit
}

// MARK: - BorderDesignable
@IBInspectable public var borderColor: UIColor?
@IBInspectable public var borderWidth: CGFloat = CGFloat.NaN
@IBInspectable public var borderSide: String?
@IBInspectable public var borderColor: UIColor? {
didSet {
configBorder()
}
}

@IBInspectable public var borderWidth: CGFloat = CGFloat.NaN {
didSet {
configBorder()
}
}

@IBInspectable public var borderSide: String? {
didSet {
configBorder()
}
}

// MARK: - ShadowDesignable
@IBInspectable public var shadowColor: UIColor? {
Expand Down Expand Up @@ -123,14 +137,17 @@ import UIKit

public override func layoutSubviews() {
super.layoutSubviews()

configAfterLayoutSubviews()
autoRunAnimation()
}

// MARK: - Private
private func configInspectableProperties() {
configAnimatableProperties()
configBorder()
configLeftImage()
}

private func configAfterLayoutSubviews() {
configBorder()
}
}

0 comments on commit d629a21

Please sign in to comment.