|
Hi everyone, happy Friday! I just finished Day 60 and implemented all functions I had planned. I ended up having 1 bug that I cannot fix and 1 functionality that I wish to improve but don't know how to. 1. Bug I added a feature in my UserDetail view where you can click on a user from the friends list to go to that user's UserDetail view. Here's a snippet of that. https://github.com/lululucaschae/iFriend/issues/1#issue-1242694993 The feature works as intended. However, as you can see from the video, sometimes the back button says "Back", whereas sometimes it (correctly) displays the NavigationTitle of the previous view ("June Pollard"). I have absolutely no idea why this is happening! Here's my
2. Improvement idea As you can also see from the video, download happens every time you enter a new Thank you in advance! |
|
The Back button by default shows the title of the previous screen as its label. But if the title of the current screen is too long, the Back button label is shortened to It takes into account both the length of the previous screen's title ( Here's a quick and dirty example I whipped up to demonstrate: |
|
There are several ways to achieve a 'global variable', and this most likely is easiest to do with a Create a swift file with your In your Then for the
in the …app.swift file after the @main and struct <<appname>>: App {
then use it like this
|
SPONSORED Play is the first native iOS design tool created for designers and engineers. You can install Play for iOS and iPad today and sign up to check out the Beta of our macOS app with SwiftUI code export. We're also hiring engineers!
Sponsor Hacking with Swift and reach the world's largest Swift community!
You need to create an account or log in to reply.
All interactions here are governed by our code of conduct.
Link copied to your pasteboard.