Skip to content

Commit

Permalink
Optimize Access Control
Browse files Browse the repository at this point in the history
  • Loading branch information
mtfum committed Apr 11, 2019
1 parent 6eb488e commit cbeb80d
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 17 deletions.
4 changes: 2 additions & 2 deletions PKHUD/FrameView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ internal class FrameView: UIVisualEffectView {
commonInit()
}

fileprivate func commonInit() {
private func commonInit() {
backgroundColor = UIColor(white: 0.8, alpha: 0.36)
layer.cornerRadius = 9.0
layer.masksToBounds = true
Expand All @@ -45,7 +45,7 @@ internal class FrameView: UIVisualEffectView {
addMotionEffect(group)
}

fileprivate var _content = UIView()
private var _content = UIView()
internal var content: UIView {
get {
return _content
Expand Down
2 changes: 1 addition & 1 deletion PKHUD/HUD.swift
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public final class HUD {
}

// MARK: Private methods
fileprivate static func contentView(_ content: HUDContentType) -> UIView {
private static func contentView(_ content: HUDContentType) -> UIView {
switch content {
case .success:
return PKHUDSuccessView()
Expand Down
16 changes: 8 additions & 8 deletions PKHUD/PKHUD.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@ import UIKit
/// The PKHUD object controls showing and hiding of the HUD, as well as its contents and touch response behavior.
open class PKHUD: NSObject {

fileprivate struct Constants {
private struct Constants {
static let sharedHUD = PKHUD()
}

public var viewToPresentOn: UIView?

fileprivate let container = ContainerView()
fileprivate var hideTimer: Timer?
private let container = ContainerView()
private var hideTimer: Timer?

public typealias TimerAction = (Bool) -> Void
fileprivate var timerActions = [String: TimerAction]()
private var timerActions = [String: TimerAction]()

/// Grace period is the time (in seconds) that the invoked method may be run without
/// showing the HUD. If the task finishes before the grace time runs out, the HUD will
Expand All @@ -45,7 +45,7 @@ open class PKHUD: NSObject {
/// This may be used to prevent HUD display for very short tasks.
/// Defaults to 0 (no grace time).
public var gracePeriod: TimeInterval = 0
fileprivate var graceTimer: Timer?
private var graceTimer: Timer?

// MARK: Public

Expand Down Expand Up @@ -149,7 +149,7 @@ open class PKHUD: NSObject {
}
}

func showContent() {
private func showContent() {
graceTimer?.invalidate()
container.showFrameView()
startAnimatingContentView()
Expand Down Expand Up @@ -187,13 +187,13 @@ open class PKHUD: NSObject {
self.startAnimatingContentView()
}

internal func startAnimatingContentView() {
private func startAnimatingContentView() {
if let animatingContentView = contentView as? PKHUDAnimating, isVisible {
animatingContentView.startAnimation()
}
}

internal func stopAnimatingContentView() {
private func stopAnimatingContentView() {
if let animatingContentView = contentView as? PKHUDAnimating {
animatingContentView.stopAnimation?()
}
Expand Down
2 changes: 1 addition & 1 deletion PKHUD/PKHUDAssets.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ open class PKHUDAssets: NSObject {
open class var progressActivityImage: UIImage { return PKHUDAssets.bundledImage(named: "progress_activity") }
open class var progressCircularImage: UIImage { return PKHUDAssets.bundledImage(named: "progress_circular") }

internal class func bundledImage(named name: String) -> UIImage {
private class func bundledImage(named name: String) -> UIImage {
let primaryBundle = Bundle(for: PKHUDAssets.self)
if let image = UIImage(named: name, in: primaryBundle, compatibleWith: nil) {
// Load image in cases where PKHUD is directly integrated
Expand Down
6 changes: 3 additions & 3 deletions PKHUD/PKHUDErrorView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import UIKit
/// PKHUDErrorView provides an animated error (cross) view.
open class PKHUDErrorView: PKHUDSquareBaseView, PKHUDAnimating {

var dashOneLayer = PKHUDErrorView.generateDashLayer()
var dashTwoLayer = PKHUDErrorView.generateDashLayer()
private var dashOneLayer = PKHUDErrorView.generateDashLayer()
private var dashTwoLayer = PKHUDErrorView.generateDashLayer()

class func generateDashLayer() -> CAShapeLayer {
let dash = CAShapeLayer()
Expand Down Expand Up @@ -57,7 +57,7 @@ open class PKHUDErrorView: PKHUDSquareBaseView, PKHUDAnimating {
dashTwoLayer.position = layer.position
}

func rotationAnimation(_ angle: CGFloat) -> CABasicAnimation {
private func rotationAnimation(_ angle: CGFloat) -> CABasicAnimation {
var animation: CABasicAnimation
if #available(iOS 9.0, *) {
let springAnimation = CASpringAnimation(keyPath: "transform.rotation.z")
Expand Down
2 changes: 1 addition & 1 deletion PKHUD/PKHUDSystemActivityIndicatorView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public final class PKHUDSystemActivityIndicatorView: PKHUDSquareBaseView, PKHUDA
commonInit()
}

func commonInit () {
private func commonInit () {
backgroundColor = UIColor.clear
alpha = 0.8

Expand Down
2 changes: 1 addition & 1 deletion PKHUD/PKHUDTextView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ open class PKHUDTextView: PKHUDWideBaseView {
commonInit("")
}

func commonInit(_ text: String?) {
private func commonInit(_ text: String?) {
titleLabel.text = text
addSubview(titleLabel)
}
Expand Down

0 comments on commit cbeb80d

Please sign in to comment.