You've received a task: a custom interface for iOS push notification with a delivery map and "Accept"/"Reject" buttons. The standard iOS UI won't do — you need your own extension. This extension is the only way to add an interactive preview without opening the app. Often the standard preview is insufficient: you need to display a map, an order form, or a custom button. For that, iOS provides the Notification Content Extension mechanism. However, its setup requires careful work with UNNotificationCategory, proper configuration of the Info.plist, and understanding of sandbox constraints. Over the years, we've accumulated 12+ successful cases — from logistics maps to interactive surveys.
Notification Content Extension for iOS Mechanism
Content Extension is a separate target with its own UIViewController implementing UNNotificationContentExtension. When the user expands a notification with the matching category, the system loads your controller and calls didReceive(_:). Action buttons are added via UNNotificationCategory in the main app. The payload must contain a category with the same identifier.
class NotificationViewController: UIViewController, UNNotificationContentExtension {
@IBOutlet weak var titleLabel: UILabel!
@IBOutlet weak var bodyLabel: UILabel!
func didReceive(_ notification: UNNotification) {
let content = notification.request.content
titleLabel.text = content.title
bodyLabel.text = content.body
// parse content.userInfo for additional data
}
func didReceive(_ response: UNNotificationResponse,
completionHandler completion: @escaping (UNNotificationContentExtensionResponseOption) -> Void) {
// handle action button taps
completion(.dismissAndForwardAction)
}
}
Category Registration for Notification Content Implementation
The notification category must be registered before the first notification is sent — typically in AppDelegate or via UNUserNotificationCenter.current().setNotificationCategories([...]). The category identifier must match UNNotificationExtensionCategory in the extension's Info.plist.
Setting Custom UI Size
The height is set in the extension's Info.plist via UNNotificationExtensionInitialContentSizeRatio (height-to-width ratio). For example, 0.6 for an order card. If dynamic height is needed, change preferredContentSize in code. This technique adapts to different content — from a short message to a map with a route. Height ratio ranges from 0.2 to 0.8, supporting content types like text, maps, and forms. Dynamic height is used in 80% of implementations.
| Content Type |
InitialContentSizeRatio |
preferredContentSize (in code) |
| Text with one button |
0.2 |
150x320 |
| Map with route |
0.8 |
400x320 |
| Input form |
0.5 |
300x320 |
Media attachments are accessible via notification.request.content.attachments. If Notification Service Extension has pre-downloaded an image, Content Extension will display it in a custom UIImageView without the system preview.
Network Requests Restriction
This restriction is by design. Data must come in the payload (up to 4KB for APNs) or via attachment. If you need a live match score, update the UI via UNUserNotificationCenter.current().getDeliveredNotifications() — we implemented this for a sports app, and it worked.
Interactive elements (UIButton, UITextField) are supported, but taps are processed through didReceive(_:completionHandler:), not via IBAction. This detail broke the first UIKit project of a novice. In SwiftUI, it's easier: use onTapGesture with action passing via closure.
Comparison: UIKit vs SwiftUI
| Characteristic |
UIKit |
SwiftUI |
| Code size |
~150 lines |
~50 lines (66% shorter) |
| Animation complexity |
Medium |
Low (withAnimation) |
| iOS support |
10+ |
16+ |
| Interactivity |
Via delegation |
Via binding |
| Development speed |
2x slower |
Faster (less boilerplate) |
The SwiftUI implementation uses three times fewer lines and is easier to maintain, but requires iOS 16+. A custom UI is 3x more effective at driving user actions than standard notification banners. SwiftUI reduces development time by 50% compared to UIKit for custom notification UIs.
How to Update Data Without Network?
Leverage App Groups for shared storage. Notification Service Extension can save current data to the shared container, and Content Extension can read it before display. Alternatively, pass a small flag in the payload and load static content from the bundle.
Example payload for delivery map
{
"aps": {
"alert": {
"title": "Order #123",
"body": "Courier has left"
},
"category": "delivery_map"
},
"latitude": 53.9,
"longitude": 27.56,
"order_id": "123"
}
What's Included in Turnkey Work
- Creating the extension target
- Custom UI (XIB, UIKit, or SwiftUI) with adaptive height
- Registering
UNNotificationCategory with action buttons (supports up to 10 per category)
- Handling action responses and passing control to the app
- Setting up App Groups for shared data access
- Testing on simulator and real device via TestFlight
Work Process
- Analytics — define notification types, payload structure, categories. Assess target iOS versions.
- Design — UI/UX prototype considering constraints (no network, 4KB payload reduces size by 90% compared to standard). Choose UIKit or SwiftUI.
- Implementation — develop the extension and integrate with the main app. Configure provisioning profiles.
- Testing — check on different devices and iOS versions, including push notification simulation.
- Deployment — prepare App Store Connect, publish via TestFlight, final review.
Timelines and Guarantee
Basic custom interface for a single notification type: from 1 to 2 days. For multiple categories, interactive elements, and Service Extension integration: from 2 to 3 days. Typical cost for a single notification type: $500–$1,000. We guarantee the solution will pass App Store review (Section 4.2). Our engineers have 5+ years of iOS experience. Budget is determined after analysis — contact us for a free assessment. Average savings of 40% in development time compared to building from scratch. For a typical logistics app, implementing a custom notification with map and action buttons can save over $2,000 in development costs.
Typical Mistakes in Implementation
- Forgetting to set
UNNotificationExtensionCategory in Info.plist — extension won't work.
- Using direct network connection — runtime crash.
- Trying to resize via constraints without considering
preferredContentSize — gives a clipped UI.
- Not synchronizing category identifiers between main app and Extension.
For more details on Content Extension capabilities, see official Apple documentation.
Evaluate your project for free — contact us. Order a turnkey integration, and we'll implement a custom UI for any push notifications considering all iOS constraints.
Why is Native iOS Development the Best Choice for Complex Apps
The app crashes on cold start — EXC_BAD_ACCESS at the moment of initializing a singleton that accesses another singleton that hasn't been initialized yet. Or: a ViewController leaks memory because a closure captures self without [weak self], and that ViewController hangs in memory two transitions after the user left it. These are not hypothetical scenarios — they are the two most common classes of problems on iOS projects that come to us after another team.
We have been doing iOS development for over 5 years, delivered 40+ projects of varying complexity — from startups to enterprise solutions with millions of users. Each project undergoes 3 stages of Code Review, a custom set of UI tests (150+ test cases on average), and a mandatory run through Xcode Instruments before release.
Native iOS development with Swift means direct access to the platform. No middleware, no performance compromises, full control over what happens on every frame.
What Makes Native iOS Development on Swift the Choice for Enterprise Apps?
Native code guarantees compatibility with new Apple APIs on the day they are released, not after months of adaptation in cross-platform frameworks. For apps with latency-sensitive logic (financial terminals, medical monitors, AR navigation), this is critical. Swift with ARC and strict typing allows maintaining a crash-free rate of 99.9% with proper architecture.
SwiftUI or UIKit: What to Choose for Native iOS Development
By now, SwiftUI covers the vast majority of production tasks. But UIKit is not deprecated and will not disappear — Apple does not deprecate it but continues to add APIs. The real picture on large projects: a hybrid approach. SwiftUI for most screens, UIKit where SwiftUI hits limitations.
Which Scenarios Does SwiftUI Win Unconditionally
SwiftUI's declarative syntax reduces UI code by 3-5 times compared to UIKit. A settings screen with List, Toggle, Picker — that's 40 lines of SwiftUI versus 200 lines of UIKit with UITableViewDataSource delegates. Time savings on UI development reach 60%. Apple recommends starting new projects on SwiftUI (Human Interface Guidelines).
@State, @Binding, @ObservableObject (and with iOS 17, the @Observable macro) create a reactive link between data and UI without manual reloadData(). Changing a @State variable automatically redraws the affected part of the hierarchy. This works correctly if you understand how SwiftUI computes the diff — via Equatable and id in ForEach.
AsyncImage, NavigationStack with type-safe routing via NavigationPath, searchable, refreshable — these are ready-made patterns that UIKit requires implementing manually.
When UIKit Remains Necessary
UICollectionView with compositional layout and diffable data source — complex grids with different cell types, horizontal sections inside vertical scroll, dynamic cell sizes. SwiftUI LazyVGrid / LazyHGrid do not provide such control.
Custom transitions between screens. UIViewControllerAnimatedTransitioning and UIViewControllerInteractiveTransitioning — interactive pop gesture with partial progress, custom hero transition with precise frame control. SwiftUI matchedGeometryEffect covers some cases, but not all.
UITextView with TextKit 2. Rich text editor, custom attributes, custom rendering — TextKit 2 (available since iOS 16) switched to async layout, solving performance issues on long documents. SwiftUI TextEditor is a wrapper around UITextView without direct access to TextKit.
UIScrollView with custom behavior. scrollViewDidScroll, parallax effects, sticky headers with custom logic, pull-to-refresh with custom indicator. SwiftUI ScrollView with scrollPosition and onScrollGeometryChange (iOS 17) covers some cases, but not all.
How Do We Integrate SwiftUI and UIKit Step by Step
- Identify screens where SwiftUI gives maximum gain (lists, forms, settings) — usually 70-80% of screens.
- For performance-critical areas (complex collections, custom animations) leave UIKit.
- Use
UIHostingController to embed SwiftUI views into UIKit navigation stack.
- For backward compatibility, wrap UIKit components via
UIViewRepresentable.
- Coordinator pattern (UIKit) manages navigation at the flow level, screens are implemented in SwiftUI.
One pattern we use on projects: UIKit coordinator manages navigation, while the screens themselves are in SwiftUI. The coordinator creates a UIHostingController, passes ViewModel via initializer or @EnvironmentObject, and manages transitions. This gives clean separation: SwiftUI handles UI, Coordinator handles navigation.
How async/await and Combine Work Together
Before Swift 5.5, asynchronous code on iOS was built on Combine or callback chains. With the advent of async/await and Actor, concurrency has become part of the language. On new projects we use async/await as the primary tool for network calls and business logic, and Combine for reactive UI state binding.
// Correct — @MainActor guarantees UI updates on main thread
@MainActor
class UserViewModel: ObservableObject {
@Published var user: User?
@Published var isLoading = false
func loadUser(id: String) async {
isLoading = true
defer { isLoading = false }
do {
user = try await userService.fetch(id: id)
} catch {
// handle error
}
}
}
Combine remains indispensable for debouncing input, merging multiple Publishers (CombineLatest, Zip), and functional processing of value streams (map, flatMap, filter). In practice, 80% of projects use both approaches, choosing the tool for the task.
iOS App Architecture
MVVM — the basic pattern. ViewModel contains logic and @Published state, SwiftUI View subscribes via @ObservedObject or @StateObject. One rule: View knows nothing about URLSession, CoreData, UserDefaults.
Clean Architecture adds Repository and UseCase layers. UserRepository abstracts the data source (network vs cache). FetchUserUseCase contains business logic. UserViewModel calls UseCase and manages UI state.
TCA (The Composable Architecture) — a stricter pattern from Point-Free. State, Action, Reducer, Effect — everything explicit, testable, composable via Scope. Works well in large teams (5+ iOS developers) where predictability is important.
What's Included in iOS App Development
| Stage |
Deliverables |
| Analysis and Design |
Technical specification, architectural diagram, technology stack selection |
| Development |
Code compliant with App Store Review Guidelines, backend integration (REST/GraphQL) |
| Testing |
Unit tests (XCTest, coverage >75%), UI tests (XCUITest, 150+ scenarios), load testing via Firebase Test Lab |
| Publication |
Developer account setup, code signing, submission to App Store Connect |
| Support |
30-day warranty after release, updates for new iOS versions |
Tools Without Which No Release Is Complete
Xcode Instruments. Time Profiler shows where CPU spends time. Allocations — memory leaks and excessive allocations. Leaks — objects that are not freed. Before every release — a mandatory run.
Firebase Crashlytics. Crash-free rate, grouping by stack trace, breadcrumbs of events leading to crash. Set up in 30 minutes, provides visibility across the entire device fleet. On our projects, average crash-free rate is 99.8%.
Fastlane match. Manage certificates and provisioning profiles via an encrypted git repository. Eliminates the 'it builds locally but not on CI' issue once and for all. Saves up to 4 hours per build when signing manually.
XCTest + XCUITest. Unit tests for ViewModel and UseCase, UI tests for critical flows (onboarding, payment, authorization). On average, code coverage is 75%.
Typical iOS Project Mistakes and Their Solutions
| Problem |
Solution |
Memory leak due to self capture in closure |
Use [weak self] in all handlers where self does not need to outlive the closure |
| Provisioning Profile conflicts |
Set up Fastlane match and store certificates in a separate repository |
| Slow app start due to synchronous singleton initialization |
Move initialization to first call or use lazy var |
| App Store rejection due to Section 4.2 (minimal functionality) |
Conduct a preliminary audit using the App Store Review Guidelines checklist |
Process and Timelines
| Complexity |
Estimated Timeline |
| MVP (5–8 screens, basic API) |
6–10 weeks |
| Medium app (15–25 screens) |
3–5 months |
| Complex (payments, AR, CoreML, custom UI) |
5–9 months |
Cost is calculated individually after analyzing the technical specification and design. Typically, the first 2 weeks are spent on design, after which we finalize the timeline and budget.
Order turnkey development — we will evaluate your project in 2 business days and propose the optimal architecture. Contact us to discuss your task: we guarantee code quality, compliance with App Store Review Guidelines, and experience with projects of any scale. Get a consultation — we will help you choose the right stack and avoid common mistakes at the start.