Post

Replies

Boosts

Views

Activity

Reply to How i can call func from another ViewController?
This Code: I mean version ios 14 and up var didDetectOutgoingCall = false func showCallAlert() { guard let url = URL(string: "tel:+36201234567"), UIApplication.shared.canOpenURL(url) else { return } callObserver.setDelegate(self, queue: nil) didDetectOutgoingCall = false UIApplication.shared.open(url, options: [:]) { [weak self] success in if success { DispatchQueue.main.asyncAfter(deadline: .now() + 0.3) { self?.addNotifObserver() } } } } func addNotifObserver() { let selector = #selector(appDidBecomeActive) let notifName = UIApplication.didBecomeActiveNotification NotificationCenter.default.addObserver(self, selector: selector, name: notifName, object: nil) } @objc func appDidBecomeActive() { //if callObserver(_:callChanged:) doesn't get called after a certain time, //the call dialog was not shown - so the Cancel button was pressed DispatchQueue.main.asyncAfter(deadline: .now() + 0.3) { [weak self] in if !(self?.didDetectOutgoingCall ?? true) { print("Cancel button pressed") } } } func callObserver(_ callObserver: CXCallObserver, callChanged call: CXCall) { if call.isOutgoing && !didDetectOutgoingCall { didDetectOutgoingCall = true print("Call button pressed") } } if i can the func showCallAlert() from anther viewcontroller it not detected if print("Cancel button pressed") or print("Call button pressed"), why?
Topic: Programming Languages SubTopic: Swift Tags:
Oct ’22
Reply to function not transfer to vc
DispatchQueue.main.async {             self.transitionToHomeVC()           } not working..
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Jul ’22
Reply to function not transfer to vc
it IOS on console it print: identifier HomeVC homeViewController nil self.view.window nil
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Jul ’22
Reply to function not transfer to vc
whose view is not in the window hierarchy.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Jul ’22
Reply to function not transfer to vc
it for IOS I tried it and it also does not work, It prints me at the console: whose view is not in the hierarchy window. To the third question: Yes I am sure and I too made sure it was HomeVC (And I also took care of capital letters)
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Jul ’22
Reply to How i can call func from another ViewController?
This Code: I mean version ios 14 and up var didDetectOutgoingCall = false func showCallAlert() { guard let url = URL(string: "tel:+36201234567"), UIApplication.shared.canOpenURL(url) else { return } callObserver.setDelegate(self, queue: nil) didDetectOutgoingCall = false UIApplication.shared.open(url, options: [:]) { [weak self] success in if success { DispatchQueue.main.asyncAfter(deadline: .now() + 0.3) { self?.addNotifObserver() } } } } func addNotifObserver() { let selector = #selector(appDidBecomeActive) let notifName = UIApplication.didBecomeActiveNotification NotificationCenter.default.addObserver(self, selector: selector, name: notifName, object: nil) } @objc func appDidBecomeActive() { //if callObserver(_:callChanged:) doesn't get called after a certain time, //the call dialog was not shown - so the Cancel button was pressed DispatchQueue.main.asyncAfter(deadline: .now() + 0.3) { [weak self] in if !(self?.didDetectOutgoingCall ?? true) { print("Cancel button pressed") } } } func callObserver(_ callObserver: CXCallObserver, callChanged call: CXCall) { if call.isOutgoing && !didDetectOutgoingCall { didDetectOutgoingCall = true print("Call button pressed") } } if i can the func showCallAlert() from anther viewcontroller it not detected if print("Cancel button pressed") or print("Call button pressed"), why?
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Oct ’22
Reply to change color background with button
yes this i know but i want the user choose color from author view
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Nov ’22
Reply to how i make List with storyboard?
from left is list (swiftui) and from right is tableview (uikit) how i can make tableview like list (swiftui)?
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Nov ’22
Reply to how i make List with storyboard?
It's not the same
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Nov ’22
Reply to open Location services to my app?
like this: Setting > Privacy & Security > Location Service > My app.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Dec ’22
Reply to open Location services to my app?
Yes I know, but I want to get to the Location settings directly for my app
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Dec ’22
Reply to serach bar not find all words
Thank you very much, but inString.firstRange is available from ios 16
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Dec ’22
Reply to Array Not Updating in ViewModel Despite Subscription
i call to addSubscribers() only in init but if i call it from if newPhase == .active or .onChange(of: vm.searchText) i still not updated the array
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Aug ’23
Reply to Array Not Updating in ViewModel Despite Subscription
When I delete content the array is updated, only when I add to the array it does not work. the savedEntities get the new content, but the historyArray the not updated! even i call updateFilteredContacts() again.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Aug ’23
Reply to Issue with Xcode 16 - Errors When Splitting Code for Widgets
I want to clarify that this issue only occurs in Xcode 16. Everything worked fine in version 15. The problem happens both in my existing project and even if I create a new, completely clean project.
Replies
Boosts
Views
Activity
Sep ’24
Reply to Is a Read-Only GET Request Without User Data Considered ‘No Data Collection’?
I do not perform any POST requests and do not collect or send any user data. The app only performs GET requests to fetch a JSON file that I uploaded to a hosting site for app functionality. Is it correct to select "No, we do not collect data from this app"? I want to be completely sure before submitting.
Replies
Boosts
Views
Activity
Jun ’25