Skip to content
This repository has been archived by the owner on Jul 23, 2023. It is now read-only.

Commit

Permalink
Omit argument label of delegate method
Browse files Browse the repository at this point in the history
  • Loading branch information
culumn committed Sep 6, 2018
1 parent 9a4637b commit ab9ac3f
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions EFColorPicker/Classes/EFColorSelectionView.swift
Expand Up @@ -113,9 +113,9 @@ public class EFColorSelectionView: UIView, EFColorView, EFColorViewDelegate {
}

// MARK:- FBColorViewDelegate methods
public func colorView(colorView: EFColorView, didChangeColor color: UIColor) {
public func colorView(_ colorView: EFColorView, didChangeColor color: UIColor) {
self.color = color
self.delegate?.colorView(colorView: self, didChangeColor: self.color)
self.delegate?.colorView(self, didChangeColor: self.color)
}

// MARK:- Private
Expand Down
6 changes: 3 additions & 3 deletions EFColorPicker/Classes/EFColorSelectionViewController.swift
Expand Up @@ -33,7 +33,7 @@ import UIKit
// Tells the data source to return the color components.
// @param colorViewCntroller The color view.
// @param color The new color value.
func colorViewController(colorViewCntroller: EFColorSelectionViewController, didChangeColor color: UIColor)
func colorViewController(_ colorViewCntroller: EFColorSelectionViewController, didChangeColor color: UIColor)
}

public class EFColorSelectionViewController: UIViewController, EFColorViewDelegate {
Expand Down Expand Up @@ -109,7 +109,7 @@ public class EFColorSelectionViewController: UIViewController, EFColorViewDelega
}

// MARK:- EFColorViewDelegate
public func colorView(colorView: EFColorView, didChangeColor color: UIColor) {
self.delegate?.colorViewController(colorViewCntroller: self, didChangeColor: color)
public func colorView(_ colorView: EFColorView, didChangeColor color: UIColor) {
self.delegate?.colorViewController(self, didChangeColor: color)
}
}
2 changes: 1 addition & 1 deletion EFColorPicker/Classes/EFColorView.swift
Expand Up @@ -33,7 +33,7 @@ public protocol EFColorViewDelegate: class {
// Tells the data source to return the color components.
// @param colorView The color view.
// @param color The new color value.
func colorView(colorView: EFColorView, didChangeColor color: UIColor)
func colorView(_ colorView: EFColorView, didChangeColor color: UIColor)
}

/// The \c EFColorView protocol declares a view's interface for displaying and editing color value.
Expand Down
4 changes: 2 additions & 2 deletions EFColorPicker/Classes/EFHSBView.swift
Expand Up @@ -229,14 +229,14 @@ public class EFHSBView: UIView, EFColorView, UITextFieldDelegate {
@objc private func ef_colorDidChangeValue(sender: EFColorWheelView) {
colorComponents.hue = sender.hue
colorComponents.saturation = sender.saturation
self.delegate?.colorView(colorView: self, didChangeColor: self.color)
self.delegate?.colorView(self, didChangeColor: self.color)
self.reloadData()
}

@objc private func ef_brightnessDidChangeValue(sender: EFColorComponentView) {
colorComponents.brightness = sender.value
self.colorWheel.brightness = sender.value
self.delegate?.colorView(colorView: self, didChangeColor: self.color)
self.delegate?.colorView(self, didChangeColor: self.color)
self.reloadData()
}
}
2 changes: 1 addition & 1 deletion EFColorPicker/Classes/EFRGBView.swift
Expand Up @@ -106,7 +106,7 @@ public class EFRGBView: UIView, EFColorView {

@objc @IBAction private func ef_colorComponentDidChangeValue(_ sender: EFColorComponentView) {
self.ef_setColorComponentValue(value: sender.value / sender.maximumValue, atIndex: UInt(sender.tag))
self.delegate?.colorView(colorView: self, didChangeColor: self.color)
self.delegate?.colorView(self, didChangeColor: self.color)
self.reloadData()
}

Expand Down
2 changes: 1 addition & 1 deletion Example/EFColorPicker/ViewController.swift
Expand Up @@ -112,7 +112,7 @@ class ViewController: UIViewController, UIPopoverPresentationControllerDelegate,
}

// MARK:- EFColorSelectionViewControllerDelegate
func colorViewController(colorViewCntroller: EFColorSelectionViewController, didChangeColor color: UIColor) {
func colorViewController(_ colorViewCntroller: EFColorSelectionViewController, didChangeColor color: UIColor) {
self.view.backgroundColor = color

// TODO: You can do something here when color changed.
Expand Down

0 comments on commit ab9ac3f

Please sign in to comment.