blinc_platform_ios
Part of the Blinc UI Framework
This crate is a component of Blinc, a GPU-accelerated UI framework for Rust. For full documentation and guides, visit the Blinc documentation.
iOS platform implementation for Blinc UI.
Overview
blinc_platform_ios provides UIKit integration, Metal rendering, and touch input handling for iOS and iPadOS applications.
Supported Platforms
- iOS 14.0+
- iPadOS 14.0+
Features
- UIKit Integration: Native iOS view hierarchy
- Metal Rendering: Hardware-accelerated graphics
- Touch Input: Full multi-touch support
- iOS Lifecycle: Proper app state handling
- Safe Area: Automatic safe area inset handling
Quick Start
use ios_main;
pub extern "C"
Project Setup
Cargo.toml
[]
= ["staticlib"]
[]
= "0.1"
Xcode Project
- Create a new iOS project in Xcode
- Add your Rust library as a dependency
- Configure the bridging header
- Set up the Metal view
Info.plist
UILaunchStoryboardName
LaunchScreen
UISupportedInterfaceOrientations
UIInterfaceOrientationPortrait
UIInterfaceOrientationLandscapeLeft
UIInterfaceOrientationLandscapeRight
Touch Handling
Safe Area
// Get safe area insets
let insets = ctx.safe_area_insets;
// Build UI respecting safe area
div
.pt
.pb
.pl
.pr
.child
Lifecycle
ios_main;
Building
# Build for iOS Simulator
# Build for iOS Device
# Build universal binary
Requirements
- Xcode 14+
- iOS SDK 14.0+
- Rust with iOS targets:
License
MIT OR Apache-2.0