Post

Replies

Boosts

Views

Activity

How do I prevent screenshots using SwiftUI?
Hi Team, How do I prevent screenshots using SwiftUI. I was using this solution on UIKit: extension UIView { func makeSecure() { DispatchQueue.main.async { let protectedView = UIView() self.superview?.addSubview(protectedView) // constraints... let secureView = SecureView() self.superview?.addSubview(secureView) // constraints... secureView.addSecureSubview(self) // constraints... } } } class SecureView: UIView { private lazy var secureField: UIView = { var secureField: UIView = UIView() // ... if let secureContainer = SecureField().secureContainer { secureField = secureContainer } ... return secureField }() required init() { ... } } Is it posible to do the same thing using SwiftUI. Do we have an example? What would you recommend when we work with confidencial information in SwiftUI like bank account information? Thanks in advance!
0
0
264
Dec ’25
I can't see a property on Safari after add an script on WKWebView
After insert this script I can't see the property window.app.isNative = true on Safari, What I'm missing here? Thanks in advance userContentController.addUserScript(WKUserScript(source: """function() { if (!window.app) { window.app = {}; } window.app.isAndroid = false; window.app.isIOS = true; window.app.isNative = true; originWhitelist={['*']} } """, injectionTime: .atDocumentStart, forMainFrameOnly: true))
0
0
1.1k
Mar ’24
How to share image and text on Linkedin or Whassap using UIActivityViewController?
Hi team, using this implementation : @objc func shareImage(_ base64: String, title: String) { if let image = base64.imageFromBase64 { DispatchQueue.main.async { guard let appDelegate = UIApplication.shared.windows.first?.rootViewController else { return } let dataToShare = [title , image] as [Any] let activityViewController = UIActivityViewController(activityItems: dataToShare, applicationActivities: nil) activityViewController.excludedActivityTypes = [UIActivity.ActivityType.airDrop] if let popoverController = activityViewController.popoverPresentationController { popoverController.sourceRect = CGRect(x: UIScreen.main.bounds.width / 2, y: UIScreen.main.bounds.height / 2, width: 0, height: 0) popoverController.sourceView = appDelegate.view popoverController.permittedArrowDirections = UIPopoverArrowDirection(rawValue: 0) } appDelegate.present(activityViewController, animated: true, completion: nil) } } } I only share a text without an image. Should I need to add something on this implementation. I can confirm this implementation can share text and image on Facebook, Instagram, Telegram. Thanks in advance.
1
0
858
Oct ’23
The certificate for this server is invalid
Hi Team, I had this error. What should I check to be sure the certificate is ok. Could you please recommend a block or book or tutorial that help me to understand how the certificate in iOS works. Thanks in advance. <1> HTTP load failed, 0/0 bytes (error code: -1202 [3:-9813]) 2023-06-23 15:45:32.476192-0300 xxxx simu[50709:4219288] Task <05DCEFE2-BFB2-44EC-B2EB-F79D8DCFCF75>.<1> finished with error [-1202] Error Domain=NSURLErrorDomain Code=-1202 "The certificate for this server is invalid. You might be connecting to a server that is pretending to be “xxxx..com.ar” which could put your confidential information at risk." UserInfo={NSLocalizedRecoverySuggestion=Would you like to connect to the server anyway?, _kCFStreamErrorDomainKey=3, NSErrorPeerCertificateChainKey=( "<cert(0x10b165600) s:xxxx..com.ar i: CA NoProd Intermedia xxxx xxxx>", "<cert(0x10b181400) s: CA NoProd Intermedia xxx xxxx i: Root CA xxxx xxxx>", "<cert(0x10b028c00) s: Root CA xxx xxxx i: Root CA xxxx xxxx>" ), NSErrorClientCertificateStateKey=0, NSErrorFailingURLKey=https://hofficetoken.bancogalicia.com.ar/detect/public/registration/mobileServices.htm?code=6TMLTI5S, NSErrorFailingURLStringKey=https://xxxx.***.com.ar/detect/public/registration/mobileServices.htm?code=xxxxx, NSUnderlyingError=0x283d67930 {Error Domain=kCFErrorDomainCFNetwork Code=-1202 "(null)" UserInfo={_kCFStreamPropertySSLClientCertificateState=0, kCFStreamPropertySSLPeerTrust=<SecTrustRef: 0x280376bc0>, _kCFNetworkCFStreamSSLErrorOriginalValue=-9813, _kCFStreamErrorDomainKey=3, _kCFStreamErrorCodeKey=-9813, kCFStreamPropertySSLPeerCertificates=( "<cert(0x10b165600) s: xxxx.***.com.ar i: CA NoProd Intermedia xx xx>", "<cert(0x10b181400) s: CA NoProd Intermedia *** *** i: Root CA *** ***>", "<cert(0x10b028c00) s: Root CA xxxx xxxx i: Root CA xxxx xxxx>"
1
0
1.4k
Jul ’23
What are the steps to load crashlog using LLDB
I'm studying iOS crash analysis. Now, I need to import crashlog files into LLDB. As WWDC18 Session 414 said, I now have a copy of myApp, dSYM, xxx.crash. Run the following command in a folder that I created:$ lldb(lldb) command script import lldb.macosx.crashlog(lldb) crashlog /xxxx.crashHowever, the stack trace file is not available and there is only a lot of error like:error: unable to locate any executables from the crash logDid I use it wrong? What is the correct stepts?Thanks in advance. For any question please just let me know.
1
0
2.3k
Jun ’22
How to change StatusBar color in iOS 15
Hi Team, Im trying to change the statusBar color using override var preferredStatusBarStyle: UIStatusBarStyle {       return .lightContent } and setNeedsStatusBarAppearanceUpdate() but its not working on iOS 15. What I need to do to change the color using swift? Thanks In advance. Guillermo
Topic: UI Frameworks SubTopic: UIKit Tags:
0
0
536
Dec ’21
How do I prevent screenshots using SwiftUI?
Hi Team, How do I prevent screenshots using SwiftUI. I was using this solution on UIKit: extension UIView { func makeSecure() { DispatchQueue.main.async { let protectedView = UIView() self.superview?.addSubview(protectedView) // constraints... let secureView = SecureView() self.superview?.addSubview(secureView) // constraints... secureView.addSecureSubview(self) // constraints... } } } class SecureView: UIView { private lazy var secureField: UIView = { var secureField: UIView = UIView() // ... if let secureContainer = SecureField().secureContainer { secureField = secureContainer } ... return secureField }() required init() { ... } } Is it posible to do the same thing using SwiftUI. Do we have an example? What would you recommend when we work with confidencial information in SwiftUI like bank account information? Thanks in advance!
Replies
0
Boosts
0
Views
264
Activity
Dec ’25
I can't see a property on Safari after add an script on WKWebView
After insert this script I can't see the property window.app.isNative = true on Safari, What I'm missing here? Thanks in advance userContentController.addUserScript(WKUserScript(source: """function() { if (!window.app) { window.app = {}; } window.app.isAndroid = false; window.app.isIOS = true; window.app.isNative = true; originWhitelist={['*']} } """, injectionTime: .atDocumentStart, forMainFrameOnly: true))
Replies
0
Boosts
0
Views
1.1k
Activity
Mar ’24
How to share image and text on Linkedin or Whassap using UIActivityViewController?
Hi team, using this implementation : @objc func shareImage(_ base64: String, title: String) { if let image = base64.imageFromBase64 { DispatchQueue.main.async { guard let appDelegate = UIApplication.shared.windows.first?.rootViewController else { return } let dataToShare = [title , image] as [Any] let activityViewController = UIActivityViewController(activityItems: dataToShare, applicationActivities: nil) activityViewController.excludedActivityTypes = [UIActivity.ActivityType.airDrop] if let popoverController = activityViewController.popoverPresentationController { popoverController.sourceRect = CGRect(x: UIScreen.main.bounds.width / 2, y: UIScreen.main.bounds.height / 2, width: 0, height: 0) popoverController.sourceView = appDelegate.view popoverController.permittedArrowDirections = UIPopoverArrowDirection(rawValue: 0) } appDelegate.present(activityViewController, animated: true, completion: nil) } } } I only share a text without an image. Should I need to add something on this implementation. I can confirm this implementation can share text and image on Facebook, Instagram, Telegram. Thanks in advance.
Replies
1
Boosts
0
Views
858
Activity
Oct ’23
The certificate for this server is invalid
Hi Team, I had this error. What should I check to be sure the certificate is ok. Could you please recommend a block or book or tutorial that help me to understand how the certificate in iOS works. Thanks in advance. <1> HTTP load failed, 0/0 bytes (error code: -1202 [3:-9813]) 2023-06-23 15:45:32.476192-0300 xxxx simu[50709:4219288] Task <05DCEFE2-BFB2-44EC-B2EB-F79D8DCFCF75>.<1> finished with error [-1202] Error Domain=NSURLErrorDomain Code=-1202 "The certificate for this server is invalid. You might be connecting to a server that is pretending to be “xxxx..com.ar” which could put your confidential information at risk." UserInfo={NSLocalizedRecoverySuggestion=Would you like to connect to the server anyway?, _kCFStreamErrorDomainKey=3, NSErrorPeerCertificateChainKey=( "<cert(0x10b165600) s:xxxx..com.ar i: CA NoProd Intermedia xxxx xxxx>", "<cert(0x10b181400) s: CA NoProd Intermedia xxx xxxx i: Root CA xxxx xxxx>", "<cert(0x10b028c00) s: Root CA xxx xxxx i: Root CA xxxx xxxx>" ), NSErrorClientCertificateStateKey=0, NSErrorFailingURLKey=https://hofficetoken.bancogalicia.com.ar/detect/public/registration/mobileServices.htm?code=6TMLTI5S, NSErrorFailingURLStringKey=https://xxxx.***.com.ar/detect/public/registration/mobileServices.htm?code=xxxxx, NSUnderlyingError=0x283d67930 {Error Domain=kCFErrorDomainCFNetwork Code=-1202 "(null)" UserInfo={_kCFStreamPropertySSLClientCertificateState=0, kCFStreamPropertySSLPeerTrust=<SecTrustRef: 0x280376bc0>, _kCFNetworkCFStreamSSLErrorOriginalValue=-9813, _kCFStreamErrorDomainKey=3, _kCFStreamErrorCodeKey=-9813, kCFStreamPropertySSLPeerCertificates=( "<cert(0x10b165600) s: xxxx.***.com.ar i: CA NoProd Intermedia xx xx>", "<cert(0x10b181400) s: CA NoProd Intermedia *** *** i: Root CA *** ***>", "<cert(0x10b028c00) s: Root CA xxxx xxxx i: Root CA xxxx xxxx>"
Replies
1
Boosts
0
Views
1.4k
Activity
Jul ’23
What are the steps to load crashlog using LLDB
I'm studying iOS crash analysis. Now, I need to import crashlog files into LLDB. As WWDC18 Session 414 said, I now have a copy of myApp, dSYM, xxx.crash. Run the following command in a folder that I created:$ lldb(lldb) command script import lldb.macosx.crashlog(lldb) crashlog /xxxx.crashHowever, the stack trace file is not available and there is only a lot of error like:error: unable to locate any executables from the crash logDid I use it wrong? What is the correct stepts?Thanks in advance. For any question please just let me know.
Replies
1
Boosts
0
Views
2.3k
Activity
Jun ’22
How to change StatusBar color in iOS 15
Hi Team, Im trying to change the statusBar color using override var preferredStatusBarStyle: UIStatusBarStyle {       return .lightContent } and setNeedsStatusBarAppearanceUpdate() but its not working on iOS 15. What I need to do to change the color using swift? Thanks In advance. Guillermo
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
0
Boosts
0
Views
536
Activity
Dec ’21