All Projects → bradjasper → Radialmenu

bradjasper / Radialmenu

Licence: mit
RadialMenu is a custom control for providing a touch context menu (like iMessage recording in iOS 8) built with Swift & POP

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Radialmenu

SimpleScreens
Simple Screens is a library of screens and screen components (forms, sections, transitions) to be included, extended, or generally reused in applications based on Moqui Framework and Mantle Business Artifacts.
Stars: ✭ 20 (-93.15%)
Mutual labels:  user-interface
spatterlight
Updated fork of Spatterlight
Stars: ✭ 60 (-79.45%)
Mutual labels:  cocoa
Realityui
A Swift Package for creating familiar UI Elements and animations in a RealityKit rendered Augmented Reality or Virtual Reality scene.
Stars: ✭ 275 (-5.82%)
Mutual labels:  user-interface
scalaui
Scala Native GUI framework based on libui
Stars: ✭ 56 (-80.82%)
Mutual labels:  cocoa
isotope
UI library that aims to bring simplicity and intuitiveness back to Web Development. 🚀
Stars: ✭ 52 (-82.19%)
Mutual labels:  user-interface
Tonic
A Low Profile Component Framework. Stable, Minimal, Auditable, and Build-Tool-Free.
Stars: ✭ 265 (-9.25%)
Mutual labels:  user-interface
Kit
A collection of Obj-C classes and categories for macOS.
Stars: ✭ 19 (-93.49%)
Mutual labels:  cocoa
Linkedideas
A macOS/iOS apps to treat ideas as links of concepts.
Stars: ✭ 286 (-2.05%)
Mutual labels:  cocoa
xcode-config
My Xcode config - Alfred Workflow, File templates, Xcode code snippets, themes, IDETextKeyBindingSet
Stars: ✭ 16 (-94.52%)
Mutual labels:  cocoa
Xcode One Dark
Atom One Dark theme for Xcode
Stars: ✭ 273 (-6.51%)
Mutual labels:  cocoa
VBA-Arrays
😎 Array functions that are similar JavaScript functions. Example: Push, Pop, Shift, Unshift, Sort, length, toString.
Stars: ✭ 48 (-83.56%)
Mutual labels:  pop
Eloquent
Eloquent is a bible study tool for macOS
Stars: ✭ 88 (-69.86%)
Mutual labels:  cocoa
Visualplus
🎨 The VisualPlus Framework (VPF) for WinForms allows you to rapidly deploy professional .NET applications with customizable components and controls.
Stars: ✭ 268 (-8.22%)
Mutual labels:  user-interface
Rearrange
Collection of utilities for interacting with NSRange and NSTextRange
Stars: ✭ 28 (-90.41%)
Mutual labels:  cocoa
Nshipster.com
A journal of the overlooked bits in Objective-C, Swift, and Cocoa. Updated weekly.
Stars: ✭ 280 (-4.11%)
Mutual labels:  cocoa
WebPKit
A framework that extends a variety of Cocoa APIs with capabilities for encoding and decoding WebP files for all of Apple's platforms.
Stars: ✭ 29 (-90.07%)
Mutual labels:  cocoa
Zui
Immediate Mode User Interface
Stars: ✭ 261 (-10.62%)
Mutual labels:  user-interface
Macdriver
Native Mac APIs for Go
Stars: ✭ 3,582 (+1126.71%)
Mutual labels:  cocoa
Runtimesummary
一个集合了常用 Objective-C Runtime 使用方法的 Playground。
Stars: ✭ 281 (-3.77%)
Mutual labels:  cocoa
Wpopup
一个简单使用并且高度定制的Popupwindow。超简单实现朋友圈点赞效果,并且只用一个WPopup!完全不用担心复用问题!点击切换动画效果等!
Stars: ✭ 269 (-7.88%)
Mutual labels:  pop

RadialMenu

Looking for help? For $150/hr I'll help with your RadialMenu problems including integrating it into your project. Email [email protected] to get started!

Experimental Software: Fun to play with, but probably shouldn't put it in production (yet).

RadialMenu is a custom control that allows you to provide a context menu to a user on a touch screen (generally after a long press). This is similar to the record functionality Apple introduced for iMessage in iOS 8.

Here's an example of the iMessage menu recreated, taken from the demo app:

iMessage RadialMenu Custom Control Example

You can create your own custom menus as well

Custom RadialMenu Control Example

Plus it's built with Facebook POP, so it's very flexible!

Read the blog entry at http://bradjasper.com/blog/radialmenu-imessage-ios8/ for more information.

Install

Copy the source files from the RadialMenu/ directory into your project.

How to use?

There are two examples provided which show how to use the control in detail (download and run the Xcode project). At a highlevel:

// Create a radial submenu (it's just a UIView subclass)
let subMenuRed = RadialSubMenu(frame: frameOfSubMenu)
subMenuRed.userInteractionEnabled = true
subMenuRed.layer.cornerRadius = subMenuRadius
subMenuRed.layer.backgroundColor = UIColor.redColor()
subMenuRed.layer.borderColor = UIColor.blackColor()
subMenuRed.layer.borderWidth = 1
subMenuRed.tag = tag


// Create multiple submenus and assign to array
let subMenus = [subMenuRed, subMenuBlue, ...]


// Initialize the radial menu
let radialMenu = RadialMenu(menus: subMenus, radius: menuRadius)
radialMenu.center = view.center
radialMenu.openDelayStep = 0.05
radialMenu.closeDelayStep = 0.00
radialMenu.minAngle = 180
radialMenu.maxAngle = 360
radialMenu.activatedDelay = 1.0
radialMenu.backgroundView.alpha = 0.0

// Setup event handlers for specific actions
radialMenu.onOpen = {
    // menu has opened
}

radialMenu.onHighlight = { subMenu in
    // perform highlight change
}

radialMenu.onActivate = { subMenu in
    // did select subMenu
}


// Setup menu to show when pressing a button
let longPress = UILongPressGestureRecognizer(target: self, action: "pressedButton:")
button.addGestureRecognizer(longPress)

// Gesture handler can react to menu in different ways depending what you want
// (for example, keeping the menu open if nothing is selected)
func pressedButton(gesture:UIGestureRecognizer) {
    switch(gesture.state) {
        case .Began:
            radialMenu.openAtPosition(button.center)
        case .Ended:
            radialMenu.close()
        case .Changed:
            radialMenu.moveAtPosition(gesture.locationInView(self.view))
        default:
            break
    }
}

Todo

  • Documentation
  • Convert to NSControl sublcass
  • Figure out CocoaPods/framework distribution for Swift
  • Fix other FIXME's & TODO's in source code

LICENSE

MIT

Read More

Contact

Web: http://bradjasper.com
Twitter: @bradjasper
Email: [email protected]

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].