GithubHelp home page GithubHelp logo

liuzhiyi1992 / spreadbutton Goto Github PK

View Code? Open in Web Editor NEW
529.0 529.0 56.0 118 KB

a Button can spread its sub path button like the flower if you click,once again,close. oc & swift

Swift 51.40% Ruby 9.89% Objective-C 38.70%

spreadbutton's People

Contributors

liuzhiyi1992 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

spreadbutton's Issues

Can I add on a custom view?

Thank you very much for this nice component. I really love this.
The problem I'm having while using is I don't want to float this around the whole view. I want it to move within the boundary of a custom view. To achieve that I added a custom view and added this spread button as subview.
But SpreadButton instance is not showing. What is the proper way to restrict SpreadButton floating boundary. Thank you.

unrecognized selector sent to instance

使用的时候发现2.2和3.0的版本在拖到边缘的时候会有闪退。

screen shot 2016-11-06 at 11 10 11 pm
img_0139

2016-11-06 23:09:12.399 SpreadButton[2091:803446] -[_SwiftValue pointValue]: unrecognized selector sent to instance 0x15d64d3d0
2016-11-06 23:09:12.402 SpreadButton[2091:803446] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[_SwiftValue pointValue]: unrecognized selector sent to instance 0x15d64d3d0'
*** First throw call stack:
(0x181131900 0x18079ff80 0x18113861c 0x1811355b8 0x18103968c 0x183838544 0x183837af4 0x183837214 0x185e5fe84 0x185e5fb48 0x186131c30 0x185e60144 0x181028370 0x181028268 0x185e5fc68 0x186131c30 0x185e60144 0x181028370 0x181028268 0x185e5fc68 0x186131c30 0x18612058c 0x185e28dd0 0x186120454 0x1861207a0 0x1860eab60 0x185e2230c 0x1810e8efc 0x1810e8990 0x1810e6690 0x181015680 0x182524088 0x185e8cd90 0x1000b11c0 0x180bb68b8)
libc++abi.dylib: terminating with uncaught exception of type NSException

Flash of the last button.

Hello, I am using your framework to create a spread button. But seem like you have an issue with the buttons. When I spread-in the buttons, there is a flash of the last added button on the left-up corner, just below the status bar.
Do you know why ?

Here is the code that I used like you did.

`func setup_spread_button()
{
let btn1 = SpreadSubButton(backgroundImage: UIImage(named: "edit"), highlightImage: UIImage(named: "edit")) { (index, sender) -> Void in
print("first")
}

    let btn2 = SpreadSubButton(backgroundImage: UIImage(named: "delete_user"), highlightImage: UIImage(named: "delete_user")) { (index, sender) -> Void in
        print("second")
    }
    
    let btn3 = SpreadSubButton(backgroundImage: UIImage(named: "blocked"), highlightImage: UIImage(named: "blocked")) { (index, sender) -> Void in
        print("third")
    }
    
    let btn4 = SpreadSubButton(backgroundImage: UIImage(named: "share"), highlightImage: UIImage(named: "share")) { (index, sender) -> Void in
        print("four")
    }
    
    let btn5 = SpreadSubButton(backgroundImage: UIImage(named: "logout"), highlightImage: UIImage(named: "logout")) { (index, sender) -> Void in
        print("five")
    }

    

    let spreadButton = SpreadButton(image: UIImage(named: "setting"),
                                    highlightImage: UIImage(named: "setting"),
                                    position: CGPoint(x: 40, y: UIScreen.main.bounds.height - 40))
    self.spreadButton = spreadButton
    
    spreadButton?.setSubButtons([btn1, btn2, btn3, btn4, btn5])
    spreadButton?.mode = SpreadMode.spreadModeFlowerSpread
    spreadButton?.direction = SpreadDirection.spreadDirectionLeftDown
    spreadButton?.radius = 100
    spreadButton?.positionMode = SpreadPositionMode.spreadPositionModeTouchBorder
    
    /*  and you can assign a newValue to change the default
     spreadButton?.animationDuring = 0.2
     spreadButton?.animationDuringClose = 0.25
     spreadButton?.radius = 180
     spreadButton?.coverAlpha = 0.3
     spreadButton?.coverColor = UIColor.yellowColor()
     spreadButton?.touchBorderMargin = 10.0
     */

    
    if spreadButton != nil {
        self.view.addSubview(spreadButton!)
    }
}

`

Regards,

Hary

Button images not loading with builds in Xcode10 - Swift 4.2

When building my app in Xcode 10 the images aren't loading in many instances. Using the same code to build in Xcode 9 they populate and work correctly every time.

I have a setup with four buttons on my spreadButton and it seems random as to which images will pull in. On some builds only 2/4 buttons load, sometimes only 1, and very very rarely all 4 will populate.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.