1

I've found out that it's very easy to customize UIPageControl page images (I've checked it for iOS7/8):

[self setValue:[UIImage imageNamed:@"my_icon_for_off_state"] forKey:@"_pageImage"];
[self setValue:[UIImage imageNamed:@"my_icon_for_on_state"] forKey:@"_currentPageImage"];

But I wonder can I publish my app with this code, because these variables are declared as private in UIPageControl?

Ossir
  • 3,109
  • 1
  • 34
  • 52

2 Answers2

1

As per Apple, you can't use private API's in your project.

However we can. Don't worry. Just be honest and while submitting the app, inform them that you have used xyz code.

Apple DON'T approve the app where insecure private API's are used.

Many times, I used private API's and Apple approved it.

Honesty is simplicity.

One of the example

Community
  • 1
  • 1
Fahim Parkar
  • 30,974
  • 45
  • 160
  • 276
0

As you've already stated, those properties are declared private by Apple so you will be unable to use them. You can change the tint color of the page "dots" by using pageIndicatorTintColor and currentPageIndicatorTintColor.

Gary Riches
  • 2,847
  • 1
  • 22
  • 19
  • That's not enough for me, I need to use custom image. Though I already implemented it, feel free to suggest another approaches – Ossir Feb 09 '15 at 13:05
  • @Ossir : go ahead and use it... Apple will approve... just inform them that you have used xyz code for UIPageControl. – Fahim Parkar Feb 09 '15 at 13:10
  • Ossir, you should re-prharase your question. Your question is whether it's legal, not "how can I use images in a UIPageControl". Fahir, Xcode now examines the app on submission for private API usage and rejects it if it finds any. How recently did you use them? – Gary Riches Feb 09 '15 at 13:24
  • @GaryRiches, no that's what I mean. I used private API few times, not intensively though, after checking that Apple approve apps that use that, despite the fact it's illegal by rules strictly speaking, Apple is ok with some approaches. – Ossir Feb 09 '15 at 18:21
  • It sounds like you've answered your own question then. It's illegal but they allow it – Gary Riches Feb 09 '15 at 21:04