Core Graphics Tutorial: Glossy Buttons

Discussion of the official tutorials published on raywenderlich.com. Please only discuss the official tutorials here - for general questions, use the General Discussion forum instead.

Core Graphics Tutorial: Glossy Buttons

Postby rwenderlich » Thu Apr 18, 2013 11:00 am

This is the official thread to discuss the following blog post: Core Graphics Tutorial: Glossy Buttons
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
Ray Wenderlich
Blog: http://www.raywenderlich.com
Twitter: http://twitter.com/rwenderlich
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
User avatar
rwenderlich
Team Member
Site Admin
 
Posts: 2155
Joined: Thu Dec 23, 2010 4:14 pm
Has thanked: 28 times
Been thanked: 337 times

Re: Core Graphics Tutorial: Glossy Buttons

Postby tomneo2004 » Fri Apr 19, 2013 6:23 am

Great tutorial.

"enter the name CoolButton as the class name. In the subclass field, type UIView."
Should UIView be changed to UIButton?
tomneo2004
Hacker
 
Posts: 29
Joined: Wed Jun 13, 2012 6:43 am
Has thanked: 0 time
Been thanked: 0 time

Re: Core Graphics Tutorial: Glossy Buttons

Postby rwenderlich » Fri Apr 19, 2013 3:04 pm

Good catch, fixed!
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
Ray Wenderlich
Blog: http://www.raywenderlich.com
Twitter: http://twitter.com/rwenderlich
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
User avatar
rwenderlich
Team Member
Site Admin
 
Posts: 2155
Joined: Thu Dec 23, 2010 4:14 pm
Has thanked: 28 times
Been thanked: 337 times

Re: Core Graphics Tutorial: Glossy Buttons

Postby algashev » Sun May 12, 2013 10:43 am

Highlighting the Button

To indicate when the button is pressed or not use this method:

Code: Select all
- (void)setHighlighted:(BOOL)highlighted
{
   [self setNeedsDisplay];
   [super setHighlighted:highlighted];
}
algashev
Baby Hacker
 
Posts: 9
Joined: Sun May 12, 2013 10:28 am
Has thanked: 0 time
Been thanked: 0 time

Postby Hokuang » Wed Jul 03, 2013 3:08 am

The highlighting code has a problem. When you put a button in a UITableViewCell, touch it and push in another view controller, then pop it. If you do this quickly, the button will keep highlighted. While using algashev's code seems correct.
Hokuang
n00b
 
Posts: 1
Joined: Wed Jul 03, 2013 2:58 am
Has thanked: 0 time
Been thanked: 0 time


Return to Official Tutorials

Who is online

Users browsing this forum: Bing [Bot] and 5 guests