Skip to content

Commit

Permalink
Create alias for cornerRadius variable (#192)
Browse files Browse the repository at this point in the history
To avoid conflicting with UIView extension redefining cornerRadius.
  • Loading branch information
iwb-kevin-hirsch committed Sep 25, 2018
1 parent 3f2a826 commit 75e9d13
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 2 deletions.
2 changes: 1 addition & 1 deletion DropDown.podspec
Original file line number Diff line number Diff line change
@@ -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
Expand Down
9 changes: 9 additions & 0 deletions DropDown/src/DropDown.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
14 changes: 13 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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+
Expand Down

0 comments on commit 75e9d13

Please sign in to comment.