A beautiful, intuitive iOS app for viewing real-time tide information and predictions for any coastal location worldwide.
- Real-time Tide Data: Get accurate tide predictions from WorldTides.info API
- Interactive Tide Graphs: Visualize tide patterns with smooth, animated curves
- Location Search: Find any coastal location using MapKit integration
- Current Tide Indicator: See exactly where you are in the current tide cycle
- 48-Hour Window: View tide data 24 hours before and after the current time
- Persistent Location: Your selected location is automatically saved
- Elegant UI: Clean, modern SwiftUI interface optimized for iOS
| Main Interface | Location Search | Tide Graph |
|---|---|---|
| Coming Soon | Coming Soon | Coming Soon |
Screenshots will be added once the app is built and running
- iOS: 15.0 or later
- Xcode: 14.0 or later
- Swift: 5.7 or later
- Internet Connection: Required for fetching tide data
- WorldTides.info API Key: Required for accessing tide data
- Xcode: Download and install Xcode from the Mac App Store
- WorldTides.info API Key:
- Sign up at worldtides.info
- Subscribe to their API service
- Get your API key from the dashboard
-
Clone the repository:
git clone https://github.com/vini-ro/TideTimes.git cd TideTimes -
Configure API Key:
- Open
Services/APIConfig.swift - Replace
"YOUR_API_KEY"with your actual WorldTides.info API key:
static let worldTidesAPIKey = "your_actual_api_key_here"
- Open
-
Open in Xcode:
- Double-click the project folder or drag it into Xcode
- Select your target device/simulator
- Build and run (โ+R)
The app uses the WorldTides.info API for accurate tide predictions. Configuration is managed in Services/APIConfig.swift:
enum APIConfig {
static let worldTidesAPIKey = "YOUR_API_KEY" // Replace with your key
static let worldTidesBaseURL = "https://www.worldtides.info/api/v3"
}The app requests the following permissions:
- Location Services: For location-based search (optional)
- Network Access: For fetching tide data (required)
- Launch the app: Tap the TideTimes icon to open
- Select a Location:
- Tap the location button (๐) in the top toolbar
- Search for any coastal location
- Select from the search results
- View Tide Data: The main screen displays:
- Interactive tide graph with height over time
- Current tide position (red indicator)
- High and low tide times and heights
- Location name
- Blue Curve: Shows tide height over time
- Red Dot: Current tide position
- Time Labels: Show specific high/low tide times
- Height Values: Displayed in meters
- Grid Lines: Help read approximate values
- Type any coastal city, harbor, or landmark
- Results are powered by Apple's MapKit
- Selected locations are automatically saved
- Data covers 48 hours (24 hours before/after current time)
- Updates automatically when location changes
- Handles high/low tide classification
- Shows exact times and heights
TideTimes/
โโโ TideTimesApp.swift # Main app entry point
โโโ ContentView.swift # Primary app interface
โโโ Models/
โ โโโ TideData.swift # Data models (TideData, Location)
โโโ Services/
โ โโโ APIConfig.swift # API configuration
โ โโโ TideService.swift # Tide data fetching service
โ โโโ LocationManager.swift # Location search and management
โโโ Views/
โ โโโ TideGraphView.swift # Tide visualization component
โ โโโ LocationSearchView.swift # Location picker interface
โโโ Extensions/
โ โโโ UserDefaults+Codable.swift # Persistence helpers
โโโ Assets.xcassets/ # App icons and images
โโโ Preview Content/ # SwiftUI preview assets
The app follows the Model-View-ViewModel pattern with SwiftUI:
- Models:
TideData,Location- Pure data structures - Views: SwiftUI views for UI presentation
- ViewModels:
@StateObjectclasses (TideService,LocationManager)
- Fetches tide data from WorldTides.info API
- Processes and formats tide information
- Publishes updates to the UI
- Handles location search using MapKit
- Manages selected location persistence
- Provides search completion functionality
- Renders interactive tide curves
- Calculates point positions and curves
- Shows current tide indicator
- Displays time and height labels
- User selects location โ LocationManager
- Location change triggers โ TideService
- API call fetches tide data โ TideService
- UI updates automatically โ SwiftUI @Published
# Option 1: Build in Xcode (Recommended)
# Open the project in Xcode and press โ+B
# Option 2: Command line build
xcodebuild -scheme TideTimes build- Connect your iOS device or open iOS Simulator
- Select your target device in Xcode
- Press โ+R to build and run
- Unit tests can be added for service classes
- UI tests can verify navigation and data display
- Currently no test suite is included (contributions welcome!)
- Follow Swift API Design Guidelines
- Use SwiftUI best practices
- Maintain clear separation of concerns
- Document complex algorithms
- Use meaningful variable and function names
- Keep functions small and focused
We welcome contributions! Please follow these guidelines:
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Make your changes: Follow the existing code style
- Test thoroughly: Ensure your changes work as expected
- Commit your changes:
git commit -m 'Add amazing feature' - Push to the branch:
git push origin feature/amazing-feature - Open a Pull Request: Describe your changes clearly
- Additional chart types and visualizations
- Offline data caching
- Widget support
- Apple Watch companion app
- Additional tide data sources
- Accessibility improvements
- Localization
This project is licensed under the MIT License - see the LICENSE file for details.
- WorldTides.info: For providing accurate tide data API
- Apple: For SwiftUI, MapKit, and iOS development tools
- Swift Community: For excellent documentation and resources
If you encounter any issues or have questions:
- Check the Issues page
- Create a new issue with detailed description
- Contact the developer: Vinicius Oliveira
"API Error" or "No Data"
- Verify your WorldTides.info API key is correctly set in
APIConfig.swift - Check your internet connection
- Ensure the selected location is coastal (inland locations won't have tide data)
Location Search Not Working
- Check location permissions in iOS Settings
- Ensure you have an internet connection
- Try more specific location names (e.g., "Santa Monica, CA" instead of just "Santa Monica")
App Won't Build
- Ensure you're using Xcode 14.0 or later
- Check that iOS deployment target is set to 15.0 or later
- Verify all dependencies are properly resolved
- Apple Watch companion app
- Tide widgets for home screen
- Offline data caching
- Multiple location favorites
- Tide notifications and alerts
- Chart customization options
- Export tide data functionality
Made with โค๏ธ by Vinicius Oliveira
Last updated: November 2024