We develop a trading screen for an exchange mobile application — one of the most technically dense UIs. A candlestick chart with hundreds of data points, a real-time order book, and an order form with instant validation must all run at 60 fps under a WebSocket stream with 10 updates per second. Rendering performance directly impacts the user's money. Our experience includes over 5 years in mobile exchange application development, with 30+ projects delivered. We guarantee stable operation under load.
Ensuring 60 fps under WebSocket Stream
Incoming data throttling is critical. WebSocket can send 20–50 updates per second for active pairs. Updating the UI on each message overloads the main thread. The correct approach: accumulate updates in a ConcurrentQueue on a background thread and apply them to the UI at 60 fps (using CADisplayLink on iOS or Choreographer on Android).
// iOS: accumulating updates
private var pendingOrderBookUpdates: [OrderBookUpdate] = []
private let updateQueue = DispatchQueue(label: "orderbook.updates")
func handleWebSocketMessage(_ update: OrderBookUpdate) {
updateQueue.async { [weak self] in
self?.pendingOrderBookUpdates.append(update)
}
}
// CADisplayLink callback — on main thread, 60fps
@objc func applyPendingUpdates() {
var updates: [OrderBookUpdate] = []
updateQueue.sync { updates = pendingOrderBookUpdates; pendingOrderBookUpdates.removeAll() }
guard !updates.isEmpty else { return }
// Apply batch updates to UI
applyToOrderBook(updates)
}
WebSocket and Data Flow Management
Exchange data arrives via WebSocket — subscribing to pairs, receiving ticks and order book updates. On iOS, URLSessionWebSocketTask (native, iOS 13+) or Starscream for more flexible reconnection logic. On Android, OkHttp WebSocket or Ktor WebSocket client. Upon connection loss: show a "No Connection" overlay over the chart (not replacing the entire screen), keep the last known data visible. On reconnection: automatic reconnect with exponential backoff (1s, 2s, 4s, 8s, max 30s), REST request for the current order book snapshot and recent candles, seamless resume without resetting the chart position.
Order Book Data Model
The order book is a sorted structure: bids (buy orders) sorted descending by price, asks (sell orders) ascending. We use SortedArray or TreeMap (Java) / custom AVLTree (Swift) for O(log n) insertion and deletion on updates. Updates are not full replacements but patches: a new level, changed volume, removed level (volume = 0). For iOS order book, we use an NSFetchedResultsController pattern without CoreData: store bids: [(price: Decimal, size: Decimal)] and asks: [(price: Decimal, size: Decimal)], on change we diff using DeepDiff or Swift's CollectionDifference for minimal UITableView updates.
Why Custom Metal Rendering Beats Ready Libraries?
Standard UIKit is too slow for an interactive candlestick chart with 1000+ candles. Comparison of approaches:
| Approach |
Performance |
Complexity |
Use Case |
| Core Graphics |
8–12 ms for 500 candles |
Low |
Up to 1000 candles |
| CALayer per candle |
Catastrophic |
Medium |
Not recommended |
| Metal |
1–2 ms for 10000 candles |
High |
Professional applications |
| LightweightCharts (WebView) |
Depends on WebView |
Low |
Quick start |
Metal rendering is 10x faster than Core Graphics with 2000+ candles. For professional trading apps with animated scalable charts, we use MetalKit. We store vertex data in a MTLBuffer for candles, and a vertex shader draws rectangles in screen space. 10,000 candles render in 1–2 ms.
Gestures and Chart Navigation
Pinch to zoom, pan to move along the time axis. Use UIPinchGestureRecognizer + UIPanGestureRecognizer simultaneously via gestureRecognizer(_:shouldRecognizeSimultaneouslyWith:) -> true. On zoom, visibleRange changes and we load historical candles for the new range via REST API. Crosshair on long press: UILongPressGestureRecognizer with minimumPressDuration = 0.1. On finger movement, update crosshair position and OHLCV tooltip with candle data under cursor.
Implementing Infinite Scroll for the Chart
- Determine
visibleRange based on contentOffset and candle width.
- When approaching the left edge (e.g., offset < 3 candles), send a request to the server for historical data.
- Add the received candles to the beginning of the dataset without resetting the current position — update
contentOffset by the width of added candles.
- Similarly for the right side — load newer data when scrolling right.
Order Form
Use a UITextField with a custom numeric keypad (inputView) instead of the system keyboard. It includes buttons for 25%, 50%, 75%, 100% of available balance for quick input. Store values as Decimal, not Double. Instant validation on input: minimum volume, tick size, available balance. Use Combine publisher(for: \.text) on UITextField with debounce(0.1) and map { Decimal(string: $0) }. Real-time cost calculation: total = price * amount including commission.
Buy/Sell Switching
Animated transition between buy and sell modes: form background color smoothly changes (green ↔ red), button text and direction icons change. On iOS, UIView.animate(withDuration: 0.2) with backgroundColor change. Haptic .impact(.medium) on switch.
Order Confirmation
A bottom sheet with order details before submission. Use UISheetPresentationController (iOS 15+) or a custom bottom sheet. Upon confirmation, the button enters a loading state (UIActivityIndicatorView replaces text) and is disabled for repeated taps. On API response, show success animation (green checkmark with scale animation) or an error with the specific error text from the API.
Performance and Optimization
The order book is a UITableView with potentially infinite height. Use UITableView.performBatchUpdates() for animated insertion/deletion/update of rows. With 10 updates per second, batch changes: do not call performBatchUpdates on every tick, collect changes over 100 ms and apply at once. A custom order book cell includes a depth bar (visual bar proportional to volume at that level). The depth bar is a UIView with a width constraint, updated via UIView.animate. Only change the constraint constant, not redraw the entire cell.
Profiling
Use Xcode Instruments > Time Profiler to find hot spots in the update loop. Core Animation instrument for frame drops. Target metrics: <16 ms for WebSocket batch processing, <5 ms for UI updates, 0 dropped frames when scrolling the order book. On Android, use Android Profiler in CPU+Memory+Network mode and systrace for long frames in Choreographer.
What’s Included in the Work
- WebSocket integration with throttling and reconnection logic
- Realization of candlestick chart (Core Graphics or LightweightCharts)
- Order book with batch updates and depth bar
- Order form with validation and confirmation
- Integration documentation and source code for UI components
- Technical support for one month after deployment
Estimated Timelines
Basic implementation (WebSocket + chart + order book + order form) — 5 days. Extended functionality (custom Metal rendering, indicators, analytics) — additional 5–10 days. Pricing is calculated individually — contact us for an assessment of your project.
Common Development Mistakes
- Updating the UI on every WebSocket message without throttling causes frame drops.
- Using Double for prices and volumes — loses precision in calculations.
- Creating a separate CALayer for each candle — catastrophic for performance.
- Ignoring reconnection logic — the app is left without data on connection loss.
UX/UI Design for Mobile Apps: Why a Figma Layout Doesn't Guarantee a Ready Interface
A designer sends a layout—beautiful, with gradients and custom components. The developer opens it and realizes: the button is 36pt, the tap target is 20pt. On an iPhone SE, it's physically impossible to press with a thumb. The bottom sheet covers content when the keyboard appears. Navigation is built against the native iOS model. Apple will reject the app, or users will leave within a week—depending on how lucky you get with the review.
We have been designing mobile UX/UI for over 5 years and have seen hundreds of such situations. During this time, we have designed and helped launch 30+ mobile apps—from fintech products to social networks. You don't need to guess whether the design will pass App Review or Google Play—we embed platform requirements from the first screen. We'll assess your project in one day, contact us.
Mobile UX/UI is not an adaptation of web design. It is a separate discipline with specific platform constraints: safe area, touch gestures, UIViewController lifecycle, Activity state management.
Why Can't You Ignore Human Interface Guidelines and Material Design 3?
Apple HIG and Google Material Design 3 are not aesthetic recommendations. They are documented user expectations formed by years of using system applications. Expectations confirmed by user experience research on mobile platforms (User experience design).
HIG defines: minimum tap target 44×44 pt, safe area insets for notch and Dynamic Island, standard gestures (swipe back on iOS, back gesture on Android 10+). Ignoring safe area is a common mistake. safeAreaLayoutGuide in UIKit and safeAreaPadding in SwiftUI exist precisely for this. A designer who doesn't set safe area margins in Figma guarantees a bug during development.
Material Design 3 introduced Dynamic Color—the color scheme is generated from the user's wallpaper via MaterialTheme.colorScheme in Jetpack Compose. An app that ignores dynamic colors on Android 12+ looks out of place. This is not critical for niche products but is noticeable in mass-market apps.
The most painful platform guideline inconsistencies we encounter on projects:
- Custom navigation on top of system navigation. iOS users expect swipe back from any point on the left edge of the screen. A custom
NavigationController without interactive gesture breaks this. Android users expect the system back button—a custom back button in the left corner does not fully replace it.
- Modal windows instead of navigation push. Bottom sheets are appropriate for actions, not for navigating content.
- Missing haptic feedback.
UIImpactFeedbackGenerator on iOS is not decoration but part of the interface response. Buttons, swipes, and confirmation actions without tactile feedback feel broken.
Table: Comparison of iOS and Android UX/UI Requirements
| Parameter |
iOS (HIG) |
Android (Material Design 3) |
| Minimum tap target |
44×44 pt |
48×48 dp |
| Safe area |
safeAreaLayoutGuide / safeAreaPadding |
Insets in WindowInsets |
| Back gesture |
Swipe from left edge |
System back gesture (Android 10+) |
| Color scheme |
System dark/light |
Dynamic Color from wallpaper |
| Typography |
San Francisco (Dynamic Type) |
Roboto (Material Type Scale) |
| Haptic feedback |
UIImpactFeedbackGenerator |
HapticFeedbackConstants (Compose) |
How to Get the Most Out of Figma?
The Figma Variables API has changed the workflow. Design tokens—colors, typography, radii, spacing—are stored as variables and exported directly to code via figma-tokens or style-dictionary. This eliminates manual value transfer and desynchronization between design and implementation. Practice shows: Figma Variables speeds up asset handoff to development by 2–3 times compared to static frames, and using design tokens reduces code transfer errors by 60%.
Auto Layout with wrap and spacing between elements allows building components that behave like flex containers. A developer opens a component and sees not a static artifact but a description of behavior at different content sizes.
Component Properties—variants, boolean toggles, instance swaps—enable building a full design system right in Figma. A button with 4 states (default, hover, pressed, disabled), 3 sizes, and 2 icon variants is one component, not 24 frames.
Figma Prototype with Variables allows creating an interactive prototype with real state: showing how the screen changes with different variable values. This is no longer just a "clickable layout" but a full UX testing tool.
How to Benefit from Prototyping and UX Testing Before Development?
The most expensive mistake in a mobile product is to develop a feature, release it, and discover that users don't understand how it works. A Figma prototype at the testing stage costs zero development hours. Redoing a finished screen costs days. Testing a prototype before development begins reduces the number of fixes by 80%.
For usability testing, we use Maze (task testing on a prototype—the user goes through a scenario, we get heatmaps and mis-click rates) or direct sessions via UserTesting. Key metrics are task completion rate and time on task, not "like/dislike."
A/B testing on mobile is harder than on web: the App Store doesn't allow UI changes without an app update. Therefore, it's important to test hypotheses on a prototype before release, not through production experiments. According to research, fixing a bug found on a prototype costs 10 times less than after production release. And average task completion time increases by 40% after proper UX optimization during prototyping.
Why Are Animations Critical for Interface Perception?
Animations in mobile apps are feedback. An element doesn't appear instantly—it transitions to the desired state over 200–350 ms. This gives the brain context to understand what happened.
- iOS:
withAnimation in SwiftUI, UIViewPropertyAnimator in UIKit for interactive animations with interruption capabilities. Spring animations with dampingRatio are the basis of most Apple system transitions.
- Android:
AnimatedVisibility, animateContentSize, Crossfade in Compose. MotionLayout for complex scenes with multiple transformations.
- Flutter:
AnimationController + Tween, Hero animations between screens, Lottie for After Effects exports. Lottie is especially effective for onboarding illustrations and empty states.
The key constraint is 16 ms per frame (60 fps) or 8 ms (120 fps on ProMotion devices). Animations must run on the GPU via CALayer/RenderThread, not on the CPU via layoutSubviews. Profiling via Core Animation instrument in Xcode is a mandatory step before releasing animated screens.
Why Is Accessibility Not an Optional Feature?
VoiceOver on iOS and TalkBack on Android are used by up to 15% of users—this statistic is confirmed by accessibility research described in Accessibility (Wikipedia). In absolute numbers for a large app, this is thousands of people. Additionally, App Store rejections due to accessibility occur, though rarely.
Minimum checklist:
- All interactive elements have
accessibilityLabel
- Text contrast ratio at least 4.5:1 (WCAG AA)
- Dynamic Type is supported—the interface doesn't break at maximum font size
- VoiceOver focus flows through the screen in a logical order
SwiftUI automatically generates an accessibility tree from component semantics. UIKit requires manual setup of accessibilityTraits, accessibilityHint, and grouping via shouldGroupAccessibilityChildren.
What Does the Work Include?
The UX/UI design deliverables include:
| Deliverable |
Description |
| User flows and wireframes |
Screen structure and user paths |
| Design system |
Design tokens, components, Style Dictionary for export |
| UI layouts (Figma) |
All screens following platform guidelines |
| Interactive prototype |
Prototype with variables and animations |
| Development specification |
Zeplin / Figma Dev Mode with dimensions, margins, states |
| Maintenance guide |
Recommendations for adding new screens and components |
What Is the Process and Timeline?
Design goes through stages: research and competitive analysis → user flows and wireframes → design system → UI layouts → prototype → testing → handoff to development.
Timeline estimates:
| Scope |
Timeline |
| Redesign of 3–5 screens |
1–2 weeks |
| MVP (10–15 screens) |
3–5 weeks |
| Full product (30+ screens) |
6–10 weeks |
The project scope and timeline are determined after analyzing your requirements—number of screens, component complexity, whether a design system is needed or we work with an existing one. Get a consultation for your project—contact us for a preliminary assessment. Order a complete mobile app design—we'll assess your project in one day and propose the optimal work scope.