I am working with a watchOS app in SwiftUI, and I am using the following code to dial a phone number from the watch:
var number = "123456789"
if let telURL = URL(string: "tel:\(number)") {
let wkExtension = WKExtension.shared()
wkExtension.openSystemURL(telURL)
}
The issue is that when I try to dial a number starting with a * (asterisk) or # (hash), it doesn't work. When dialing a regular number, it works fine.
Is there any way to get this to work?
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
why the setTorchModeOn not working? it not change the level torch
guard let device = AVCaptureDevice.default(for: .video) else { return }
if device.hasTorch {
do {
try device.lockForConfiguration()
try device.setTorchModeOn(level: 0.1)
if on == true {
device.torchMode = .on
} else {
device.torchMode = .off
}
device.unlockForConfiguration()
} catch {
print("Torch could not be used")
}
} else {
print("Torch is not available")
}
}
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)
Further to the Digital Services Act, I want to change the address and phone number that will be displayed in the app store and I did not find the option in AppStoreConnect, how do I do it?
Topic:
App Store Distribution & Marketing
SubTopic:
App Store Connect
Tags:
Accounts
App Store
App Store Connect
Managed Settings
i have NavigationView in my code
i do this for button it Navigation
Button{
print("")
}label: {
Image(systemName: "list.dash")
.foregroundColor(.gray)
}
}
how i can navigate to another view when user click the button??