Revert "maint(ios): resolved warnings for Xcode 26"

This reverts commit a91f098ed6.
Apply these changes in a separate PR.
This commit is contained in:
Shawn Schantz 2026-02-23 13:38:01 -05:00
parent a91f098ed6
commit 610ccc11c2
12 changed files with 21 additions and 25 deletions

View file

@ -16,7 +16,7 @@ open class Alerts {
public static func constructActivitySpinner() -> UIActivityIndicatorView {
let activitySpinner: UIActivityIndicatorView
activitySpinner = UIActivityIndicatorView(style: UIActivityIndicatorView.Style.large)
activitySpinner = UIActivityIndicatorView(style: .whiteLarge)
activitySpinner.hidesWhenStopped = true
activitySpinner.translatesAutoresizingMaskIntoConstraints = false
activitySpinner.backgroundColor = Colors.spinnerBackground

View file

@ -195,8 +195,8 @@ public class PackageInstallViewController<Resource: LanguageResource>: UIViewCon
tabView.translatesAutoresizingMaskIntoConstraints = false
self.view.addSubview(tabVC.view)
tabView.topAnchor.constraint(equalTo: view.safeAreaLayoutGuide.topAnchor).isActive = true
tabView.bottomAnchor.constraint(equalTo: view.safeAreaLayoutGuide.bottomAnchor).isActive = true
tabView.topAnchor.constraint(equalTo: topLayoutGuide.bottomAnchor).isActive = true
tabView.bottomAnchor.constraint(equalTo: bottomLayoutGuide.topAnchor).isActive = true
tabView.leftAnchor.constraint(equalTo: view.leftAnchor).isActive = true
tabView.rightAnchor.constraint(equalTo: view.rightAnchor).isActive = true

View file

@ -9,7 +9,7 @@
import WebKit
/// Delegate receiving events from Keyman Web.
protocol KeymanWebDelegate: AnyObject {
protocol KeymanWebDelegate: class {
/// Keyman Web has loaded (or reloaded).
func keyboardLoaded(_ keymanWeb: KeymanWebViewController)

View file

@ -118,14 +118,11 @@ class KeymanWebViewController: UIViewController {
override func loadView() {
let config = WKWebViewConfiguration()
let prefs = WKPreferences()
prefs.javaScriptEnabled = true
config.preferences = prefs
config.suppressesIncrementalRendering = false
config.userContentController = self.userContentController
let webPagePrefs = WKWebpagePreferences.init()
webPagePrefs.allowsContentJavaScript = true
config.defaultWebpagePreferences = webPagePrefs
webView = KeymanWebView(frame: CGRect(origin: .zero, size: keyboardSize), configuration: config)
webView!.isOpaque = false
webView!.translatesAutoresizingMaskIntoConstraints = false
@ -256,7 +253,7 @@ extension KeymanWebViewController {
self.currentText = String(jsonText)
let finalRange = range ?? self.currentCursorRange ?? nil
var finalRange = range ?? self.currentCursorRange ?? nil
self.currentCursorRange = finalRange
//

View file

@ -17,10 +17,10 @@ public enum APIKeyboardFetchError: Error { }
public class APIKeyboardRepository { }
@available(swift, deprecated: 0.1, obsoleted: 0.1, message: "APIKeyboardRepository and associated types have been obsoleted in favor of keyboard search and package-oriented queries.")
public protocol KeyboardRepository: AnyObject { }
public protocol KeyboardRepository: class { }
@available(swift, deprecated: 0.1, obsoleted: 0.1, message: "APIKeyboardRepository and associated types have been obsoleted in favor of keyboard search and package-oriented queries.")
public protocol KeyboardRepositoryDelegate: AnyObject { }
public protocol KeyboardRepositoryDelegate: class { }
@available(swift, deprecated: 0.1, obsoleted: 0.1, message: "APILexicalModelRepository and associated types have been obsoleted by `Queries.LexicalModel` and its `fetch` variants.")
public protocol LexicalModelRepository { }
@ -32,7 +32,7 @@ public enum APILexicalModelFetchError: Error { }
public class APILexicalModelRepository { }
@available(swift, deprecated: 0.1, obsoleted: 0.1, message: "APILexicalModelRepository and associated types have been obsoleted by `Queries.LexicalModel` and its `fetch` variants.")
public protocol LexicalModelRepositoryDelegate: AnyObject { }
public protocol LexicalModelRepositoryDelegate: class { }
@available(swift, deprecated: 0.1, obsoleted: 0.1, message: "This type is no longer utilized by KeymanEngine, as the related API methods have all been obsoleted.")
public struct Options: Codable { }

View file

@ -40,18 +40,17 @@ class PackageWebViewController: UIViewController, WKNavigationDelegate {
override func loadView() {
let config = WKWebViewConfiguration()
let webkitPrefs = WKPreferences()
let prefs = WKPreferences()
prefs.javaScriptEnabled = true
/**
In iPadOS 16 and above WKWebView defaults to lying about its user-agent,
telling the web server that it is a mac. We can avoid this with .mobile:
*/
let webPagePrefs = WKWebpagePreferences.init()
webPagePrefs.preferredContentMode = .mobile
webPagePrefs.allowsContentJavaScript = true
config.defaultWebpagePreferences = webPagePrefs
let pref = WKWebpagePreferences.init()
pref.preferredContentMode = .mobile
config.defaultWebpagePreferences = pref
// Inject a meta viewport tag into the head of the file if it doesn't exist
let metaViewportInjection = """
if(!document.querySelectorAll('meta[name=viewport]').length) {
@ -65,7 +64,7 @@ class PackageWebViewController: UIViewController, WKNavigationDelegate {
let injection = WKUserScript(source: metaViewportInjection, injectionTime: .atDocumentStart, forMainFrameOnly: true)
let controller = WKUserContentController()
controller.addUserScript(injection)
config.preferences = webkitPrefs
config.preferences = prefs
config.userContentController = controller
webView = WKWebView(frame: CGRect.zero, configuration: config)

View file

@ -65,7 +65,7 @@ public class FontManager {
//
// Calls to `cachedFont` after the `.filter` below may be assumed to have
// non-nil return values.
let fontSet = initialFontSet.filter { !(cachedFont(at: $0)?.isRegistered ?? true) }
var fontSet = initialFontSet.filter { !(cachedFont(at: $0)?.isRegistered ?? true) }
// The prior line filters out any entries where cachedFont(at: $0) would be nil.
// Batch-lookups all fonts lacking cache-confirmation of prior registration.

View file

@ -72,7 +72,7 @@ public class ResourceDownloadStatusToolbar: UIToolbar {
* Creates the classic spinning-wheel 'activity in progress' indicator.
*/
private func setupActivityIndicator() -> UIActivityIndicatorView {
let indicatorView = UIActivityIndicatorView(style: UIActivityIndicatorView.Style.medium)
let indicatorView = UIActivityIndicatorView(style: .gray)
indicatorView.center = CGPoint(x: frame.width - indicatorView.frame.width,
y: frame.height * 0.5)
indicatorView.autoresizingMask = [.flexibleLeftMargin, .flexibleTopMargin, .flexibleBottomMargin]

View file

@ -389,7 +389,7 @@ public class InstalledLanguagesViewController: UITableViewController, UIAlertVie
func showActivityView() {
view.isUserInteractionEnabled = false
let indicatorView = UIActivityIndicatorView(style: UIActivityIndicatorView.Style.large)
let indicatorView = UIActivityIndicatorView(style: .whiteLarge)
let activityView = UIView(frame: indicatorView.bounds.insetBy(dx: -10.0, dy: -10.0))
activityView.backgroundColor = Colors.spinnerBackground
activityView.layer.cornerRadius = 6.0

View file

@ -8,7 +8,7 @@
import Foundation
final class KMPKeyboard: Codable, KMPResource {
class KMPKeyboard: Codable, KMPResource {
public var name: String
public var keyboardId: String
public var packageId: String?

View file

@ -8,7 +8,7 @@
import Foundation
final class KMPLexicalModel: Codable, KMPResource {
class KMPLexicalModel: Codable, KMPResource {
public var name: String
public var lexicalModelId: String
public var packageId: String?

View file

@ -781,7 +781,7 @@ class MainViewController: UIViewController, TextViewDelegate, UIActionSheetDeleg
dismissGetStartedView(nil)
overlayWindow.isHidden = false
let activityView = UIActivityIndicatorView(style: UIActivityIndicatorView.Style.large)
let activityView = UIActivityIndicatorView(style: .whiteLarge)
let containerView = UIView(frame: activityView.bounds.insetBy(dx: -10.0, dy: -10.0))
containerView.backgroundColor = Colors.spinnerBackground
containerView.layer.cornerRadius = 6.0