3

Has anyone submitted an applicaton using UIGlassButton? Was it approved?

I am trying to use a colored rounded button and do not want to use these hacks. How can I set a button background color on iPhone?

Why are we not allowed to use UIGlassButton?

Community
  • 1
  • 1
Bryan
  • 17,201
  • 24
  • 97
  • 123
  • How is using documented methods a hack and using a private API not? – Brad Larson Sep 04 '09 at 21:03
  • Have you seen the amount of code required to create a simple rounded rect of some color? That is a hack. UIGlassButton requires one line. – Bryan Sep 09 '09 at 23:23
  • 1
    No, drawing custom controls requires a lot of code sometimes, that doesn't make it a hack. The fact that you can use one line to access an undocumented call to do something similiar doesn't make it cleaner, since UIGlassButton is doing almost the same thing internally, it just makes your code shorter but more likely to break. – Louis Gerbarg Sep 14 '09 at 10:52
  • 2
    The undocumented uiglassbutton code is cleaner because it blends perfectly into cocoa-touch since apple wrote the uiglassbutton code. It may break but because Apple could change the implementation. UiGlassButtoon is higher level code because it does all of the work in one line. Writing low level code when an elegant high level solution is available is a hack and a waste of time to me. – Bryan Sep 14 '09 at 20:30

3 Answers3

1

My application was accepted.

Bryan
  • 17,201
  • 24
  • 97
  • 123
0

Cant use it because its not in the public api and therefore not in the documentation of the SDK, why dont they allow us to use it? who knows, but i can tell you if you use it your app will probably not get approved. Usage of undocument calls and classes usually leads to apps being rejected.

Daniel
  • 22,363
  • 9
  • 64
  • 71
  • What makes you believe that the use of undocumented code leads to "likely" rejection? Google doesn't seem to mind. http://www.tuaw.com/2008/11/26/google-yeah-we-did-use-undocumented-api-so-what/ – Bryan Sep 21 '09 at 19:52
  • From people reporting that t hey have gotten rejected, google doesnt mind, apple does... – Daniel Sep 21 '09 at 20:06
  • Apparently apple does not mind either. I am using google's app utilizing the undocumented proximity sensor for voice searches. – Bryan Sep 23 '09 at 19:57
  • You really think they didn't catch the fact that one of the most popular apps is using the proximity sensor? – Bryan Sep 28 '09 at 21:23
0

So i've been looking around for a example of implementing the UIGlassButton class. - but couldent find any. So i created one myself after some diggin'.

And i really dont know where to put it, so here it is. - And also: i thisk the solution should be OK by Apple. We'll see.

Anyway, here's the code;

Class $UIGlassButton = objc_getClass("UIGlassButton");

UIGlassButton *glassButton = [[$UIGlassButton alloc] initWithFrame:CGRectMake(30, 371, 274, 42)];

[glassButton setTintColor: [UIColor orangeColor]];

[glassButton setTitle:@"Create a Group" forState:UIControlStateNormal];

[self.view addSubview:glassButton];

Actually i just wanted a transparent glassbutton with an icon, so i've added:

[glassButton setBackgroundColor:[UIColor clearColor]];

[glassButton setImage:[UIImage imageNamed:iconPath] forState:UIControlStateNormal];

As easy as that.

Keep coding - peace.

esbenr
  • 1,356
  • 1
  • 11
  • 34