r/iosdev • • 14d ago • Mindblown 1

Major Update: Clear fishtank widgets without being in clear mode, with fish that actually swim around 🐠🪼🐙

What Companions is:
Widgets on iOS are supposed to be static. I always found that unnecessarily limiting, so I built an app that circumvents it. Companions lets you keep a virtual fishtank on your Homescreen, filled with fish that actually swim around. As someone who’s always kept fish, I’ve had this idea mulling around in my head for more than 2 years now, and finally managed to build what I always wanted.

There are 50 fish to choose from, and it supports small, medium, large and now even extra large widgets as “tank sizes”. The fish don't need any feeding, and they don't die (as to not be annoying, but the option is there for fun). They just keep you company. You can customize the tank’s color, its props, layout, and even the app icon to match your Home Screen perfectly.

The app is fully written in SwiftUI, it supports iPads, and you can even place your “fishtanks” on your Mac thanks to Continuity, where the fish will also animate. The tanks also work great in Standby mode. Personally, I keep a fishtank of jellyfish on my nightstand when I go to bed. The swimming doesn't run any code in the background. It uses the same trick iOS uses to move the hands on the Clock widget, so it costs you nothing in battery.

What's new:
The app was built to support clear mode on the phone, but I found it annoying that you need to be explicitly in clear mode to access clear widgets. Luckily, I knew of a separate workaround that allows for clear widgets even while not being in clear mode, which I’ve only seen a small number of widget apps use. And for something like Companions where the widgets are fish tanks, I feel like it fits so perfectly!!

I'd love any feedback, and I’m happy to answer any questions regarding the app. I'd especially love to know which fish species you'd want added.

You can find Companions here: https://apps.apple.com/us/app/companions-widget-pets/id6811950512

292 Upvotes

70 comments sorted by

8

u/Flashy_Jellyfish_258 14d ago • Popcorn

How much battery does it consume? Did you do any quantitative analysis on this? What happens when the phone screen is locked? Does the widget continuous to consume battery?

11

u/tiaanvdr 14d ago

That's a great question!! The fish animations use exactly the same "trick" Apple themselves use to animate second hands on clocks. So having a homescreen layout like this, would have about the same battery impact as having one of my fish tanks. I'm not saying that this is a particularly common homescreen layout, but these are API's apple built themselves, and put into a stock widget, on every single device and every single version of iOS for years now, with the explicit goal of animating things on widgets continuously.

I have also tested battery usage through Xcode's Energy Impact gauge, and it's incredibly minimal. The app does not keep a "ticker" or an "internal clock" or anything like that, everything is handled via Apple's own WidgetKit api's.

4

u/Confused_Dad_2023 14d ago • Heartwarming

This is very cool! I have the app installed and play with it. One question - Is the clock trick a private API? I am building something similar, not fish, but the app has animated widget component and I don’t see this trick public anywhere.

6

u/tiaanvdr 14d ago

It is yes! There's a super popular YouTube video about it from like a year ago that was also a huge inspiration for this project https://youtu.be/NdJ_y1c_j_I?si=pIejJtFCSFHzLB4L

5

u/howreudoin 14d ago • Heartwarming

I knew exactly what video you were linking to. Too bad this guy seems uncertain as to whether he‘ll make any more videos in the future. It‘s such an amazing channel.

2

u/tiaanvdr 13d ago

Yeah, his videos were so great and super informative. I'm really hoping he finds a way to come back and continue the amazing channel, but his current outlook on things is also very understandable

7

u/grandchester 14d ago

How was it approved if you are using a Private API? My app can benefit from an animated widget.

3

u/tiaanvdr 14d ago

I'm honestly not sure. But tbh I've never had any issues with App Store review times/strictness or anything. I've been reading tons of complaints on this sub recently about it. My developer account is 5 years old though, I think that helps a lot.

1

u/BSRosales 13d ago

Honestly you can get this affect with out a private api it just takes some thinking that’s for sure.

3

u/King_Prabhu 14d ago

Can I have code please

3

u/tiaanvdr 14d ago

Since you asked so nicely 🫶

3

u/Zetice 14d ago

can i buy the app?

3

u/armistitiu 14d ago • Heartwarming

Looks amazing! You got lucky with the app review approval. Apple is generally against the live moving widgets. Keep your future app updates and subsequent app reviews on the down low, I guess. Congrats!

1

u/tiaanvdr 14d ago

Thank you!!! I'll defenitely have to do that yeah

3

u/WitchesBravo 14d ago

Love the app but the clear glass mode isn’t working for me, it shows up as clear for a second before changing to opaque

1

u/tiaanvdr 13d ago

Is your device in Dark Mode? I know Apple forces a dark tint over widgets in Dark Mode, it's not something I've been able to work around yet. This does seem quite darker than usual though, I'll look into it, thanks for lettting me know and for attatching a video!

2

u/WitchesBravo 13d ago

Ah yes I’m in dark mode and turning off dark mode does make it clear

1

