Post

Replies

Boosts

Views

Activity

Reply to NSPathControl in SwiftUI?
As far as i know In SwiftUI, there isn't a direct equivalent to NSPathControl from AppKit. However, you can use NSPathControl within a SwiftUI app by leveraging NSViewRepresentable, which allows you to integrate an AppKit view into a SwiftUI view hierarchy. Thanks Sairam Agireeshetti
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jul ’24
Reply to How to open Calendar app event's detail by its ID
To open the Apple Calendar app's event detail view programmatically, you can use the EventKit framework. In my investigation observed there isn't a direct URL scheme to open a specific event in the Calendar app. Instead, you can open the Calendar app and focus on the date of the event. let eventStore = EKEventStore() eventStore.requestAccess(to: .event) { (granted, error) in if granted { let event = eventStore.event(withIdentifier: "your_event_identifier") if let event = event { DispatchQueue.main.async { let eventViewController = EKEventViewController() eventViewController.event = event eventViewController.allowsEditing = true eventViewController.allowsCalendarPreview = true if let viewController = UIApplication.shared.keyWindow?.rootViewController { let navigationController = UINavigationController(rootViewController: eventViewController) viewController.present(navigationController, animated: true, completion: nil) } } } else { print("not found") } } else { print("denied") } } Make sure you have the correct event identifier. This identifier is unique for each event and can be retrieved when you create or list events. Remember to add the necessary keys to your app's Info.plist to request calendar access. username- Sairam Agireeshetti
Topic: App & System Services SubTopic: General Tags:
Jul ’24
Reply to Load a URL (Excluding Header and Footer)
To exclude the header and footer of a website from displaying within a WKWebView, you can manipulate the loaded web content using JavaScript injection. Here's an example of how you can achieve this: import UIKit import WebKit class ViewController: UIViewController, WKNavigationDelegate { var webView: WKWebView! override func viewDidLoad() { super.viewDidLoad() webView = WKWebView(frame: view.bounds) webView.navigationDelegate = self view.addSubview(webView) let url = URL(string: "https://sairam.com") let request = URLRequest(url: url!) webView.load(request) } func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) { // Inject JavaScript to hide the header and footer let script = """ var header = document.querySelector("header"); // Replace "header" with the appropriate selector for your website's header var footer = document.querySelector("footer"); // Replace "footer" with the appropriate selector for your website's footer if (header) { header.style.display = "none"; } if (footer) { footer.style.display = "none"; } """ webView.evaluateJavaScript(script, completionHandler: nil) } } change it according to your code. Here, JavaScript is injected to hide the header and footer elements using the with appropriate CSS selector.Also identify the appropriate selectors for the header and footer elements you can inspect the web page's source code or use browser developer tools. username : Sairam Agireeshetti
Topic: Safari & Web SubTopic: General
Jul ’24
Reply to Scan multiple 1 D barcodes
I am also facing same issue, Is there any solution found to scan multiple 1-D barcodes results at once ? I found a way by using visionKit but it supports only from iOS 16 with Apple Neural Engine (ANE) supported devices(This solution not suitable for older devices with IOS 16 +).
Topic: Media Technologies SubTopic: Audio Tags:
May ’23
Reply to WKWebView adding cookie does not work with iOS 18 beta
Ty, It works. By changing the document.cookie = xx=${xx}; path=/; expires=weekday, xx jan xxxx xx:xx:xx GMT; Domain=example.com; Secure; SameSite=None ;.
Topic: Safari & Web SubTopic: General Tags:
Replies
Boosts
Views
Activity
Oct ’24
Reply to WKWebView adding cookie does not work with iOS 18 beta
Is there any solution yet for this issue, i am facing issue in iOS 18. Tried 18.1 beta still same issue (17 works fine). If any solution could some one provide the solution here ? ty
Topic: Safari & Web SubTopic: General Tags:
Replies
Boosts
Views
Activity
Oct ’24
Reply to Cookies problem in iOS beta 18
tried with iOS 18.1 beta version. But seeing failures of my WebView to load. Any update or fix found for this issue ?
Topic: Safari & Web SubTopic: General Tags:
Replies
Boosts
Views
Activity
Oct ’24
Reply to Cookies problem in iOS beta 18
Any update or fix found for this issue ?
Topic: Safari & Web SubTopic: General Tags:
Replies
Boosts
Views
Activity
Oct ’24
Reply to Load a URL (Excluding Header and Footer)
Thank you for the update. Regards Sai ram Agireeshetti
Topic: Safari & Web SubTopic: General
Replies
Boosts
Views
Activity
Jul ’24
Reply to Cannot connect to local network devices via TCP when the application is not in the Applications folder
Yes, it same for me also with macOS and network connections, especially when dealing with Sequoia's sandboxing and security requirements. The restriction you mentioned can be quite inconvenient for debugging purposes. Thanks Sairam Agireeshetti
Replies
Boosts
Views
Activity
Jul ’24
Reply to NSPathControl in SwiftUI?
As far as i know In SwiftUI, there isn't a direct equivalent to NSPathControl from AppKit. However, you can use NSPathControl within a SwiftUI app by leveraging NSViewRepresentable, which allows you to integrate an AppKit view into a SwiftUI view hierarchy. Thanks Sairam Agireeshetti
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jul ’24
Reply to How to open Calendar app event's detail by its ID
To open the Apple Calendar app's event detail view programmatically, you can use the EventKit framework. In my investigation observed there isn't a direct URL scheme to open a specific event in the Calendar app. Instead, you can open the Calendar app and focus on the date of the event. let eventStore = EKEventStore() eventStore.requestAccess(to: .event) { (granted, error) in if granted { let event = eventStore.event(withIdentifier: "your_event_identifier") if let event = event { DispatchQueue.main.async { let eventViewController = EKEventViewController() eventViewController.event = event eventViewController.allowsEditing = true eventViewController.allowsCalendarPreview = true if let viewController = UIApplication.shared.keyWindow?.rootViewController { let navigationController = UINavigationController(rootViewController: eventViewController) viewController.present(navigationController, animated: true, completion: nil) } } } else { print("not found") } } else { print("denied") } } Make sure you have the correct event identifier. This identifier is unique for each event and can be retrieved when you create or list events. Remember to add the necessary keys to your app's Info.plist to request calendar access. username- Sairam Agireeshetti
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Jul ’24
Reply to Load a URL (Excluding Header and Footer)
To exclude the header and footer of a website from displaying within a WKWebView, you can manipulate the loaded web content using JavaScript injection. Here's an example of how you can achieve this: import UIKit import WebKit class ViewController: UIViewController, WKNavigationDelegate { var webView: WKWebView! override func viewDidLoad() { super.viewDidLoad() webView = WKWebView(frame: view.bounds) webView.navigationDelegate = self view.addSubview(webView) let url = URL(string: "https://sairam.com") let request = URLRequest(url: url!) webView.load(request) } func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) { // Inject JavaScript to hide the header and footer let script = """ var header = document.querySelector("header"); // Replace "header" with the appropriate selector for your website's header var footer = document.querySelector("footer"); // Replace "footer" with the appropriate selector for your website's footer if (header) { header.style.display = "none"; } if (footer) { footer.style.display = "none"; } """ webView.evaluateJavaScript(script, completionHandler: nil) } } change it according to your code. Here, JavaScript is injected to hide the header and footer elements using the with appropriate CSS selector.Also identify the appropriate selectors for the header and footer elements you can inspect the web page's source code or use browser developer tools. username : Sairam Agireeshetti
Topic: Safari & Web SubTopic: General
Replies
Boosts
Views
Activity
Jul ’24
Reply to Scan multiple 1 D barcodes
I am also facing same issue, Is there any solution found to scan multiple 1-D barcodes results at once ? I found a way by using visionKit but it supports only from iOS 16 with Apple Neural Engine (ANE) supported devices(This solution not suitable for older devices with IOS 16 +).
Topic: Media Technologies SubTopic: Audio Tags:
Replies
Boosts
Views
Activity
May ’23