All Projects → pixyzehn → Pathmenu

pixyzehn / Pathmenu

Licence: mit
Path 4.2 menu using CoreAnimation in Swift. Inspired by AwesomeMenu(https://github.com/levey/AwesomeMenu).

Programming Languages

swift
15916 projects

Labels

Projects that are alternatives of or similar to Pathmenu

react-svg-pathline
React component for drawing SVG path through set of points, smoothing the corners
Stars: ✭ 42 (-83.59%)
Mutual labels:  path
Pathslider
Numerical slider that follows a Bezier path
Stars: ✭ 15 (-94.14%)
Mutual labels:  path
readdir
Recursively read a directory, blazing fast. Use with picomatch or micromatch to match globs.
Stars: ✭ 37 (-85.55%)
Mutual labels:  path
XRadarView
A highly customizable radar view for Android
Stars: ✭ 106 (-58.59%)
Mutual labels:  path
file-icon-cli
Get the icon of a file or app as a PNG image (macOS)
Stars: ✭ 73 (-71.48%)
Mutual labels:  path
is-valid-glob
Return true if a value is a valid glob pattern string, or array of glob patterns.
Stars: ✭ 21 (-91.8%)
Mutual labels:  path
path-absolutize
A library for extending `Path` and `PathBuf` in order to get an absolute path and remove the containing dots.
Stars: ✭ 37 (-85.55%)
Mutual labels:  path
get-installed-path
Get locally or globally installation path of given package name.
Stars: ✭ 39 (-84.77%)
Mutual labels:  path
svg-path-bbox
SVG paths bounding box calculator
Stars: ✭ 17 (-93.36%)
Mutual labels:  path
requireg
Resolve and require local & global modules in node.js like a boss
Stars: ✭ 45 (-82.42%)
Mutual labels:  path
get-bin-path
Get the current package's binary path
Stars: ✭ 25 (-90.23%)
Mutual labels:  path
relative-path
Portable relative UTF-8 paths for Rust.
Stars: ✭ 54 (-78.91%)
Mutual labels:  path
monopati
Well-typed paths
Stars: ✭ 20 (-92.19%)
Mutual labels:  path
path-that-svg
Path that SVG!
Stars: ✭ 45 (-82.42%)
Mutual labels:  path
is-relative
Returns `true` if a file path appears to be relative. Moved from the "relative" lib.
Stars: ✭ 13 (-94.92%)
Mutual labels:  path
llvm-epp
Efficient Path Profiling using LLVM
Stars: ✭ 16 (-93.75%)
Mutual labels:  path
plugins
Elder.js plugins and community plugins.
Stars: ✭ 80 (-68.75%)
Mutual labels:  path
react-svg-curve
React components to draw different types of curves with svg
Stars: ✭ 42 (-83.59%)
Mutual labels:  path
PathBuilder
SwiftUI result builder for Path
Stars: ✭ 48 (-81.25%)
Mutual labels:  path
relative
Easily calculate the relative path from file A to file B in Node.js project. Will calculate correctly from a file to a directory, file to file, directory to file, and directory to directory.
Stars: ✭ 34 (-86.72%)
Mutual labels:  path

Notice: PathMenu is no longer being maintained/updated.

PathMenu

Platform Swift3.0 Build Status License

Path 4.2 menu using CoreAnimation in Swift. Inspired by AwesomeMenu.

Screenshot

PathMenu-Sample PathMenu

Installation

Cocoapods

The easiest way to get started is to use CocoaPods. Add the following line to your Podfile:

platform :ios, '8.0'
use_frameworks!
# The following is a Library of Swift.
pod 'PathMenu'

Then, run the following command:

pod install

Carthage

Carthage is a decentralized dependency manager that automates the process of adding frameworks to your Cocoa application.

You can install Carthage with Homebrew using the following command:

$ brew update
$ brew install carthage

To integrate PathMenu into your Xcode project using Carthage, specify it in your Cartfile:

github "pixyzehn/PathMenu"

Run carthage update.

$ carthage update

Other

Add the PathMenu (including PathMenu.swift and PathMenuItem.swift) folder into your project.


How to use it?

Create the PathMenu by setting up the PathMenuItem.

For the details, please refer to PathMenu-Sample.

let menuItemImage = UIImage(named: "bg-menuitem")!
let menuItemHighlitedImage = UIImage(named: "bg-menuitem-highlighted")!

let starImage = UIImage(named: "icon-star")!

let starMenuItem1 = PathMenuItem(image: menuItemImage, highlightedImage: menuItemHighlitedImage, contentImage: starImage)

let starMenuItem2 = PathMenuItem(image: menuItemImage, highlightedImage: menuItemHighlitedImage, contentImage: starImage)

let starMenuItem3 = PathMenuItem(image: menuItemImage, highlightedImage: menuItemHighlitedImage, contentImage: starImage)

let starMenuItem4 = PathMenuItem(image: menuItemImage, highlightedImage: menuItemHighlitedImage, contentImage: starImage)

let starMenuItem5 = PathMenuItem(image: menuItemImage, highlightedImage: menuItemHighlitedImage, contentImage: starImage)

let items = [starMenuItem1, starMenuItem2, starMenuItem3, starMenuItem4, starMenuItem5]

let startItem = PathMenuItem(image: UIImage(named: "bg-addbutton")!,
                  highlightedImage: UIImage(named: "bg-addbutton-highlighted"),
                      contentImage: UIImage(named: "icon-plus"),
           highlightedContentImage: UIImage(named: "icon-plus-highlighted"))

let menu = PathMenu(frame: view.bounds, startItem: startItem, items: items)
menu.delegate = self

And then, setup the PathMenu and some options.

The following is the options about animation and position.

PathMenu-Sample project is similar to real Path’s menu.

Quote from the PathMenu-Sample project.

menu.startPoint = CGPointMake(UIScreen.mainScreen().bounds.width/2, self.view.frame.size.height - 30.0)
menu.menuWholeAngle = CGFloat(M_PI) - CGFloat(M_PI/5)
menu.rotateAngle = -CGFloat(M_PI_2) + CGFloat(M_PI/5) * 1/2
menu.timeOffset = 0.0
menu.farRadius = 110.0
menu.nearRadius = 90.0
menu.endRadius = 100.0
menu.animationDuration = 0.5

The order is farRadius→nearRadius→endRadius.

Default values are as follows:

startPoint = CGPointMake(UIScreen.mainScreen().bounds.width/2, UIScreen.mainScreen().bounds.height/2)
timeOffset                    = 0.036
rotateAngle                   = 0.0
menuWholeAngle                = CGFloat(M_PI * 2)
expandRotation                = -CGFloat(M_PI * 2)
closeRotation                 = CGFloat(M_PI * 2)
animationDuration             = 0.5
expandRotateAnimationDuration = 2.0
closeRotateAnimationDuration  = 1.0
startMenuAnimationDuration    = 0.2
nearRadius                    = 110.0
endRadius                     = 120.0
farRadius                     = 140.0

Delegate protocol (PathMenuDelegate)

func didSelect(on menu: PathMenu, index: Int)
func didFinishAnimationClose(on menu: PathMenu)
func didFinishAnimationOpen(on menu: PathMenu)
func willStartAnimationOpen(on menu: PathMenu)
func willStartAnimationClose(on menu: PathMenu)

Licence

MIT

Author

pixyzehn

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].