Skip to content

Commit

Permalink
Merge pull request #1 from cuzv/open-access
Browse files Browse the repository at this point in the history
Allows subclassing and initialization from IB
  • Loading branch information
perfectdim authored Sep 10, 2020
2 parents 168827e + ab8a742 commit 09242b8
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 247 deletions.
42 changes: 0 additions & 42 deletions CustomBlurEffectView/CustomBlurEffect.swift

This file was deleted.

18 changes: 0 additions & 18 deletions CustomBlurEffectView/CustomBlurEffectView.h

This file was deleted.

139 changes: 0 additions & 139 deletions CustomBlurEffectView/CustomBlurEffectView.swift

This file was deleted.

22 changes: 0 additions & 22 deletions CustomBlurEffectView/Info.plist

This file was deleted.

21 changes: 0 additions & 21 deletions CustomBlurEffectView/UIVisualEffect+effectSettings.swift

This file was deleted.

17 changes: 12 additions & 5 deletions Sources/CustomBlurEffectView/CustomBlurEffectView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import UIKit

public class CustomBlurEffectView: UIView {
open class CustomBlurEffectView: UIView {

private enum Constants {
static let blurRadiusKey = "blurRadius"
Expand All @@ -18,21 +18,21 @@ public class CustomBlurEffectView: UIView {
// MARK: - Public

/// Blur radius. Defaults to `10`
public var blurRadius: CGFloat = 10.0 {
open var blurRadius: CGFloat = 10.0 {
didSet {
_setValue(blurRadius, forKey: Constants.blurRadiusKey)
}
}

/// Tint color. Defaults to `nil`
public var colorTint: UIColor? {
open var colorTint: UIColor? {
didSet {
_setValue(colorTint, forKey: Constants.colorTintKey)
}
}

/// Tint color alpha. Defaults to `0.8`
public var colorTintAlpha: CGFloat = 0.8 {
open var colorTintAlpha: CGFloat = 0.8 {
didSet {
_setValue(colorTintAlpha, forKey: Constants.colorTintAlphaKey)
}
Expand Down Expand Up @@ -60,8 +60,15 @@ public class CustomBlurEffectView: UIView {
}
}

required init?(coder: NSCoder) {
required public init?(coder: NSCoder) {
super.init(coder: coder)
backgroundColor = .clear
setupViews()
defer {
blurRadius = 10.0
colorTint = nil
colorTintAlpha = 0.8
}
}


Expand Down

0 comments on commit 09242b8

Please sign in to comment.