u/tiaanvdr 13d ago

I'm glad that makes it clear, thanks for letting me know! But also damn, what an annoying quirk from Apple :') I'll keep looking into it, hopefully there is a workaround for this as well

2

u/beastieboyd 12d ago

It is annoying of Apple to force this on widgets especially when on dark mode it doesn’t darken the stock glass effects elsewhere in the ui. I was bummed when I found this out with your widget cause I exclusively use dark mode

3

u/eatingthesandhere91 13d ago edited 13d ago • Heartwarming

Aaaaand you got my attention.

Edit: so there are a few visual bugs, especially if you start out with one fish 🐠. The visual glitch I’m seeing is when the bubbles pop on the clear tank option that it sometimes shows the fish very briefly outside the “tank”.

Otherwise I like this and it’s giving me wallpaper ideas.

I’m intrigued to say the least to see what you come up with next!

Edit #2: I think the $3.49 is more than fair given the average subscription price of most of the App Store is above $6/month. I will throw this out there: can you add the ability to customize the size of the tank complications?

1

u/tiaanvdr 13d ago

Let me know what you think if you give it a try 👀

1

u/eatingthesandhere91 13d ago

I’ve edited my comment. ✅

2

u/nummycakes 14d ago • Heartwarming

Love this! Can we get some gravel or some floor options please 🐙

1

u/tiaanvdr 13d ago

That's a great idea!! I've been focused a lot on expanding the fish selections in the app, I really need to work on adding more props, as well as some floor options! Thank you for giving the app a try and for your suggestion!

1

u/nummycakes 13d ago

It's such a good idea. Best of luck

2

u/BTCLSD 14d ago • Heartwarming

Woah this is really cool. I thought widgets couldn’t have perpetual motion though, do the fish continuously swim?

1

u/tiaanvdr 13d ago

Apple doesn't allow for it, yes, but these fish do continuously swim! There has been a known workaround in iOS to allow widgets to have continuous motion through either a clock second-hand or a font trick. I've known about this trick for a while now, but finally found the perfect use case for it! A little fishtank with fish that swim around

1

u/BTCLSD 13d ago

Wow, cool! Good to know!

2

u/JesuSwag 13d ago

Any reason why the animation does not support pro motion on iPhone 14 Pro Max? It’s choppy and seems like it’s running at 15 frames maybe. Love the aesthetic but ruined by low frame rate. It is a deal breaker for me personally.

1

u/tiaanvdr 13d ago

Thanks for trying the app and for the feedback! Are you in low power mode? Apple cuts back even the animation speed of their own clock widgets in low power mode, and I haven't found a way of bypassing that yet. Other than that, there is a tradeoff to be made between the number of clocks I use to drive the animation, and the number of fish I allow in the tank. I'm still trying to work on improvements to the smoothness, but it's been difficult as animations are not something Apple allows for at all. Personally, I just go into the app and slow down my fish's swim speed, this does help, and I also prefer the calmer vibe it gives as well. I've tried to provide some options and find a happy middle ground, but there's still work to be done!

2

u/on-foenem 13d ago

trying on iphone duo not on low power mode and the animation is a bit choppy or laggy

1

u/tiaanvdr 13d ago

Ah damn, I see, I suppose I'm a bit limited by the number of clocks I can spawn to drive the animation. Thanks for the feedback, though. There is a way to get almost 60fps smoothness with a different font cycling trick, but then the animation would have to be "pre-baked," which wasn't possible for this app where I wanted people to fully customize their tanks, fish, their sizes, their swim speeds, etc. I'll keep working on it. Thanks for letting me know!

2

u/theAerialDroneGuy 13d ago edited 13d ago

This is awesome!!!! Such a cooo widget!

Can you make an animated tamagotchi widget next?

2

u/tiaanvdr 13d ago

That's a really cool idea! I'll look into it! RIght now I'm really focussed on this app and making it as good as possible, but a true tamagotchi style app is a not a bad avenue to explore either!

2

u/theAerialDroneGuy 13d ago • Heartwarming

This is really cool. I love the clear glass fish tank and the swimming fish!! Very unique!!
I downloaded it!

2

u/lowkeyfam 13d ago

Is it just my device or are the fish low frame rate

1

u/tiaanvdr 13d ago

When you're in low power mode, the fish frame rate does go down. This is controlled by Apple, even Apple's own clock widgets get choppy then :')

2

u/lowkeyfam 13d ago

i’m not in low power mode. iPhone 14 Pro

2

u/Putrid_Resolution402 13d ago • Heartwarming

Love the concept but app is overpriced

2

u/tiaanvdr 13d ago

I think compared to other widget-building apps, it's pretty fair. I spent a ton of time setting up and managing all the different in-app purchase options to allow for flexibility when it comes to what you might care about. It would've been so easy to only offer a monthly subscription, and nothing else. But I didn't want to do that, some people might only care about specific fish, and buying something outright as a lifetime purchase has always felt better to me.

