I’m still spinning my wheels. Haven’t settled on a project I want to dig into yet. So nothing that exciting going on.
I toyed around with maybe bringing back Focuses—my habit tracking app I made a couple years ago and shut down about a year ago. So today, I started over. SwiftUI has come a bit farther than the first time, and I would like to try simplifying the model, a lot. I added a lot of features really fast the first go around and things broke down pretty quickly. So playing around with this and experimenting while I get my head on.
Made a little extension to give me the last 7 days. Just experimenting. I don’t think this will work though. If you’re in the app when the day changes, the static var will be out of date. So might go down the route of calculating on app start up and listening to an event for when the day changes or something like that.
extensionCalendar{
privatestaticvar _lastWeek: [Date]?
var lastWeek: [Date] {
get {
ifCalendar._lastWeek == nil {
let today = self.startOfDay(for: Date())
Calendar._lastWeek = (0...6).map { offset inreturnself.date(byAdding: .day, value: offset * -1, to: today)!
}
}
returnCalendar._lastWeek!
}
}
}
Been doing these devlogs for a month now. So far, I’m liking it!
Did a little work on my different version of Lightbulbs—focusing on the prompts instead of storing ideas. I think it’s going to work out. Much simpler and smaller in scope. I adding a setting that will let you append text when you save an idea. Planning on using this to automatically add #idea when I save it to Bear.
But, I’m having a hard time deciding which prompts to actually include. A friend suggested using GPT-3 to generate a bunch. I need to dig into that more. So right now I just have it showing 2 random words. Not that helpful, but better than nothing.
Some things left I want to do:
Better prompts—perhaps with some being premium.
A widget that shows a prompt every hour or something.
A daily reminder.
Keep track of how many ideas you’ve saved.
Possibly update the UI to make it like you’re swiping through cards.
Besides Lightbulbs, my brain is still churning on what’s new pages. I have an idea for a little backend that will let me update changelogs, upcoming features, etc. and the app will use an API to get the data for the current version, in addition to a public website for each app. Overkill for sure, especially since I have zero apps. But for some reason, I love what’s new pages in apps, and I want to explore an over-engineered solution.
Dealing with some self-imposed scope creep. I’ve got it in my head that I want my app to have multiple themes. And I’m not just talking dark/light mode or accent colors. I want themes to change the way different elements in the UI look—buttons, cards, etc. So far It’s taken me down some roads I don’t completely understand, like generics. I’m trying to be fancy with protocols (which I also don’t completely understand,) but I keep getting a lot of Type 'any MyView' cannot conform to 'View' errors. I’m probably complicating things and should just have wrapper components with a switch statement to choose which component to use based on the current theme. But, again, scope creep. Still don’t have the core functionality of the app figured out. It’s fun experimenting though.
In other news, I created an issue looking for maintainers on Simple Embeds. It was a big step for me. I’ve been putting it off for a long time. Didn’t want to admit that I no longer had time, energy, or desire to work on one of my more successful projects. If no one is interested, eventually I will archive it and let it go for good. So we’ll see what happens. But, excited to be closer to clearing headspace for other projects. It might be just me, but it really weighs on me knowing that I have something out there that people are using, but is essentially unmaintained—even if people are mostly okay with it how things are.
Last week was Thanksgiving and I took some time off. My family went to a beach house for the week. I brought my journal, my laptop, and running shoes. I had good intentions. But when I’m out of my element, I have a real hard time sticking to the routines I have at home. So I mostly did nothing I intended to do—except I went running once when the tide lined up with the time I usually run at.
It was good to have a break though. I’ve been working pretty consistently on some side projects, so it was nice to give my brain a break and eat far too much apple pie.
I was excited to get back into the swing of things this week, but then my family and myself got sick. So now I’m trying to figure out how much I should rest versus stick to my routine. My brain isn’t in tiptop shape right now, so not sure how productive I would be working on some apps. But at the same time, I don’t want to go 2 weeks without working on anything. That would be hard to come back from. I should probably find some lighter weight tasks to work on.
Anyway, sticking to routines is hard, especially when you’re on “vacation” with kids!
Just been working on some small polish things. Like real small things—make sure the buttons have the right color. So I over-engineered it! I always forget how to make custom ButtonStyle, so putting this here for reference. I have a view modifier for the shared stuff between multiple button styles that can simply be used like .buttonBase. Than to style a button, .buttonStyle(.primaryButton). Easy! Definitely worth the effort for the 2 buttons I have. But did do some Swift generics stuff which is always exciting…
I’m still procrastinating and thinking about stuff. So I decided to tinker with a couple things I’ve never done. I was playing around with Federico Viticci’s incredible Apple Frames shortcut, and thought, how do you combine 2 images in an app? So decided to give it a try in a SwiftUI Mac app.
Basically, I have a ZStack with 2 images and then use ImageRenderer to create and image I can save to disk. Pretty cool!
I’m using the .onDrop modifier. It gives you an array of NSItemProvider. I’ve never used that before, so not totally sure what I can do with it yet. But for now, I call loadDataRepresentation which gives a Progress which I also don’t know how to use. I found it interesting that there doesn’t seem to be an async alternative for loadDataRepresentation, still takes a completion handler. Might just be missing it though. Anyway, lots of things to explore.