An iOS app for trail risk assessment. Uses Core ML for predictions and includes an AI chat assistant for hiking advice.
- Chat interface for hiking questions and advice
- Uses Apple's FoundationModels on supported devices (iOS 26+)
- Falls back to curated knowledge base on older devices
- Covers gear, safety, weather, and trail planning topics
- Core ML model predicts trail difficulty
- Takes distance, elevation, terrain, and wildlife into account
- Shows risk level with personalized recommendations
- Optional AI-enhanced explanations when available
- Easy: Good for beginners
- Moderate: Some experience recommended
- Difficult: Requires fitness and experience
- High Risk: Expert-level trails
- macOS Ventura 13.0+
- Xcode 15.0+
- iOS 17.0+ SDK
-
Clone the repository
git clone https://github.com/dmakarau/HikeAnalyzer.git cd HikeAnalyzer -
Open in Xcode
open HikeAnalyzer.xcodeproj
-
Build and Run
- Select your target device or simulator
- Press
Cmd + Rto build and run
- Enter trail details: distance, elevation, terrain type, wildlife danger
- Tap "Analyze Trail" to get your risk assessment
- Use AI Support for hiking questions and advice
- Check Risk Levels Guide to understand the categories
On iOS 26+ devices with FoundationModels support, the chat uses on-device AI. On older devices, it uses a curated knowledge base covering common hiking topics. Both provide the same user experience.
The Core ML model considers:
- Distance: Longer trails mean more fatigue
- Elevation: Steep climbs increase difficulty
- Terrain: Surface type affects stability
- Wildlife: Potential animal encounters
- Clean, minimal interface
- Supports Dynamic Type and VoiceOver
- Lightweight ML model for fast predictions
HikeAnalyzer/
βββ App/ # App entry point
βββ AIChat/ # AI assistant functionality
β βββ Models/ # Chat message data models
β βββ Services/ # AI service integration
β βββ ViewModels/ # Chat business logic
β βββ Views/ # Chat interface components
βββ Core/
β βββ Model/ # Data models and ML integration
β βββ View/ # SwiftUI views
β βββ Modifiers/ # View modifiers and themes
βββ Resources/ # Assets and ML model
- CoreMLTrailAnalyzer: ML model wrapper
- ChatViewModel: Chat state management
- HikingAIService: FoundationModels + fallback logic
- TrailTheme: Colors and styling
This is a personal project for learning. Feel free to fork it or open an issue if you find bugs.
- Added Apple Intelligence integration via FoundationModels (iOS 26+)
- Fallback system for devices without FoundationModels support
- AI-enhanced risk explanations and recommendations
- Migrated to
@Observablefrom@ObservableObject - MVVM refactoring with ChatViewModel
- Decomposed views into smaller components
- Added ChatConstants for string management
- Keyboard dismissal improvements
MIT License - see LICENSE.
- SwiftUI community
- Apple's Core ML and FoundationModels teams
Built with SwiftUI, Core ML, and FoundationModels.