If you don't care about the fish, all of the props, and all of the tank styles, as well as all of the tank sizes, are freely available. You can build a beautiful tank that perfectly matches your device, without ever needing to spend any money. I'm leaving some money on the table, but it makes for a much better experience. And I'm fine with that

2

u/Putrid_Resolution402 13d ago

You should consider reducing price based on different countries based on the purchase price parity

2

u/tiaanvdr 13d ago

Which region are you in? I live in South Korea, so I've made sure to do it for South Korea, Japan, and China, since I have a lot of users from those areas as well. I've done it for some other regions as well, but the base currency is set to USD, so I defenitely need to go through and do it for the rest of them as well

2

u/Putrid_Resolution402 13d ago

Look for countries in Middle East and South Asia ❤️

1

u/tiaanvdr 13d ago

I'll do that, thank you for letting me know!

2

u/NukeouT 13d ago

Can you turn off the jellyfish?

Also very cool and not something that can be done on Android atm ¯_(ツ)_/¯

2

u/tiaanvdr 12d ago

You can fully customize which fish are in the tank! There are ~50 to choose from, and I've even added silly ones like frogs, tadpoles, axolotls, and even a submarine, that would still make sense in a "tank".

2

u/zest_01 13d ago

It’s pretty nice and I won’t say it’s overpriced - plenty of free stuff available. However, the animation is slightly laggy on 14PM so I had to delete it.

1

u/tiaanvdr 12d ago

Thank you for giving it a try! Also, fair enough :')! I'm not sure currently if it's possible to get a higher frame rate given Apple's stupid limitations. I have to use the clock hand trick, as it allows for the most flexibility. There is another font trick for doing animations on the widget which can get you up to ~60fps, but you'd basically have to "pre-bake" your animations, so I'm not sure it would work for an app like mine where you can change everything about the tank, its props, and the fish. I'll keep looking into other workarounds, though I'm sure something must be possible!

2

u/thaikickass 12d ago

How do I put the coral on?

1

u/tiaanvdr 12d ago

You can just click the 3 dots at the top of the tank, then go to "Edit this tank," then click "Add props," and you can select the coral from there!

You can also move it around, flip it, and resize it to ensure it looks exactly like you'd want it to in your tank! Let me know if that helps!

2

u/Own-Consideration578 14d ago

So cute! How did you draw the fish?

2

u/TimBitBox 14d ago

Whoa I’ve been looking for exactly this lol can I get a code

2

u/JASEMOOSER 14d ago

I’ve been loving this app and have bought a couple fish packs. Very fun app. Could I have a code please?

2

u/Ok-Affect-7503 14d ago

Can we get the code?

2

u/Fermooooo 14d ago

Can i have a code please?🙏

2

u/Wimmi29 14d ago • Heartwarming

Dieses Widget ist einfach wunderschön 🤩

2

u/influxodoxxl 14d ago

O.M.G. this is just... idk... so nice and lovely and cute! 😻My memory usually is very similar to a goldfish ones but being gifted a code would surely make a deep impression in my old Gray gooey Matter. 🐠🧠

2

u/Kyronsk8 13d ago

I’m trying to get this working for my app as well, are you using an engine inside the widget kit? Or another method; I’m using preset animations, but I’d prefer an engine but haven’t looked into support for that yet.

2

u/theAerialDroneGuy 13d ago

How do you active the clear fish tank while on the default Apple theme mode?

2

u/theAerialDroneGuy 13d ago

Oh nvm. I see you can change the tank glass to clear or frosted.
Clear glass works well when I have my system set to light mode.
Clear glass looks pretty dark when my system is set to dark mode.

2

u/Krishh1997 13d ago

I love aquariums, fish, and your app! I’d really appreciate a promo code. Thank you!

2

u/Horror_Still_3305 13d ago

The fish are laggy on my widget.

2

u/cleedek 13d ago

Love this new iteration + adding utility (calendar/weather display). Also fish and their movement really looks much more natural now.

1

u/madaradess007 13d ago

Dude, this feels like a technical marvel to me!
Please share a basic animated widget demo, i tried making smooth animation inside a widget like 4-5 years ago and remember settled for an animated UILabel text change. (or whatever it is called in SwiftUI, i cant get myself to take SwiftUI seriously)

1

u/Impossible-Suit6078 13d ago

This is impressive, I've always wanted a widget like this, but I never figured out how to make it work. Well done!

1

u/isthisthepolice 7d ago

Super cool but my clear glass one on 16 pro max is laggy on full battery not low power mode?

0

u/[deleted] 13d ago

[deleted] — view deleted comment

1

u/tiaanvdr 13d ago

I haven't spent much time "gamifying" the app yet! I wanted it to be, firstly, easy to use, calm, and not annoying or overly complex

But having fish have hunger, adding growth mechanics, egg laying, breeding, unlocks, etc. could all be super fun! I just want to approach them in a way where they remain optional for those who want it. I'll keep putting some thought into it and working on it! Thank you for the feedback!!