Giter Site home page Giter Site logo

pmusolino / pmsuperbutton Goto Github PK

View Code? Open in Web Editor NEW
724.0 10.0 44.0 1.34 MB

πŸ”₯ PMSuperButton is a powerful UIButton coming from the countryside, but with super powers! 😎

License: MIT License

Ruby 6.38% Swift 93.62%
uibutton storyboard uicontrol animations customizable closure interface-builder button

pmsuperbutton's Introduction

Hi there πŸ‘‹

I'm Paolo and I work for Automattic as iOS Engineer!

pmusolino

pmusolino

pmsuperbutton's People

Contributors

banck avatar mixdesign avatar niorko avatar pmusolino 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

pmsuperbutton's Issues

Adding file manually to project results in build errors

Add file manually to project

The following errors appear for each open var:
Overriding declaration requires an 'override' keyword
Overriding non-open var outside of its defining module

xcode: Version 10.1 (10B61)
swift: version 4.2.1

Feature Suggest: Haptic Feedback

Hi @pmusolino I saw your framework PMSuperButton, its quite interesting. I know this repo had been inactive for a bit long, but why not provide it a new life. Actually I am really interested in contribution into the repo. I have an amazing feature for your PMSuperButton. With the immense improvement in UX Apple brought Haptic Feedback into their phones, so why not use that exceptional feature into your framework. It will be really amazing. This small piece of addition will really help to advance your framework.

With this we can start redesigning this framework. We can add various new features which this framework is lagging. So if you are interested in adding Haptic Feedback do tell me, I will create a PR and Push the file.

Do give a response, this will help me to know the status, so that I can work further on this project.

I have the code ready, ts just your approval and I can make an PR.

Swift Package Manager error

When using SPM to get the library in Xcode I got this error :
Screenshot 2020-02-15 at 16 52 31

I fixed it by not specifying a version number for the package but by directly pulling the master branch. It would be better to get it working with versions numbers (for example 3.0.0 < 4.0.0).

Loader issue

Hello!
There is an issue with show/hide loader when less than 0.5 seconds have passed with the showLoader() call.
Because you add indicator after 0.5 second in showLoader() method:

UIView.transition(with: self, duration: 0.5, options: .curveEaseOut, animations: {
            self.titleLabel?.alpha = 0.0
            self.imageAlpha = 0.0
        }) { (finished) in
            self.addSubview(self.indicator)
            self.indicator.startAnimating()
        }

And in hideLoader you have this code:

open func hideLoader(){
        guard self.subviews.contains(indicator) == true else {
            return
        }

Storyboard can't find PMSuperButton which integrated through Carthage

Hello!
I've placed UIButton in my storyboard and tried to type PMSuperButton in class, but there is no PMSuperButton. If wrote it there, then error:
Unknown class PMSuperButton in Interface Builder file.
But in .swift files I can import PMSuperButton , create and works with them.
Thanks!

No shadow, background image and animation when added programatically

Hi,
I'm adding buttons programatically. This is what I have and I can't seem to get the background image, shadow and animation working. All works when I add a button in storyboard view.

            let button = PMSuperButton() //UIButton()
            let bgrImage = UIImage(named: "someImage")
            //button.setImage(bgrImage, for: .normal) //-> this works ok
            button.setBackgroundImage(bgrImage, for: UIControl.State.normal)
            

            button.shadowColor = UIColor.gray
            button.shadowOffset = CGSize(width: 2, height: 2)
            button.shadowRadius = 2
            button.shadowOpacity = 2
            button.animatedScaleWhenSelected = 1
            button.animatedScaleWhenHighlighted = 1
            button.animatedScaleDurationWhenSelected = 1
            button.animatedScaleDurationWhenHighlighted = 1

Any idea what am I doing wrong?

Haptic Feedback on tap

Improvement: in iOS 10 we have a new API to provide feedback to the user. Haptic feedback is an extension to the visual feedback that every user is used to already. If you have an iPhone 7 or iPhone 7 Plus, you may have noticed a small vibration of the device while scrolling a date picker or when changing the value of a switchβ€”that's haptic feedback. The new UIFeedbackGenerator class can be used to implement the same behavior in your apps.

PMSuperButton not working

Hi,

I have created a UIButton and added the PMSuperButton class, it does show the Super Button inspector properties, in the preview it also renders the changed property. But once build to the device nothing shows up.

Any ideas?

Thanks,

Niels

not able to do button programmatically

` let myFirstButton = PMSuperButton.self

    myFirstButton.setTitle("✸", for: .normal)
        myFirstButton.setTitleColor(.blue, for: .normal)
        myFirstButton.frame = CGRect(x: 15, y: -50, width: 300, height: 500)
        myFirstButton.addTarget(self, action: #selector(pressed), for: .touchUpInside)

`

Here's my code, it's probably pretty nubby. Just trying to find a way to programmtically add the button and edit it with your creation.

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.