Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. iOS
  3. Solar

Solar

MITSwift3.0.1

A Swift micro library for generating sunrise and sunset times locally using astronomical algorithms.

GitHubGitHub
616 stars87 forks0 contributors

What is Solar?

Solar is a Swift micro library that generates sunrise and sunset times for any location and date. It solves the problem of needing accurate solar calculations without relying on network services by implementing the United States Naval Observatory algorithm locally.

Target Audience

iOS and macOS developers building apps that require solar time calculations, such as weather applications, photography tools, outdoor activity planners, or any app needing daylight awareness.

Value Proposition

Developers choose Solar for its offline capability, lightweight implementation, and accurate astronomical calculations without external dependencies. It's specifically designed for Swift ecosystems with support for multiple package managers.

Overview

A Swift micro library for generating Sunrise and Sunset times.

Use Cases

Best For

  • Weather apps that display sunrise and sunset times
  • Photography apps calculating golden hour or blue hour
  • Outdoor activity planners tracking daylight hours
  • Home automation systems that trigger actions based on solar times
  • Astronomy apps displaying twilight phases
  • Location-based apps needing offline solar calculations

Not Ideal For

  • Projects requiring cross-platform solar calculations in languages other than Swift, such as JavaScript or Python
  • Applications needing real-time solar data with atmospheric corrections or high precision beyond the standard algorithm
  • Apps that prefer integrated timezone handling without manual conversion from UTC
  • Projects requiring comprehensive astronomical features beyond sunrise/sunset, like moon phases or solar position tracking

Pros & Cons

Pros

Offline Calculations

Uses the United States Naval Observatory algorithm to compute times entirely offline, eliminating network dependencies and ensuring functionality without internet access, as highlighted in the README.

Multiple Twilight Support

Provides four types of sunrise/sunset (official, civil, nautical, astronomical) based on sun position below the horizon, with external references for clarity, making it versatile for different use cases.

Swift Ecosystem Integration

Designed for Swift with support for CocoaPods, Carthage, and Swift Package Manager, making installation straightforward for iOS/macOS projects, as detailed in the installation section.

Convenience Methods

Includes properties like `isDaytime` and `isNighttime` for easy boolean checks on daylight status, simplifying common tasks without extra code.

Cons

UTC-Only Output

Returns all times in UTC without built-in timezone conversion, requiring additional code for local display, which the README explicitly notes as a manual step.

Limited Astronomical Scope

Focuses solely on sunrise/sunset calculations with twilight variations, lacking other common features like moon phases, solar noon, or detailed solar azimuth, which might necessitate additional libraries.

Platform Restriction

Tied to Swift and Apple's ecosystems (iOS/macOS), making it unsuitable for web, Android, or cross-platform projects without significant workarounds.

Frequently Asked Questions

Quick Stats

Stars616
Forks87
Contributors0
Open Issues8
Last commit5 years ago
CreatedSince 2016

Tags

#ios#date-time#geospatial#offline#astronomy#osx#location#swift-4#sunrise#micro-library#swift#sunset#macos#sunrise-sunset

Built With

S
Swift

Included in

iOS51.7kSwift26.0k
Auto-fetched 1 day ago

Related Projects

SwifterSwiftSwifterSwift

A handy collection of more than 500 native Swift extensions to boost your productivity.

Stars15,178
Forks1,663
Last commit12 days ago
R.swiftR.swift

Strong typed, autocompleted resources like images, fonts and segues in Swift projects

Stars9,562
Forks776
Last commit1 year ago
SwiftDateSwiftDate

🐔 Toolkit to parse, validate, manipulate, compare and display dates, time & timezones in Swift.

Stars7,696
Forks774
Last commit2 years ago
DateToolsDateTools

Dates and times made easy in iOS

Stars7,180
Forks939
Last commit2 years ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub