c.im is one of the many independent Mastodon servers you can use to participate in the fediverse.
C.IM is a general, mainly English-speaking Mastodon instance.

Server stats:

2.9K
active users

#swiftui

83 posts64 participants1 post today

Once again I have stumbled onto something I don’t understand.

In the entry point for my app I set a NavigationContext in the environment, and when I run the app and navigate between views, at some random point, it throws the error in the second image, and the debugger indicates it is on the “struct FooApp: App {“ line.

What is going on? Help!

In the subviews I am accessing the context from the env like so: “@ Environment(NavigationContext.self) var context”.

@swift @swiftui Exciting News! 🎉 Just dropped Part 35 of my "Let's Build Pinterest clone Using SwiftUI and “firebase” playlist! 📺🛠️ Dive deeper into Swift development as we take our app to the next level. 🚀 Check it out now and let's code together! 🔗 youtube.com/watch?v=QSTxmO1sle #swiftui #swift #swiftlang #iosdev #ios18 #iOS

After finishing the interviews I felt really proud about this milestone. I before that moment never did proper research about a problem people actually have and it was extremely interesting to talk to people I didn’t know a lot personally and also people I knew personally for years about such a sensible topic like dealing with overwhelming emotions. But now I faced the enormous task of (1/3)

#IndieDev#iOS#Dev

Friday afternoon #SwiftUI fun.

Trying to print a mapView. The SwiftUI printing methods don't work with views such as Map and Web.

I can create an imageRepresentation of the map that gets everything but the annotation markers. Close but I need the markers.

I can use old AppKit methods like printView() but that only prints the markers.

Can't make this stuff up.

Think I may need to manually composite each marker onto the map image.

I'm thinking that's a next week task.

It can be quite a challenge getting everything to fit into iPad Slide Over mode.

I added a description to the wind chart popover and realized that wasn't going to fly with accessibility sizes.

I clamp down the max size with .dynamicTypeSize() in that scenario but let it be bigger otherwise.

If you want to trigger actions for various gestures in #SwiftUI, I have created a GestureButton that lets you trigger actions for press, release, long press, double tap, repeat, drag, etc. I created it for @keyboardkit.bsky.social but has extracted it to its own thing.
github.com/danielsaidi/Gesture

GestureButton is a SwiftUI button that can handle many different gestures. - danielsaidi/GestureButton
GitHubGitHub - danielsaidi/GestureButton: GestureButton is a SwiftUI button that can handle many different gestures.GestureButton is a SwiftUI button that can handle many different gestures. - danielsaidi/GestureButton

EmojiKit 1.5 is out! 🚀 This is an open-source project that lets you use emoji-based features & views in #Swift and #SwiftUI. This version makes it possible to set a max emoji count for all mutable, persisted categories. It also lets you create custom, persisted categories.
github.com/danielsaidi/EmojiKit

EmojiKit is a Swift SDK that lets you use emojis and other emoji-based features on all major Apple platforms. - danielsaidi/EmojiKit
GitHubGitHub - danielsaidi/EmojiKit: EmojiKit is a Swift SDK that lets you use emojis and other emoji-based features on all major Apple platforms.EmojiKit is a Swift SDK that lets you use emojis and other emoji-based features on all major Apple platforms. - danielsaidi/EmojiKit

New day, other emotion. I‘m always committed to share reality of being a developer. And this is one of the ones that are not great. I did not win the first and only shot I ever had on the Swift Student Challenge. It hurts a lot because I poured everything I had in it. Nights coding, fighting with Sketch or recording yourself for voice overs in a small hotel lobby in Roma. But you know what (1/2)

#IndieDev#iOS#Dev

I'm going to assume this is documented somewhere but…

if you're doing #SwiftUI #MacOSDev with a customizable toolbar you have to be sure any view you pass as the toolbar is not just a standard View Struct.

You must pass a CustomizableToolbarContent Struct.

Also each toolbar item and the toolbar itself must have an id declared.

A standard View will display and work as a toolbar but you will not get the ability to edit the toolbar in any way.

Happy to have this working now.

Continued thread

Compiled Swift and #SwiftUI on Android filling out nicely. Recently added some big surface areas like Path/Shape and Animation APIs. We're getting close to being able to port our first full sample app from transpiled to native Swift!

DeckKit 1.5 is out! 🚀 This is a #SwiftUI SDK that makes it easy to render a list of items as a deck of cards. This new version cleans up the code, lets you handle all item swipe directions with a single action, and makes it possible to customize the state change animation.
github.com/danielsaidi/DeckKit

DeckKit is a SwiftUI SDK that helps you build deck-based apps. - danielsaidi/DeckKit
GitHubGitHub - danielsaidi/DeckKit: DeckKit is a SwiftUI SDK that helps you build deck-based apps.DeckKit is a SwiftUI SDK that helps you build deck-based apps. - danielsaidi/DeckKit