Post

Replies

Boosts

Views

Activity

Allow use of deep links without 'Smart' banner appearing
At present, it is not possible to use deep linking without suffering the Smart banner being injected by Safari on each affected web page. This makes the experience of users choosing to browse an associated website significantly poorer as they have to see a Smart banner at the top of each page. People know there is an app store and an app – they don't need constantly reminding like it is still 2010. Anyone know where a relevant plea can be made to Apple to provide an alternative mechanism here as it damages the ethos of being able to simply use a web browser
Topic: Safari & Web SubTopic: General
1
0
255
1w
isPresented: on the basis of an observed object not being empty?
I am targeting iOS17 and using @Observable. I have an array of items, and I want to present a sheet when the array is greater than zero. My @Observable looks like this: @Observable class BStoreOO { var items: [Int] = [] var showBS: Bool { items.isEmpty } func updateItems(newItems: [Int]) { self.items = newItems } } When this array gets added to, from another view, I would like to present a sheet/popover. Inside my ContentView I have a @State `... that uses that @Observable struct ContentView: View { @State var bStore = BStoreOO() Further down in my View, how should I toggle this view on the basis of the observed array not being empty? I have tried a number of ways. Some error, some don't, but none present the sheet! For example: .popover(isPresented: bStore.showBS) { PopoverContent() } Gives the error "Cannot convert value of type 'Bool' to expected argument type 'Binding'" If I add a State like this: @State private var isShowingBS = false and then add this: .onChange(of: bStore.items) { self.isShowingBS = self.bStore.items.count > 0 } I don't get errors but nothing is presented. What is the correct way to bind the presentation of the sheet to whether the observed items array is empty or not?
6
0
803
Mar ’24