import Magnetic
class ViewController: UIViewController {
var magnetic: Magnetic?
override func loadView() {
super.loadView()
let magneticView = MagneticView(frame: self.view.bounds)
magnetic = magneticView.magnetic
self.view.addSubview(magneticView)
}
}
Properties
var magneticDelegate: MagneticDelegate? // magnetic delegate
var allowsMultipleSelection: Bool // controls whether you can select multiple nodes. defaults to true
var selectedChildren: [Node] // returns selected chidren
Magnetic
Magnetic is a customizable bubble picker like the Apple Music genre selection.
Demo Video
Features
Requirements
Usage
A
Magnetic
object is an SKScene.To display, you present it from an SKView object.
Properties
Nodes
A
Node
object is a SKShapeNode subclass.Interaction
Properties
Animations
Delegation
The
MagneticDelegate
protocol provides a number of functions for observing the current state of nodes.Customization
Subclass the Node for customization.
For example, a node with an image by default:
Installation
CocoaPods
To install with CocoaPods, simply add this in your
Podfile
:Carthage
To install with Carthage, simply add this in your
Cartfile
:Mentions
Communication
Credits
https://github.com/igalata/Bubble-Picker
License
Magnetic is available under the MIT license. See the LICENSE file for more info.