-
Notifications
You must be signed in to change notification settings - Fork 985
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor(template)!: Update app template to Swift & storyboards #1457
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1457 +/- ##
==========================================
- Coverage 78.35% 78.30% -0.06%
==========================================
Files 16 16
Lines 1825 1825
==========================================
- Hits 1430 1429 -1
- Misses 395 396 +1 ☔ View full report in Codecov by Sentry. |
96e7b91
to
6a7084c
Compare
Current feedback is that some plugins are (unsafely!) trying to add category extensions to the template's The correct way for plugins to add behaviour to the app delegate is by extensions of the The same issue probably exists with the view controller class as well. For the sake of compatibility though, I'm looking at wrapping the // AppDelegate.h
#import <Cordova/Cordova.h>
#warning It is unsafe to rely on the AppDelegate class as an extension point. \
Update your code to extend CDVAppDelegate instead -- \
This code will stop working in Cordova iOS 9!
@interface AppDelegate : CDVAppDelegate
@end // AppDelegate.swift
import Cordova;
@objc class AppDelegate : CDVAppDelegate
{
} The downside of this method is that we're stuck with these compatibility hacks for at least one major version. We also have to alias the |
The template's storyboard should handle the initialization of the view controller, rather than constructing it manually here.
Bump min iOS version for template app to 13.0 (due to UISceneDelegate)
6a7084c
to
c0aa1a2
Compare
c0aa1a2
to
0c3aebb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Though the PR is currently in I think it LGTM.Draft
,
I tested:
- Building the Cordova sample app with Xcode 16 Beta 5.
- Building and running against all Apache Cordova default plugins.
- Running on iOS 18 beta 5 Simulator
- Tested against a plugin that uses CocoaPods
When testing a plugin that uses CocoaPods, warning: Stale file
may print out in the build output. These are only warnings and the build still succeeded. These type of warnings are not uncommon and believe to be an issue with Xcode.
To Do
Platforms affected
iOS
Motivation and Context
Closes #674.
Closes #904.
Description
Replace the existing template project with one that uses modern Swift classes, storyboards, and customizes the
CDVViewController
using storyboard properties rather than relying on specifically-named colour variables being globally available.This is one step that should make it easier and much more pleasant for people wanting to embed
CDVViewController
instances within their existing iOS apps.Testing
Built to a simulator.
All existing tests pass.
Checklist