Post

Replies

Boosts

Views

Activity

Reply to Background image scales incorrectly when ignoring safe area
I think you may need to fiddle with the centre of the image? It looks like it draws the image from the top left (0, 0), ignoring safe edges, and because the device is taller than it is wide (portrait) more of the image is moved off the right. To put it another way, you're using a square image on a rectangular device. If your image is 1000px wide x 1000px high and your device is 500px wide x 1000px high, and the image is not centred, you'll see the left half of the image. If it helps you align it, I've drawn a cross in the centre so you can see where it currently is.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Nov ’22
Reply to Is updateApplicationContext supposed to trigger didReceiveApplicationContext?
func update(applicationContext: [String: Any]) -> Void { ... } is your own function, right? It's not one of WCSession's methods. From the code above, that method calls updateApplicationContext on the session, so the delegate is receiving a new application context. That's why WCSession's didReceiveApplicationContext is being called. But it doesn't make much sense to do what you're doing. The session on the Watch is supposed to receive a new application context from the iOS app, not from itself.
Topic: App & System Services SubTopic: Hardware Tags:
Nov ’22
Reply to Bug in sed
As you said, gnu-sed handles it correctly, so can't you just use that? brew install gsed echo ø | LANG=en_US.UTF-8 gsed -e 's/^/o/g' Output: oø echo “hi | LANG=en_US.UTF-8 gsed -e s'/^/x/g' Output: x“hi
Topic: App & System Services SubTopic: Core OS Tags:
Nov ’22
Reply to Reload default URL on Home button
Can't you just put the code that loads the initial URL in the viewWillAppear method? It'll go like this: Launch app. App will initially show the Home tab. viewWillAppear is called in the Home tab, and loads the initial URL. User taps a link on that page, goes to a different URL. User taps the second tab. The second tab's URL is loaded, etc. User tips the Home tab again. viewWillAppear is called, and loads the initial URL again.
Topic: Programming Languages SubTopic: Swift Tags:
Nov ’22
Reply to Reload default URL on Home button
You can edit a post if you need to change it within an hour. Anyways, so you need the Home tab to go to the initial URL when the tab is tapped, regardless of whether or not the Home tab is currently selected? So, if the user is on the Home tab and they've navigated away by tapping a link on the page and they tap the tab you want it to go back to the initial URL? This page seems to have a bunch of solutions: https://stackoverflow.com/questions/33837475/detect-when-a-tab-bar-item-is-pressed There's a Swift 5 version about half way down the page.
Topic: Programming Languages SubTopic: Swift Tags:
Nov ’22
Reply to Display of the last LAP
Your lap times are stored in your LapTime struct, and you can easily add it to the screen just below Text("Lap \(lapCount - 1)") using this: Text("Lap \(lapCount - 1)") let lastLapTime: String = self.lapTimes.last?.time ?? "" // Get the last lap time in the array, or "" if it's not available, i.e. you haven't done any laps yet. Text(lastLapTime)
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Dec ’22