A beautiful app that will let you know how much sun you have today.

Overview

Daylight

Daylight

A beautiful app that will let you know how much sun you have today.

Running the project

  • Open Project.xcodeproj and run

What's interesting about this project?

Uses a JavaScript library for the sun calculation

Shares the same sun calculation library as the web app. It uses JavaScriptCore to load suncalc.js, you can find the library here: https://github.com/mourner/suncalc. The bridge that converts JavaScript to Swift can be found in SunCalc.swift.

Comments
  • Pull Request template

    Pull Request template

    I wanted to give the PR template mentioned in this article a try, but apparently it will only show up when its merged to the main branch. So we'd first have to merge it to see how it will work 😬

    I added it to the XCode project so you can easily edit the template rendered in markdown 💅 To make it render this post said i had to add some .xcodesamplecode.plist file. But please correct me if i'm wrong 😬

    opened by marijnschilling 3
  • Start animation

    Start animation

    Thought it would be cool if the sun would animate to it's current position when you open the app. Code is a bit messy though with states like startAnimationInProgress and startAnimationInProgress 🙈

    animation

    See more on wake: https://bakkenbaeck.wake.com/set/1089/13312

    opened by marijnschilling 3
  • Hook up SunPhase scheduler with controllers

    Hook up SunPhase scheduler with controllers

    Changed the SunPhaseManager to be SunPhaseScheduler, its role is basically to notify the controllers for when the UI should change and with what. I'm not 100% sold on the name, but I believe is an improvement.

    Also SunPhaseScheduler requests the owner for the sunPhase instead of using a variable for this. Thanks to this we can detach storing a sun phase in the scheduler as well, making it simpler.

    opened by 3lvis 3
  • Feature iOS 14 Widget

    Feature iOS 14 Widget

    Description

    This pull request contains changes to package management, updates to Swift 5 and iOS 14 widget support (small and medium). Bug fixing due to updating to iOS 14 and updating LocationTracker due to deprecated authorizeStatus function

    I've tried to make a large widget that shows the sun location using SunView, however, I found out WidgetKit prevents too many updates. Converting UIVIew to View with UIViewRepresentable will not work in a Widget for that reason. Alternative methods I tried are screenshot the view after instantiating it or recreate it in View but with no success. I believe this is where my knowledge ends with Swift. In case anyone is interested to pick this up that would be amazing 🙏

    Now, the widget retrieves user location and time to show a message and location. Just like inside the app, and it changes the Theme color depending on the day.

    Type of Change

    • [x] iOS 14 Widget (small, medium)
    • [x] Fix authorizeStatus deprecation fix
    • [x] Package manger from Carthage to Swift Package Manager
    • [x] Fix share button
    • [x] Convert to Swift 5
    • [x] Fix presenting main modal to fullscreen

    Proof that it works

    image

    P.S. I'm not a Swift developer, if you see any flaws or possible ways to improve the code, please feel free to make changes. The latest Testflight build that contains the latest update is 1.9.0 Build 58.

    enhancement 
    opened by wesleybb 2
  • Today Widget

    Today Widget

    I love the Daylight app. For me personally the notifications are too much though, but I'm also not going to open the app everyday. I think this is a nice example for a Today Widget. This PR is an initial attempt at a simple Today Widget that shows the same message like the app and also the sunrise & sunset times.

    02f5514d-69e5-4e56-a7c3-7957bba0d1be

    I've just added the necessary files to the target. One idea would be to move the whole Library directory into it's own framework. But that's probably a bit overkill for now. Let me know what you think. Happy to change things :)

    opened by D-32 2
  • Notification button is not working well

    Notification button is not working well

    There's delay on the changing from on to off, when i click on the bottom i don't get any feedback that something is actually happening. We should show feedback or make the change instant.

    opened by marijnschilling 2
  • Mask the sun when its under the horizon

    Mask the sun when its under the horizon

    The masking works fine! But I found that updating the constraints for the sun isn't working right. I'm doing it exactly the same as updating the constraints on the MainController for the messageView though 🤔

    opened by marijnschilling 2
  • Renaming view controllers

    Renaming view controllers

    I thought the use of the word controller was very ambigious now that i added a DaylightModelController so i decided to rename all VeiewControllers to be explicitly names ViewControllers and to refer to the DaylightModelController as daylightModelController in parameters or properties.

    I also unified the naming of the update functions to be update(withDaylightModelController daylightModelController: DaylightModelController)

    I tested it by checking wether the word controller was unes anywhere in the project by itself :)

    opened by marijnschilling 1
  • Animation

    Animation

    • [x] The position of the sun when the animation ends doesnt always align with the sun position 🐛
    • [x] Disable animation when the moon is show (maybe just fade the moon in slowly?)
    • [x] I'd also like it if the sun animates to it's new position when you re-enter the app
    • [ ] Refactor the way the app decided wether the animation should be shown. It feels to dependant on states right now which makes it prone for bugs!
    opened by marijnschilling 0
  • Better error messages when there's no connection

    Better error messages when there's no connection

    I got this error message when i had nu interwebz connection: screenshot 2017-01-02 10 55 47

    Should be a more human messages, and we should decide how we update the interface in that case. Should we leave it to the last known data or do something else?

    opened by marijnschilling 1
Releases(1.4.0)
Owner
Bakken & Bæck
We invent, build and launch products and ventures for startups, established companies and ourselves.
Bakken & Bæck
App Everything in one place (news, weather, stocks and much more)

Dashy Everything in one place (news, weather, stocks and much more) I tried to follow MVVM Pattern, Used Decodable And URLSession instead of thrid-par

Aayush 3 Nov 24, 2021
Red Torch is a very very (very) simple iOS app that allows you to have a red torch using your screen.

RED Torch Red Torch is a very very (very) simple iOS app that allows you to have a red torch using your screen. The App is based on storyboard, so the

Jakub 0 Jan 1, 2022
NewsApp - MVVM pattern have been used

NewsApp MVVM pattern have been used. All features are working properly as suppose to. Alamofire, Kingfisher, lottie-ios and IQKeyboardManagerSwift pod

Uğur Can GEDİK 0 Jun 6, 2022
A simple clean application to provide you with weather forecast data as well as currency rates, all with beautiful melodies and sounds

A simple clean application to provide you with weather forecast data as well as currency rates, all with beautiful melodies and sounds.

Sergey 1 Jan 21, 2022
📱 An app fully written in SwiftUI showcasing beautiful design and animations.

DesignCode DesignCode is an app fully built using Apple's latest SwiftUI and Combine framework. Beautifully written code that is well intended for eas

Mithun 704 Jan 3, 2023
Create a beautiful Onabording for your iOS/iPadOS apps in just a few minutes.

Create a beautiful Onabording for your iOS/iPadOS apps in just a few minutes.

Jem Alvarez 6 Sep 9, 2022
Are you bored? This app helps find you something to do via Bored api

Bored Swift Are you bored? This app helps find you something to do via Bored api Features Beautiful widgets ?? Simple and easy ✅ Open source ?? Previe

Armin Shalchian 29 Oct 11, 2022
Visualize your dividend growth. DivRise tracks dividend prices of your stocks, gives you in-depth information about dividend paying stocks like the next dividend date and allows you to log your monthly dividend income.

DivRise DivRise is an iOS app written in Pure SwiftUI that tracks dividend prices of your stocks, gives you in-depth information about dividend paying

Kevin Li 78 Oct 17, 2022
MapApp - You can save the location of the places you go on the map and add names and notes

MapApp - You can save the location of the places you go on the map and add names and notes

Yağız Savran 3 Feb 1, 2022
Bookworm - Track which books you’ve read and what you thought of them

Bookworm Description: Bookworm is an app I built while following 100 Days of Swi

Ionut Vasile 0 Aug 18, 2022
Pomodoro App - an App that helps you perform tasks for a while, following the Pomodoro technique

Pomodoro App - an App that helps you perform tasks for a while, following the Pomodoro technique

Giovanna 3 May 10, 2022
KHabit an open source, pure and minimalistic app which helps you maintain productive habits, and nothing more.

an open source, pure and minimalistic app which helps you maintain productive habits, and nothing more. The app is completely open source, it does not contain in-app or ads, and does not track the user in any way.

Stefano Bertoli 42 Dec 17, 2022
Stock is a MacOS menu bar app that helps you quickly save a web link, a file link, or a text by using drag and drop

Stock is a MacOS menu bar app that helps you quickly save a web link, a file link, or a text by using drag and drop

シュンジョーァ 19 Dec 4, 2022
an open source, pure and minimalistic app which helps you maintain productive habits, and nothing more.

KHabit an open source, pure and minimalistic app which helps you maintain productive habits, and nothing more. The app is completely open source, it d

Stefano Bertoli 17 May 5, 2021
A demo of how you can integrate SwiftUI and Airtable in your app

SwiftUI Airtable Demo This is a small, functional example app that demonstrates how you can use Airtable as a lightweight backend. I wouldn't recommen

Zack Shapiro 144 Oct 21, 2022
A simple Apple Watch app to remind you to drink water!

Waterminder A simple Apple Watch app to remind you to drink water. Built with SwiftUI and Combine You can find an article explaining the implementatio

Carlos Corrêa da Silva 184 Dec 31, 2022
Mahmoud-Abdelwahab 5 Nov 23, 2022
Informant is a macOS menu bar app that lets you inspect files with a single click. 🔍

Informant Inspect files with a single click. Introduction Welcome! If you're not sure what Informant is or what it does please check out informant-app

Ty Irvine 31 Nov 7, 2022
A SwiftUI app that reads iOS/watchOS/tvOS device model information from Xcode you select.

iVariant A SwiftUI app that reads iOS/watchOS/tvOS device model information from Xcode you select. Preview License iVariant is licensed under MIT. Cop

Lakr Aream 20 Aug 4, 2022