Skip to content

Commit

Permalink
Remove empty spaces and lines
Browse files Browse the repository at this point in the history
  • Loading branch information
quangctkm9207 committed Oct 9, 2019
1 parent f652f8d commit 6a274d9
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 17 deletions.
2 changes: 1 addition & 1 deletion MaterialShowcase/MaterialShowcase+Calculations.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import Foundation
import UIKit

extension MaterialShowcase {

func isInGutter(center: CGPoint) -> Bool {
return center.y < offsetThreshold || containerView.frame.height - center.y < offsetThreshold
}
Expand Down
11 changes: 3 additions & 8 deletions MaterialShowcase/MaterialShowcase.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import UIKit

public class MaterialShowcase: UIView {


@objc public enum BackgroundTypeStyle: Int {
case circle //default
case full//full screen
Expand Down Expand Up @@ -52,7 +51,7 @@ public class MaterialShowcase: UIView {
var targetRippleView: UIView!
var targetCopyView: UIView!
var instructionView: MaterialShowcaseInstructionView!

var onTapThrough: (() -> Void)?

// MARK: Public Properties
Expand Down Expand Up @@ -91,8 +90,6 @@ public class MaterialShowcase: UIView {
// Delegate
@objc public weak var delegate: MaterialShowcaseDelegate?



public init() {
// Create frame
let frame = CGRect(x: 0, y: 0, width: UIScreen.main.bounds.width, height: UIScreen.main.bounds.height)
Expand Down Expand Up @@ -200,9 +197,7 @@ extension MaterialShowcase {
handler()
}
}




}

// MARK: - Utility API
Expand Down Expand Up @@ -522,7 +517,7 @@ extension MaterialShowcase {
if delegate != nil && delegate?.showCaseDidDismiss != nil {
delegate?.showCaseDidDismiss?(showcase: self, didTapTarget: didTapTarget)
}

if didTapTarget {
onTapThrough?()
}
Expand Down
5 changes: 3 additions & 2 deletions MaterialShowcase/MaterialShowcaseController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,11 @@ open class MaterialShowcaseController {
}

extension MaterialShowcaseController: MaterialShowcaseDelegate {
public func showCaseWillDismiss(showcase: MaterialShowcase, didTapTarget: Bool) {
public func showCaseWillDismiss(showcase: MaterialShowcase, didTapTarget: Bool) {
delegate?.materialShowcaseController(self, materialShowcaseWillDisappear: showcase, forIndex: currentIndex)
}
public func showCaseDidDismiss(showcase: MaterialShowcase, didTapTarget: Bool) {

public func showCaseDidDismiss(showcase: MaterialShowcase, didTapTarget: Bool) {
delegate?.materialShowcaseController(self, materialShowcaseDidDisappear: showcase, forIndex: currentIndex)
currentShowcase = nil
if started {
Expand Down
12 changes: 6 additions & 6 deletions MaterialShowcase/MaterialShowcaseInstructionView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public class MaterialShowcaseInstructionView: UIView {
/// Configures and adds primary label view
private func addPrimaryLabel() {
if primaryLabel != nil {
primaryLabel.removeFromSuperview()
primaryLabel.removeFromSuperview()
}

primaryLabel = UILabel()
Expand All @@ -89,7 +89,7 @@ public class MaterialShowcaseInstructionView: UIView {
/// Configures and adds secondary label view
private func addSecondaryLabel() {
if secondaryLabel != nil {
secondaryLabel.removeFromSuperview()
secondaryLabel.removeFromSuperview()
}

secondaryLabel = UILabel()
Expand Down Expand Up @@ -117,14 +117,14 @@ public class MaterialShowcaseInstructionView: UIView {
private func getWidth() -> CGFloat{
//superview was left side
if (self.superview?.frame.origin.x)! < CGFloat(0) {
return frame.width - (frame.minX/2)
return frame.width - (frame.minX/2)
} else if ((self.superview?.frame.origin.x)! + (self.superview?.frame.size.width)! >
UIScreen.main.bounds.width) { //superview was right side
return (frame.width - frame.minX)/2
UIScreen.main.bounds.width) { //superview was right side
return (frame.width - frame.minX)/2
}
return (frame.width - frame.minX)
}

/// Overrides this to add subviews. They will be drawn when calling show()
public override func layoutSubviews() {
super.layoutSubviews()
Expand Down

0 comments on commit 6a274d9

Please sign in to comment.