Skip to content

Commit 38d23da

Browse files
chore: migrate to swift 5
1 parent d945c2b commit 38d23da

15 files changed

Lines changed: 66 additions & 99 deletions

.github/workflows/ios-build-custom-dev-app.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,12 @@ jobs:
3838
path: ios/Pods
3939
key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }}
4040

41+
- name: bundle install
42+
run: bundle install
43+
working-directory: ./ios
44+
4145
- name: pod install
42-
run: pod install
46+
run: bundle exec pod install
4347
working-directory: ./ios
4448

4549
- name: appcenter prebuilt script test

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v20
1+
24

Gemfile.lock

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,12 @@ PLATFORMS
129129

130130
DEPENDENCIES
131131
activesupport (>= 6.1.7.5, != 7.1.0)
132+
benchmark
133+
bigdecimal
132134
cocoapods (= 1.16.2)
133135
concurrent-ruby (< 1.3.4)
136+
logger
137+
mutex_m
134138
xcodeproj (>= 1.27.0)
135139

136140
RUBY VERSION

ios/AppDelegate.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ class AppDelegate: ReactAppProvider {
66
var shouldOpenInLastApp = false
77
var hasHandledLaunchAppWithOptions = false
88

9-
override func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey : Any]? = nil) -> Bool {
9+
override func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
1010

1111
MendixAppDelegate.application(application, didFinishLaunchingWithOptions: launchOptions)
1212
setupApp(application: application, launchOptions: launchOptions)
@@ -48,7 +48,7 @@ class AppDelegate: ReactAppProvider {
4848
return true
4949
}
5050

51-
override func application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any] = [:]) -> Bool {
51+
override func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool {
5252
return MendixAppDelegate.application(app, openURL: url, options: options)
5353
}
5454

ios/Config/config.release.xcconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
#include "Pods/Target Support Files/Pods-nativeTemplate/Pods-nativeTemplate.release.xcconfig"
2+
#include "Pods/Target Support Files/Pods-nativeTemplate/Pods-nativeTemplate.releasedevapp.xcconfig"
23
#include "config.xcconfig"

ios/Dev/AppDelegate.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ class AppDelegate: ReactAppProvider {
77
var shouldOpenInLastApp = false
88
var hasHandledLaunchAppWithOptions = false
99

10-
override func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey : Any]? = nil) -> Bool {
10+
override func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
1111

1212
MendixAppDelegate.application(application, didFinishLaunchingWithOptions: launchOptions)
1313
setupApp(application: application, launchOptions: launchOptions)
@@ -29,7 +29,7 @@ class AppDelegate: ReactAppProvider {
2929
#endif
3030
}
3131

32-
override func application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any] = [:]) -> Bool {
32+
override func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool {
3333

3434
let handled = MendixAppDelegate.application(app, openURL: url, options: options)
3535

@@ -47,8 +47,8 @@ class AppDelegate: ReactAppProvider {
4747
)
4848

4949
let launchOptions = NSMutableDictionary(dictionary: options)
50-
launchOptions[UIApplicationLaunchOptionsKey.url] = url
51-
launchOptions[UIApplicationOpenURLOptionsKey.annotation] = options[UIApplicationOpenURLOptionsKey.annotation]
50+
launchOptions[UIApplication.LaunchOptionsKey.url] = url
51+
launchOptions[UIApplication.OpenURLOptionsKey.annotation] = options[UIApplication.OpenURLOptionsKey.annotation]
5252

5353
let mxApp = MendixApp.init(
5454
identifier: nil,
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1+
#include "Pods/Target Support Files/Pods-dev/Pods-dev.release.xcconfig"
12
#include "Pods/Target Support Files/Pods-dev/Pods-dev.releasedevapp.xcconfig"
23
#include "config.xcconfig"

ios/Dev/LaunchApp/LaunchAppViewController.swift

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ class LaunchAppViewController: UIViewController, QRViewDelegate {
101101

102102
textField.layer.cornerRadius = 30
103103
if let placeHolderText = textField.placeholder {
104-
textField.attributedPlaceholder = NSAttributedString(string: placeHolderText, attributes: [NSAttributedStringKey.foregroundColor: UIColor.lightGray])
104+
textField.attributedPlaceholder = NSAttributedString(string: placeHolderText, attributes: [NSAttributedString.Key.foregroundColor: UIColor.lightGray])
105105
}
106106
}
107107

@@ -163,22 +163,22 @@ extension LaunchAppViewController {
163163
}
164164

165165
private func registerNotificationObservers() {
166-
NotificationCenter.default.addObserver(self, selector: #selector(keyboardWillShow), name: .UIKeyboardWillShow, object: nil)
167-
NotificationCenter.default.addObserver(self, selector: #selector(keyboardWillHide), name: .UIKeyboardWillHide, object: nil)
168-
NotificationCenter.default.addObserver(self, selector: #selector(deviceRotated), name: .UIDeviceOrientationDidChange, object: nil)
166+
NotificationCenter.default.addObserver(self, selector: #selector(keyboardWillShow), name: UIResponder.keyboardWillShowNotification, object: nil)
167+
NotificationCenter.default.addObserver(self, selector: #selector(keyboardWillHide), name: UIResponder.keyboardWillHideNotification, object: nil)
168+
NotificationCenter.default.addObserver(self, selector: #selector(deviceRotated), name: UIDevice.orientationDidChangeNotification, object: nil)
169169
}
170170

171171
private func unregisterNotificationObservers() {
172-
NotificationCenter.default.removeObserver(self, name: .UIKeyboardWillShow, object: nil)
173-
NotificationCenter.default.removeObserver(self, name: .UIKeyboardWillHide, object: nil)
174-
NotificationCenter.default.removeObserver(self, name: .UIDeviceOrientationDidChange, object: self)
172+
NotificationCenter.default.removeObserver(self, name: UIResponder.keyboardWillShowNotification, object: nil)
173+
NotificationCenter.default.removeObserver(self, name: UIResponder.keyboardWillHideNotification, object: nil)
174+
NotificationCenter.default.removeObserver(self, name: UIDevice.orientationDidChangeNotification, object: nil)
175175
}
176176

177177
@objc func keyboardWillShow(_ notification: Notification) {
178178
keyboardShowTask?.cancel()
179179
keyboardShowTask = DispatchWorkItem {
180-
if let keyboardRect = notification.userInfo?[UIKeyboardFrameEndUserInfoKey] as? CGRect {
181-
let duration = notification.userInfo?[UIKeyboardAnimationDurationUserInfoKey] as? Double
180+
if let keyboardRect = notification.userInfo?[UIResponder.keyboardFrameEndUserInfoKey] as? CGRect {
181+
let duration = notification.userInfo?[UIResponder.keyboardAnimationDurationUserInfoKey] as? Double
182182
self.view.frame.size.height = UIScreen.main.bounds.height - keyboardRect.height
183183
self.qrView.stopScanning()
184184
self.qrView.layer.opacity = 0
@@ -191,7 +191,7 @@ extension LaunchAppViewController {
191191
}
192192

193193
@objc func keyboardWillHide(_ notification: Notification) {
194-
let duration = notification.userInfo?[UIKeyboardAnimationDurationUserInfoKey] as? Double
194+
let duration = notification.userInfo?[UIResponder.keyboardAnimationDurationUserInfoKey] as? Double
195195
view.frame.size.height = UIScreen.main.bounds.height
196196
self.qrView.startScanning()
197197
self.qrView.layer.opacity = 1

ios/Dev/LaunchApp/QRMaskView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class QRMaskView: UIView {
2626
let path = UIBezierPath(roundedRect: userRect!, cornerRadius: 20)
2727
let multiplier = CGFloat(3)
2828
path.append(UIBezierPath(rect: CGRect(x: 0 - self.bounds.width, y: 0 - self.bounds.height, width: self.bounds.width * multiplier, height: self.bounds.height * multiplier)))
29-
mask.fillRule = kCAFillRuleEvenOdd
29+
mask.fillRule = .evenOdd
3030
mask.path = path.cgPath
3131
self.layer.mask = mask
3232
}

ios/Dev/LaunchApp/QRView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import Foundation
22
import AVFoundation
33
import UIKit
44

5-
@objc protocol QRViewDelegate: class {
5+
@objc protocol QRViewDelegate: AnyObject {
66
@objc optional func qrScanningFailed()
77
@objc optional func qrScanningSucceeded(_ str: String?)
88
@objc optional func qrScanningStopped()

0 commit comments

Comments
 (0)