Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove BackgroundDesignable corruption of UIKit #506

Merged
merged 2 commits into from
Jul 7, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Add new mask type `.ellipse`. [#481](https://github.com/IBAnimatable/IBAnimatabl

#### Bugfixes
- `PlaceholderDesignable` now applies `placeholderColor` to `Placeholder` defined in Interface Builder before checking the `placeholderText` property. [#499](https://github.com/IBAnimatable/IBAnimatable/pull/499) by [@SD10](https://github.com/sd10)
- Fixes bug where Interface Builder doesn't recognize the delegate outlet for `UITableView` and `UICollectionView`. [#506](https://github.com/IBAnimatable/IBAnimatable/pull/506) by [@SD10](https://github.com/sd10)
### [4.1.0](https://github.com/IBAnimatable/IBAnimatable/releases/tag/4.1.0)

#### API breaking changes
Expand Down
24 changes: 9 additions & 15 deletions Sources/Protocols/Designable/BackgroundImageDesignable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,33 +5,27 @@

import UIKit

/// Protocol for designing background image
public protocol BackgroundImageDesignable: class {
/// Protocol for designing background
public protocol BackgroundDesignable: class {

/**
* The background image
* The background view
*/
var backgroundImage: UIImage? { get set }
var backgroundView: UIView? { get set }

}

/// Protocol for designing background
public protocol BackgroundDesignable: class {
/// Protocol for designing background image
public protocol BackgroundImageDesignable: class, BackgroundDesignable {

/**
* The background view
* The background image
*/
var backgroundView: UIView? { get set }
var backgroundImage: UIImage? { get set }

}

extension UITableViewCell: BackgroundDesignable {}
extension UITableViewHeaderFooterView: BackgroundDesignable {}
extension UITableView: BackgroundDesignable {}
extension UICollectionViewCell: BackgroundDesignable {}
extension UICollectionView: BackgroundDesignable {}

public extension BackgroundImageDesignable where Self: BackgroundDesignable {
public extension BackgroundImageDesignable {

public func configureBackgroundImage() {
if let image = backgroundImage {
Expand Down