The Swift Den

TSD

The Swift Den

The Discord server for Swift developers. Get tips and snippets for your projects!

Join

swift-development

javascript

python

rust

c-sharp

Verified Role

tl;dr - To post you need to verify you are a human by getting verified. Open the server menu (see below for photos) You must have GitHub account, Steam account, eBay account, PayPal account or Twitter account with at least 15 tweets to get it. Click on 'The Swift Den' on top of the channel list, then in the menu, click on 'Verified Roles'. Then go to 'Verified'. It will give you the role and guide you through linking accounts....
No description

How do you make an expiration system

I was making an app that has packages in it and I wanted to add an expiration system like but when make it using @AppStorage the timer stops when i access the view with the timer but on the contentView the timer is running, but I don't know how to fix the bug. cant put the code bc its too long...

Google Sign in pod with swiftui and xcode 14 issue

Hello, I am having trouble installing google sign in using cocoapod. any one else having the same issue?

Detected view visible.

I'm trying to detect when a view is first made visible so I can connect to a BLE device and then when it is dismissed it is disconnected. I've tried using onAppear/onDisappear and isPresented but they all have the same problem that when I go through a NavigationLink to a child view, it called onDisappear or sets isPresented to false.

How do you set the text font to the custom font?

How do you set the text font to the custom font bc I was making an app that lets you have some fonts to add in the list and save it.. I already got the info.plist and it has the Fonts provided by application property in the plist.. I added the whole font file name in the Fonts provided by application section But the main question is How do you set the text font to the custom font?

How do you make an Add Button that adds a Text? - Already Answered ✅

How do you make an add button that opens a sheet and there is a TextField that you can set to any text and when you press "Add" it will add the text that you put on the TextField and put it in the list.. I tried searching it up "How to make a button that adds a text in swiftUI" on google but the steps didnt work.....

How do you add spacing in LazyVGrid

How do you add spacing in the LazyVGrid, I tried using Spacer() but it didn't add a space...

How to pass parameter to custom iterator

I'm making a custom iterator that returns every slice of a given width through a collection. I got it working with a hardcoded width but can't figure out how to make it a parameter. I want the hard-coded 3 to be replaced with that param: ```swift extension Array {
func windows() -> AnySequence<ArraySlice<Element>> {...