Git Product home page Git Product logo

mibadgebutton-swift's People

Contributors

masterj93 avatar mustafaibrahim989 avatar pahmed avatar shimaazmy avatar tomneo2004 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

mibadgebutton-swift's Issues

Getting warning message when installing from CocoaPods

Thank you for this great work. I would like to tell you I'm getting this warning message from the terminal when I install MIBadgeButton via CocoaPods. @mustafaibrahim989

[!] Unable to read the license file /Users/username/appname.iOS/Pods/MIBadgeButton-Swift/mit-license.txt for the spec MIBadgeButton-Swift (0.1) `

Can I use this with a masked button?

I am setting my button image to a gradient image and masking the actual button image over it, but have found that when using this process it is not showing the badge button indicator anymore. As soon as I change it back to as non masked style button it works just fine. Is there a way to use a masked button and not loose the indicator?? I can obviously use a UIView for this if necessary, but wanted to ask if you may have a solution before I went that route????

Also, completely unrelated to the first issue, just FYI the way you have your POD setup, it forces cocoa pods to download the full version of this with every single update. Not sure if this is intended, but seems to be completely unnecessary as if there is an update it will download it automagically. Keep up the great work!!! Thank you!!!

img_8433
img_8432

"Use of undeclared type MiBadgeButton"

throwing my this error when I try to add a button to storyboard and give it the MiBadgeButton class and add an IBOutlet to it in code:

"Use of undeclared type MiBadgeButton"

i have tried:

import MIBadgeButton_Swift

but it does not seem to help.

Any Ideas?

Swift 4.2

Any version compatible with Swift 4.2?

Adding badge to system UIBarButtonItem

How to add badge on top of system BarButtonItem of specific style (ex. bookmarked)

i am able to set my own image by button.setImage(UIImage(named: "filter_icon"), forState: .Normal). But how can we use system UIBarButtonSystemItem images?

Any help!

Can't use your pod as a dependency

Nice pod but we can't use it as a dependency since your pod is pointing to 0.4

This is like the #14 issue but we can't do :
s.dependency "MIBadgeButton-Swift", :git => "https://github.com/mustafaibrahim989/MIBadgeButton-Swift.git", :branch => "master"
Since podspec doesn't manage git / branch, only versions are managed here.

As I said `s.dependency "MIBadgeButton-Swift"' is pointing to 0.4

iOS 9 Xcode 7.0GM issue

Hi Mustafa,

I am facing issue on this line, in code that you have shared:

labelString.drawInRect(textFrame, withAttributes: attributes as [NSObject: AnyObject]) // issue is here

Message: [NSObject: AnyObject] cannot be converted to expected type [String : AnyObject]?

Pankaj Bansal

Badge displaying behind button content

Using the below code to display a UIBarButtonItem with a Font Awesome icon. The Badge displays behind the shopping cart.

Any help would be appreciated.

let button = MIBadgeButton(type: .Custom)
button.badgeString = String(qty)
button.frame = CGRectMake(0, 0, 55, 40)
button.badgeEdgeInsets = UIEdgeInsetsMake(15, 0, 0, 10)
button.titleLabel?.font = UIFont.fontAwesomeOfSize(30)
button.setTitle(String.fontAwesomeIconWithName(FontAwesome.ShoppingCart), forState: .Normal)
button.setTitleColor(UIColor.whiteColor(), forState: .Normal)
button.badgeBackgroundColor = UIColor(red: 147/255, green: 149/255, blue: 151/255, alpha: 1.0)
button.setTitleColor(UIColor(red: 147/255, green: 149/255, blue: 151/255, alpha: 0.6), forState: .Highlighted)
button.addTarget(self, action: #selector(DryCleaning.backToServices), forControlEvents: UIControlEvents.TouchUpInside)
let barButton = UIBarButtonItem(customView: button)
self.navigationItem.rightBarButtonItem = barButton

var badgeLabel marked fileprivate

Can you expose badgeLabel - perhaps as a read only property, so we can make changes to the frame and other properties of the UILabel?

Crash when setting the badgeString

Hi,

I installed the library through CocoaPods. Added a UIButton (just an image, no text) and set its class to MIBadgeButton. I didn't do any modifications through the IB.

Then I tried to increase the badge count every time the button is pressed. But when setting the badge string, the app crashes with a EXC_BAD_ACCESS error.

Below is my code.

import UIKit
import MIBadgeButton_Swift

class ViewController: UIViewController {

    @IBOutlet weak var button: MIBadgeButton!
    
    var count = 0
    
    override func viewDidLoad() {
        super.viewDidLoad()
    }

    @IBAction func didTapButton(_ sender: MIBadgeButton) {
        count = count + 1
        sender.badgeString = "\(count)"
    }
}

I also uploaded a demo project here.

Xcode 8

Am getting a lot of errors with xcode 8 beta 6

Button's border displayed above the badge's

Hi my issue is probably the same as the one described in the Objective-C repo (mustafaibrahim989/MIBadgeButton#3).

When using a button's border, the border is displayed above the badge.

For instance:

button.layer.cornerRadius = 5
button.layer.borderColor = UIColor.white.cgColor
button.layer.borderWidth = 1    
button.badgeBackgroundColor = UIColor.blue

produces the following result:
screen shot 2016-11-17 at 07 44 51

UIBarButtonItem

It would be fantastic to have an easy way to use this on a UIBarButtonItem. Any chance you will extend it to cover this? I want to use this for a notification count indicator badge.

Change badgeLabel font

The ability to change the badgeLabel font - could be done by exposing a property like other you did...I have it changed in my source

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.