Icomations icon indicating copy to clipboard operation
Icomations copied to clipboard

Using Icomations On A UIBarButtonItem

Open zacwolff opened this issue 10 years ago • 3 comments

Thanks for your work. Its really crisp and I'd really want to use it in an app I'm working on. Could you please assist with how I could use this in a BarButtonItem?

Thank you.

zacwolff avatar May 22 '15 15:05 zacwolff

Thanks! What about this?

var icomation = Icomation(frame: CGRectMake(0, 0, 30, 30))
icomation.topShape.strokeColor = UIColor.redColor().CGColor
icomation.middleShape.strokeColor = UIColor.blueColor().CGColor
icomation.bottomShape.strokeColor = UIColor.blackColor().CGColor
icomation.addTarget(self, action: "tapped", forControlEvents: UIControlEvents.TouchUpInside)
navigationItem.leftBarButtonItem = UIBarButtonItem(customView: icomation)

func tapped() {
    println(__FUNCTION__)
}

paoloboschini avatar May 22 '15 16:05 paoloboschini

Oh I am unable to set the class of the BarButton to Icomation.swift. Any idea as to how I could achieve that please?

zacwolff avatar May 22 '15 16:05 zacwolff

I need to see the project I guess. Can you send me an example of how your project looks like? Are you using storyboards?

paoloboschini avatar May 22 '15 16:05 paoloboschini