A beautiful radar view to show nearby items (users, restaurants, ...) with ripple animation, fully customizable
To run the example project, clone the repo, and run pod install
from the Example directory first.
This project is inspired by: https://dribbble.com/shots/2242921-Find-Nearby-Users-Concept
HGRippleRadarView is available through CocoaPods. To install
it, simply add the following line to your Podfile:
pod 'HGRippleRadarView'
HGRippleRadarView is also available through Carthage. To install
it, simply add the following line to your Cartfile:
github "HamzaGhazouani/HGRippleRadarView"
let rippleView = RippleView(frame: myFrame)
let radarView = RadarView(frame: myFrame)
The radius of the central disk in the view, if you would like to hide it, you can set the radius to 0
The color of the central disk in the view, the default color is ripplePink color
This property make distance between the first circle and the central disk
The number of circles to draw around the disk, the default value is 3
The padding between circles, circles could be drawn outside the frame
The color of the off status of the circle, used for animation
The color of the on status of the circle, used for animation
The duration of the animation, the default value is 0.9
The padding between items, the default value is 10
If you would like to add one item, use the method add(item:using:)
If you would like to add multiple items, it’s recommended to use the method add(items:using:)
If you would like to remove an item, use the method remove(item:)
If you would like to customize items, use the protocol RadarViewDataSource
and implement:
radarView?.dataSource = self
...
func radarView(radarView: RadarView, viewFor item: Item, preferredSize: CGSize) -> UIView {
let myCustomItemView = UIView(frame: CGRect(x: 0, y: 0, width: preferredSize.width, height: preferredSize.height))
return myCustomItemView
}
If you would like to receive action on items, use the protocol RadarViewDelegate
and implement:
radarView?.delegate = self
...
func radarView(radarView: RadarView, didSelect item: Item) {
print(item.uniqueKey)
}
Full documentation is available on CocoaDocs.
You can also install documentation locally using jazzy.
HamzaGhazouani, [email protected]
HGRippleRadarView is available under the MIT license. See the LICENSE file for more info.