In my SwiftUI app, I have a data from an array.
While scrolling through the list, the cells are being recycled, which is great.
However, I'm puzzled because it seems that the data isn't being refetched as I scroll, which is contrary to what I expected.
I want to understand why the data isn't being refetched for recycled cells and if this is expected behavior.
class HistoryViewModel: ObservableObject {
@Published var filteredContacts: [HistoryData] = []
func updateFilteredContacts() {
filteredContacts = HistoryCallDataService().savedEntities
if self.searchText.isEmpty {
self.filteredContacts = filteredContacts
} else {
self.filteredContacts = filteredContacts.filter { contact in
contact.firstName?.localizedCaseInsensitiveContains(self.searchText) ?? false ||
contact.lastName?.localizedCaseInsensitiveContains(self.searchText) ?? false ||
contact.telephone?.localizedCaseInsensitiveContains(self.searchText) ?? false
}
}
}
The List:
List{
ForEach(vm.filteredContacts.reversed()) { item in
HStack{
VStack(alignment: .leading){
Text("\(item.firstName ?? "N/A") \(item.lastName ?? "N/A" )")
.fontWeight(.semibold)
Text("\(item.telephone ?? "N/A")")
.fontWeight(.medium)
.padding(.top,1)
}
Spacer()
VStack(alignment: .trailing){
Text("\(item.time ?? "N/A")")
.fontWeight(.medium)
Text("\(item.callHidden ? "Hidden" : "Normally ")")
.foregroundColor(item.callHidden ? Color.theme.red : Color.theme.black)
.fontWeight(.bold)
.padding(.top,1)
}
}
}
}
i attach image:
https://im.ezgif.com/tmp/ezgif-1-db6ebe2a2e.gif
[https://im.ezgif.com/tmp/ezgif-1-db6ebe2a2e.gif)
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
i had setup alert but alertResetSetting not showing, i do know why
but if change the positon
from:
.alert(isPresented: $showingIsResetSetting, content: alertResetSetting)
.alert(isPresented: $showingIsClearAll, content: alertClearAll)
to:
.alert(isPresented: $showingIsClearAll, content: alertClearAll)
.alert(isPresented: $showingIsResetSetting, content: alertResetSetting)
the alertResetSetting will be working but the alertClearAll not... why?
@State private var showingPrefixByCountry = false
@State private var showingIsResetSetting = false
@State private var showingIsClearAll = false
var body: some View {
VStack{
settingList
Spacer()
}
.padding(.top)
.alert(isPresented: $showingIsResetSetting, content: alertResetSetting)
.alert(isPresented: $showingIsClearAll, content: alertClearAll)
.alert("Select Your Country", isPresented: $showingPrefixByCountry) {
showingPrefixByCountryContent()
} message: { Text("Prefix")
.fontWeight(.light)
}
Section("Data") {
Button {
showingIsResetSetting.toggle()
} label: {
Spacer()
Text("Reset Setting")
.fontWeight(.semibold)
Spacer()
}
Button {
showingIsClearAll.toggle()
} label: {
Spacer()
Text("Clear All (Include history calls)")
.foregroundColor(Color.red)
.fontWeight(.bold)
Spacer()
}
}
private func alertResetSetting() -> Alert {
Alert(
title: Text("Are you sure you want to reset settings?"),
message: Text("This action will reset your settings. Without delete you history calls."),
primaryButton: .destructive(
Text("Reset"),
action: {
vm.resetSetting()
}
),
secondaryButton: .cancel(Text("Cancel"))
)
}
private func alertClearAll() -> Alert {
Alert(
title: Text("Are you sure you want to Clear All Data?"),
message: Text("This action will reset you setting and delete all history data"),
primaryButton: .destructive(
Text("Clear All"),
action: {
vm.clearAll()
}
),
secondaryButton: .cancel(Text("Cancel"))
)
}
I'm opening this post because I've encountered a perplexing issue in my application utilizing StoreKit 2 with the Sandbox environment for subscription validation.
My app makes a server call each time it opens to verify if there's an active subscription.
The problem arose after successfully making a purchase in the Sandbox. When I clear history from the Sandbox user and reopen the app, it resends a request to check the subscription, indicating that the user is still subscribed even though the purchases were deleted. Has anyone encountered a similar issue?
if I testing it with transaction manager in Xcode it working well.
`
func updatePurchasedProducts() async {
for await result in Transaction.currentEntitlements {
guard case .verified(let transaction) = result else {
continue
}
if transaction.revocationDate == nil {
self.purchasedProductIDs.insert(transaction.productID)
print("# purchased")
} else {
self.purchasedProductIDs.remove(transaction.productID)
print("# canceled")
}
}
}
Thank you very much!
I’ve been trying to contact Apple Developer Support regarding my developer account. After submitting the required documents related to the Digital Services Act (DSA), I emailed them to ask which additional documents were needed.
However, I’ve been waiting for more than 3 days now without receiving a response. Unfortunately, the only way for me to reach them is via email, as phone support is not available in my country.
This delay is causing significant issues for me, and I need to resolve this as soon as possible.
Are there any alternative methods to contact Apple Developer Support aside from email? I’d appreciate any advice or assistance.
Topic:
Developer Tools & Services
SubTopic:
Apple Developer Program
Tags:
Developer Tools
App Store Connect
Developer Program
I added a feature to my app that retrieves only app settings (no personal data) from my API hosted on Cloudflare Workers. The app does not send, collect, track, or share any user data, and I do not store or process any personal information.
Technical details such as IP address, user agent, and device information may be automatically transmitted as part of the internet protocol when the request is made, but my app does not log or use them. Cloudflare may collect this information.
Question: Does this count as “data collection” for App Store Connect purposes, or can I select “No Data Collected”?