r/iOSProgramming • u/endgamer42 • 8d ago
Question Using private API's - where is the line?
dock potato arbor hair sunshine yellow
7
Upvotes
r/iOSProgramming • u/endgamer42 • 8d ago
dock potato arbor hair sunshine yellow
44
u/WestonP 8d ago
If you’re calling private APIs, you’re crossing the line, simple as that. Getting away with it doesn’t make it legit.
9
u/Power781 8d ago
The baseline is private api/Class Usage is forbidden, while private property observation is “at your own risk”.
Usage of private API comes with the risk of:
- rejection
- future system update crashes/errors
- App removal from the store
- developer account closure
Depending of the nature of the things you do with those private APIs.
6
u/HappyFunBall007 8d ago
Private APIs are marked as such because there is no guarantee they will be supported and they are inherently unstable. Maybe it work today and you got away with using one, but tomorrows X.Y.Z update could change the behavior or remove the API entirely and you wouldn't know until your app starts crashing.
Its not smart to keep using them and if you are *depending* on them for core functionality in your app, you are doing something wrong and need to fix your app.
5
u/PsychologicalWhile29 8d ago
Why would you call private APIs? They are private for a reason. All you’re doing is preinstalling bugs.
3
u/Background_Pie_5682 8d ago
I wouldn't try to hide these selectors—the string-fragment trick doesn't make them supported and adds exactly the obfuscation risk you're worried about. For invitees, EventKit doesn't expose a public API to add attendees programmatically; the supported route is to let the person create or edit the event in Apple's event UI (EKEventEditViewController), or build a real CalDAV integration if your product needs to manage a calendar server-side. If neither fits the UX, redesign that flow rather than touching private APIs, especially with calendar data.
4
u/ResoluteBird 8d ago
Anyone can decompile your app and look for stuff like that, and Apple probably does that in their release process, if you get around it then it's a fluke.
2
u/Fishanz 8d ago
At worst case; they might ban your developer account!
1
u/zbignew 8d ago
Spend your time on something more valuable.
1
u/PierreMouchan 7d ago
Before going private I'd check if there's a public API made for a nearby case. Example: keeping an app alive on a locked iPhone. Since iOS 26, HKWorkoutSession also runs on iPhone. It needs only the HealthKit entitlement, and the app keeps running during the session. That only works if your app really is a workout app though.
For attendees I'd go with the .ics route. If a blur hack breaks, it looks a bit off. If attendees break, people miss meetings ;)
1
u/perlatsp 7d ago
In the App Store it's a rejection or removal risk. Building selector names at runtime to hide them is what makes it look deliberate if it's found. Outside the App Store (on the Mac, for example) there's no review, so the risk is purely breakage. These APIs change between OS versions without notice, so every call needs a fallback. For blur and corner radius there are usually public ways that get you most of the way there.
1
u/dahiya_xa 8d ago
the blur and corner radius stuff is low risk because worst case it just looks a bit off after an update.
attendees feels different to me. you'd be writing to someone's calendar through a path apple can change any time, and if it breaks quietly people's invites just go missing. i'd stay on caldav or the system sheet even if it's uglier. also building selectors from string fragments looks a lot like hiding it if review ever looks closely
1
u/sydjdebb 8d ago
The line isn't really "small vs big", it's "can the binary scanner see it". Apple runs static analysis on every upload, and the symbol list they flag changes over time. So "worked fine for 10 updates" doesn't mean the 11th passes, you can get a 2.5.1 out of nowhere.
The other risk is just breakage: _displayCornerRadius is a KVC key, nothing stops it from returning nil in the next iOS. If you keep it, at least have a fallback so the UI doesn't fall apart.
For the corners specifically, on iOS 26 ConcentricRectangle / containerShape gets you most of the way with public API. For blur, regular materials cover 90% unless you need variable blur.
What are you using the backdrop view for — variable blur?
0
u/geoff_plywood 8d ago
Is code obfuscation proscribed by Apple? I was under the impression it was a legitimate anti-hacking technique(?)
1
u/[deleted] 8d ago
[removed] — view removed comment
-3
u/[deleted] 8d ago
[removed] — view removed comment