小编Spa*_*ard的帖子

Overlay SwiftUI view over all other views including sheets

I have seen discussion about this that involve UIKit but nothing recent that includes SwiftUI.

I have a Master-Detail style app that calls for two floating buttons that should be visible at all times in the app.

Settings Button: When tapped will un-hide another overlay with some toggles Add Record Button: When tapped will present a sheet via a @State variable, when tapped again will dismiss the sheet.

If I set the buttons as overlays on the NavigationView they get …

ios swift swiftui

10
推荐指数
1
解决办法
3819
查看次数

Passing an ObservableObject model through another ObObject?

I feel like I can sort of understand why what I'm doing isn't working but I'm still trying to wrap my head around Combine and SwiftUI so any help here would be welcome.

Consider this example:

Single view app that stores some strings in UserDefaults, and uses those strings to display some Text labels. There are three buttons, one to update the title, and one each to update the two UserDefaults-stored strings to a random string.

The view is a …

ios swift swiftui combine observableobject

3
推荐指数
1
解决办法
2096
查看次数

标签 统计

ios ×2

swift ×2

swiftui ×2

combine ×1

observableobject ×1