Skip to content

Replace UIWebView, action sheets, and local notifications - #2

Open
putsyk wants to merge 1 commit into
cursor/modernize-code-examples-b3b2from
cursor/wkwebview-notifications-b3b2
Open

Replace UIWebView, action sheets, and local notifications#2
putsyk wants to merge 1 commit into
cursor/modernize-code-examples-b3b2from
cursor/wkwebview-notifications-b3b2

Conversation

@putsyk

@putsyk putsyk commented Aug 12, 2026

Copy link
Copy Markdown
Owner

Follow-up to #1. This PR replaces the remaining deprecated UIKit APIs that could be updated in source without a full Xcode rewrite.

What changed

  • WKWebView: AirPrinter, QReader, and Restorer no longer use UIWebView. QReader storyboards use wkWebView; AirPrinter and Restorer install a WKWebView at runtime if the xib still has a legacy web view.
  • Action sheets: AirPrinter’s print/share menu is a UIAlertController action sheet (with popover anchoring on iPad).
  • RemindMe: Scheduling uses UNUserNotificationCenter instead of UILocalNotification. The project is now ARC. The window uses rootViewController.
  • Collection: Double-tap popovers use UIPopoverPresentationController instead of UIPopoverController.
  • MasterSlide: UIBarButtonItemStyleBorderedUIBarButtonItemStylePlain.

Still left for a Mac

  • Convert remaining MRC projects to ARC (AirPrinter, AlertView, MasterSlide, NibCollection, SyncMe, TCNibLoad, ToDoSync).
  • TaskTimer still uses the old split-view UIPopoverController delegate.
  • TwitterSearch still cannot run (system Twitter accounts and API v1.1 are gone).

This branch is based on #1 so the diff is only these follow-up changes.

Open in Web Open in Cursor 

Switch AirPrinter, QReader, and Restorer from UIWebView to WKWebView, replace AirPrinter's UIActionSheet with UIAlertController, migrate RemindMe to UserNotifications with ARC, and present Collection popovers with UIPopoverPresentationController.

Co-authored-by: Roman Putsykovich <[email protected]>
@putsyk
putsyk marked this pull request as ready for review August 12, 2026 21:42
Copilot AI lite review requested due to automatic review settings August 12, 2026 21:42
@cursor

cursor Bot commented Aug 12, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR modernizes several iOS sample projects by replacing remaining deprecated UIKit APIs (UIWebView, UIActionSheet, UILocalNotification, UIPopoverController) with their current equivalents (WKWebView, UIAlertController, UserNotifications, UIPopoverPresentationController), and updates project/docs accordingly.

Changes:

  • Replaced UIWebView usage with WKWebView (storyboards where possible; runtime replacement when xib still contains a legacy web view) and added WebKit.framework where needed.
  • Replaced AirPrinter action sheets with UIAlertController action sheets and updated related delegate wiring for WKWebView.
  • Migrated RemindMe to UNUserNotificationCenter and enabled ARC; updated READMEs and root index to reflect the new status.

Reviewed changes

Copilot reviewed 21 out of 21 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
Restorer/Restorer/UYLWebViewController.m Switches outlet to WKWebView and installs a WKWebView at runtime when needed.
Restorer/Restorer.xcodeproj/project.pbxproj Links WebKit.framework.
Restorer/README Updates documentation to reflect WKWebView usage and runtime fallback behavior.
RemindMe/RemindMe.xcodeproj/project.pbxproj Links UserNotifications.framework; enables ARC and modules.
RemindMe/README Updates sample description/versioning for UserNotifications + ARC.
RemindMe/main.m Converts to @autoreleasepool for ARC.
RemindMe/Classes/RemindMeViewController.m Replaces UILocalNotification scheduling/clearing with UNUserNotificationCenter requests/triggers.
RemindMe/Classes/RemindMeViewController.h Updates IBOutlet properties to strong for ARC.
RemindMe/Classes/RemindMeAppDelegate.m Requests notification authorization; implements UNUserNotificationCenter delegate callbacks; uses rootViewController.
RemindMe/Classes/RemindMeAppDelegate.h Adopts UNUserNotificationCenterDelegate; updates properties for ARC.
README.md Updates root project index/status notes to match the modernized samples.
QReader/README Updates note to reflect WKWebView usage.
QReader/QReader/UYLWebViewController.m Switches outlet to WKWebView and installs a WKWebView at runtime when needed.
QReader/QReader/Base.lproj/Main_iPhone.storyboard Replaces storyboard web view with wkWebView.
QReader/QReader/Base.lproj/Main_iPad.storyboard Replaces storyboard web view with wkWebView.
QReader/QReader.xcodeproj/project.pbxproj Links WebKit.framework.
MasterSlide/MasterSlide/UYLDetailViewController.m Updates deprecated bar button item style to UIBarButtonItemStylePlain.
Collection/Collection/UYLCollectionViewController.m Replaces UIPopoverController flow with UIPopoverPresentationController.
AirPrinter/AirPrinter/WebViewController.m Migrates to WKWebView + WKNavigationDelegate; replaces UIActionSheet with UIAlertController action sheet.
AirPrinter/AirPrinter/WebViewController.h Updates protocols/imports and web view outlet type for WKWebView.
AirPrinter/AirPrinter.xcodeproj/project.pbxproj Links WebKit.framework.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +109 to +111
case 4:
trigger = [UNCalendarNotificationTrigger triggerWithDateMatchingComponents:[calendar components:(NSCalendarUnitDay | NSCalendarUnitHour | NSCalendarUnitMinute | NSCalendarUnitSecond) fromDate:fireDate] repeats:YES];
break;
Comment on lines 111 to 114
- (void)viewWillDisappear:(BOOL)animated {
[self.webView stopLoading];
self.webView.delegate = nil;
[UIApplication sharedApplication].networkActivityIndicatorVisible = NO;
self.webView.navigationDelegate = nil;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants