Skip to content

Commit 75e9d13

Browse files
Create alias for cornerRadius variable (#192)
To avoid conflicting with UIView extension redefining cornerRadius.
1 parent 3f2a826 commit 75e9d13

File tree

3 files changed

+23
-2
lines changed

3 files changed

+23
-2
lines changed

DropDown.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Pod::Spec.new do |s|
22

33
s.name = "DropDown"
4-
s.version = "2.3.5"
4+
s.version = "2.3.6"
55
s.summary = "A Material Design drop down"
66

77
s.description = <<-DESC

DropDown/src/DropDown.swift

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,15 @@ public final class DropDown: UIView {
230230
didSet { reloadAllComponents() }
231231
}
232232

233+
/**
234+
Alias method for `cornerRadius` variable to avoid ambiguity.
235+
*/
236+
@objc public dynamic func setupCornerRadius(_ radius: CGFloat) {
237+
tableViewContainer.layer.cornerRadius = radius
238+
tableView.layer.cornerRadius = radius
239+
reloadAllComponents()
240+
}
241+
233242
/**
234243
The color of the shadow.
235244

README.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[![Twitter: @kevinh6113](http://img.shields.io/badge/contact-%40kevinh6113-70a1fb.svg?style=flat)](https://twitter.com/kevinh6113)
44
[![License: MIT](http://img.shields.io/badge/license-MIT-70a1fb.svg?style=flat)](https://github.com/AssistoLab/DropDown/blob/master/README.md)
5-
[![Version](http://img.shields.io/badge/version-2.3.5-green.svg?style=flat)](https://github.com/AssistoLab/DropDown)
5+
[![Version](http://img.shields.io/badge/version-2.3.6-green.svg?style=flat)](https://github.com/AssistoLab/DropDown)
66
[![Cocoapods](http://img.shields.io/badge/Cocoapods-available-green.svg?style=flat)](http://cocoadocs.org/docsets/DropDown/)
77
[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)
88

@@ -273,6 +273,18 @@ when calling the `show` method, it returns a tuple like this:
273273
- `canBeDisplayed`: Tells if there is enough height to display the drop down. If its value is `false`, the drop down is not showed.
274274
- `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.
275275

276+
## Issues
277+
278+
If you experience the compiler error *"Ambiguous use of 'cornerRadius'"* on line:
279+
```swift
280+
DropDown.appearance().cornerRadius = 10
281+
```
282+
283+
Please use intead:
284+
```swift
285+
DropDown.appearance().setupCornerRadius(10) // available since v2.3.6
286+
```
287+
276288
## Requirements
277289

278290
* Xcode 8+

0 commit comments

Comments
 (0)