From 75e9d13ec6ed383a5e3053226c3a1f8f35d4c7eb Mon Sep 17 00:00:00 2001 From: Kevin Hirsch Date: Tue, 25 Sep 2018 11:45:56 +0200 Subject: [PATCH] Create alias for cornerRadius variable (#192) To avoid conflicting with UIView extension redefining cornerRadius. --- DropDown.podspec | 2 +- DropDown/src/DropDown.swift | 9 +++++++++ README.md | 14 +++++++++++++- 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/DropDown.podspec b/DropDown.podspec index 8609090..8b39002 100644 --- a/DropDown.podspec +++ b/DropDown.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |s| s.name = "DropDown" - s.version = "2.3.5" + s.version = "2.3.6" s.summary = "A Material Design drop down" s.description = <<-DESC diff --git a/DropDown/src/DropDown.swift b/DropDown/src/DropDown.swift index 6c5821b..3304158 100644 --- a/DropDown/src/DropDown.swift +++ b/DropDown/src/DropDown.swift @@ -230,6 +230,15 @@ public final class DropDown: UIView { didSet { reloadAllComponents() } } + /** + Alias method for `cornerRadius` variable to avoid ambiguity. + */ + @objc public dynamic func setupCornerRadius(_ radius: CGFloat) { + tableViewContainer.layer.cornerRadius = radius + tableView.layer.cornerRadius = radius + reloadAllComponents() + } + /** The color of the shadow. diff --git a/README.md b/README.md index 3a0e53c..aaff713 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![Twitter: @kevinh6113](http://img.shields.io/badge/contact-%40kevinh6113-70a1fb.svg?style=flat)](https://twitter.com/kevinh6113) [![License: MIT](http://img.shields.io/badge/license-MIT-70a1fb.svg?style=flat)](https://github.com/AssistoLab/DropDown/blob/master/README.md) -[![Version](http://img.shields.io/badge/version-2.3.5-green.svg?style=flat)](https://github.com/AssistoLab/DropDown) +[![Version](http://img.shields.io/badge/version-2.3.6-green.svg?style=flat)](https://github.com/AssistoLab/DropDown) [![Cocoapods](http://img.shields.io/badge/Cocoapods-available-green.svg?style=flat)](http://cocoadocs.org/docsets/DropDown/) [![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) @@ -273,6 +273,18 @@ when calling the `show` method, it returns a tuple like this: - `canBeDisplayed`: Tells if there is enough height to display the drop down. If its value is `false`, the drop down is not showed. - `offscreenHeight`: If the drop down was not able to show all cells from the data source at once, `offscreenHeight` will contain the height needed to display all cells at once (without having to scroll through them). This can be used in a scroll view or table view to scroll enough before showing the drop down. +## Issues + +If you experience the compiler error *"Ambiguous use of 'cornerRadius'"* on line: +```swift +DropDown.appearance().cornerRadius = 10 +``` + +Please use intead: +```swift +DropDown.appearance().setupCornerRadius(10) // available since v2.3.6 +``` + ## Requirements * Xcode 8+