Posts

Post not yet marked as solved
0 Replies
925 Views
Hi , I have a problem with observing call status in iPadOS 14. callObserver:callChanged: method not invoked when I initiate a cellular call from iPad ( using url as tel://). But same code working fine in iPhone - iOS 14. My Code , import UIKit import CallKit class ViewController: UIViewController, CXCallObserverDelegate {         private lazy var callObserver = CXCallObserver()     override func viewDidLoad() {         super.viewDidLoad()         configureCallButton()         view.backgroundColor = .gray         self.callObserver.setDelegate(self, queue: nil)         // Do any additional setup after loading the view.     }     func configureCallButton() {         let button = UIButton(type: .system)         button.setTitle("Call", for: .normal)         let attStr = NSMutableAttributedString(string: "Call", attributes: [NSAttributedString.Key.font: UIFont.systemFont(ofSize: 25), NSAttributedString.Key.foregroundColor: UIColor.blue]);         button.setAttributedTitle(attStr, for: .normal)         button.translatesAutoresizingMaskIntoConstraints = false         view.addSubview(button)         button.centerXAnchor.constraint(equalTo: view.centerXAnchor).isActive = true         button.centerYAnchor.constraint(equalTo: view.centerYAnchor).isActive = true         button.addTarget(self, action: #selector(initiateCall), for: .touchUpInside)     }     @objc func initiateCall() {         if let url = URL(string: "tel://*********") {              UIApplication.shared.openURL(url)          }     }     func callObserver(_ callObserver: CXCallObserver, callChanged call: CXCall) {         if call.isOutgoing {             print("Call outgoing")         }         else if call.hasConnected {             print("Call has connected")         }         else if call.hasEnded {             print("Call has ended")         }     } } Note: Observer method invoked for FaceTime calls in iPadOS 14.( using url as facetime:// )
Posted
by r@anjith.
Last updated
.
Post marked as solved
1 Replies
1.7k Views
We check [UIApplication sharedApplication].keyWindow.traitCollection.forceTouchCapability = UIForceTouchCapabilityAvailable to find the 3D touch support. If supported we added shortcut items to the application.But in iPhone XR above check always return false. How to validate whether the device has supported Haptic Touch or not ?
Posted
by r@anjith.
Last updated
.
Post not yet marked as solved
6 Replies
3.2k Views
I used VNDocumentCameraViewController for scanning a document.Whenever open a scanned images and then click the 'Done' button ,application got crashed.Crash log:*** Assertion failure in -[UIApplication _createStatusBarWithRequestedStyle:orientation:hidden:], /BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKitCore/UIKit-3898.7/UIApplication.m:52372019-07-19 18:05:41.369581+0530 Doc-Scan Swift[398:76718] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'App called -statusBar or -statusBarWindow on UIApplication: this code must be changed as there's no longer a status bar or status bar window. Use the statusBarManager object on the window scene instead.'
Posted
by r@anjith.
Last updated
.