Skip to content

Commit 840e1fc

Browse files
committed
Update Swift sample to Swift 5
1 parent 60627fd commit 840e1fc

17 files changed

+174
-167
lines changed

FirebaseUI.podspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
Pod::Spec.new do |s|
22
s.name = 'FirebaseUI'
3-
s.version = '7.0.0'
3+
s.version = '8.0.0'
44
s.summary = 'UI binding libraries for Firebase.'
55
s.homepage = 'https://github.com/firebase/FirebaseUI-iOS'
66
s.license = { :type => 'Apache 2.0', :file => 'LICENSE' }
7-
s.source = { :git => 'https://github.com/firebase/FirebaseUI-iOS.git', :tag => 'v' + s.version.to_s }
7+
s.source = { :git => 'https://github.com/firebase/FirebaseUI-iOS.git', :tag => 'v'}
88
s.author = 'Firebase'
99
s.platform = :ios
1010
s.ios.deployment_target = '9.0'

samples/swift/FirebaseUI-demo-swift.xcodeproj/project.pbxproj

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@
201201
8DABC9871D3D82D600453807 /* FirebaseUI-demo-swift */,
202202
8DABC99C1D3D82D600453807 /* FirebaseUI-demo-swiftTests */,
203203
8DABC9861D3D82D600453807 /* Products */,
204+
B9817BB8ABCEED12F89E5CF6 /* Pods */,
204205
);
205206
sourceTree = "<group>";
206207
};
@@ -236,6 +237,13 @@
236237
path = "FirebaseUI-demo-swiftTests";
237238
sourceTree = "<group>";
238239
};
240+
B9817BB8ABCEED12F89E5CF6 /* Pods */ = {
241+
isa = PBXGroup;
242+
children = (
243+
);
244+
path = Pods;
245+
sourceTree = "<group>";
246+
};
239247
C302C1D31D91CC7B00ADBD41 /* Samples */ = {
240248
isa = PBXGroup;
241249
children = (
@@ -340,7 +348,7 @@
340348
TargetAttributes = {
341349
8DABC9841D3D82D600453807 = {
342350
CreatedOnToolsVersion = 7.3.1;
343-
LastSwiftMigration = 0800;
351+
LastSwiftMigration = 1020;
344352
SystemCapabilities = {
345353
com.apple.BackgroundModes = {
346354
enabled = 1;
@@ -352,14 +360,14 @@
352360
};
353361
8DABC9981D3D82D600453807 = {
354362
CreatedOnToolsVersion = 7.3.1;
355-
LastSwiftMigration = 0800;
363+
LastSwiftMigration = 1020;
356364
TestTargetID = 8DABC9841D3D82D600453807;
357365
};
358366
};
359367
};
360368
buildConfigurationList = 8DABC9801D3D82D600453807 /* Build configuration list for PBXProject "FirebaseUI-demo-swift" */;
361369
compatibilityVersion = "Xcode 3.2";
362-
developmentRegion = English;
370+
developmentRegion = en;
363371
hasScannedForEncodings = 0;
364372
knownRegions = (
365373
en,
@@ -770,7 +778,7 @@
770778
PRODUCT_NAME = "$(TARGET_NAME)";
771779
SWIFT_OBJC_BRIDGING_HEADER = "";
772780
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
773-
SWIFT_VERSION = 3.0;
781+
SWIFT_VERSION = 5.0;
774782
};
775783
name = Debug;
776784
};
@@ -808,7 +816,7 @@
808816
PRODUCT_BUNDLE_IDENTIFIER = "com.google.firebase.firebaseui.FirebaseUI-demo-swift";
809817
PRODUCT_NAME = "$(TARGET_NAME)";
810818
SWIFT_OBJC_BRIDGING_HEADER = "";
811-
SWIFT_VERSION = 3.0;
819+
SWIFT_VERSION = 5.0;
812820
};
813821
name = Release;
814822
};
@@ -820,7 +828,7 @@
820828
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
821829
PRODUCT_BUNDLE_IDENTIFIER = "com.firebase.FirebaseUI-demo-swiftTests";
822830
PRODUCT_NAME = "$(TARGET_NAME)";
823-
SWIFT_VERSION = 3.0;
831+
SWIFT_VERSION = 5.0;
824832
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/FirebaseUI-demo-swift.app/FirebaseUI-demo-swift";
825833
};
826834
name = Debug;
@@ -833,7 +841,7 @@
833841
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
834842
PRODUCT_BUNDLE_IDENTIFIER = "com.firebase.FirebaseUI-demo-swiftTests";
835843
PRODUCT_NAME = "$(TARGET_NAME)";
836-
SWIFT_VERSION = 3.0;
844+
SWIFT_VERSION = 5.0;
837845
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/FirebaseUI-demo-swift.app/FirebaseUI-demo-swift";
838846
};
839847
name = Release;

samples/swift/FirebaseUI-demo-swift/FUIAppDelegate.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
2424

2525
var window: UIWindow?
2626

27-
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
27+
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
2828
// Successfully running this sample requires an app in Firebase and an
2929
// accompanying valid GoogleService-Info.plist file.
3030
FirebaseApp.configure()
@@ -33,8 +33,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
3333
}
3434

3535
@available(iOS 9.0, *)
36-
func application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any]) -> Bool {
37-
let sourceApplication = options[UIApplicationOpenURLOptionsKey.sourceApplication] as! String?
36+
func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any]) -> Bool {
37+
let sourceApplication = options[UIApplication.OpenURLOptionsKey.sourceApplication] as! String?
3838
return self.handleOpenUrl(url, sourceApplication: sourceApplication)
3939
}
4040

samples/swift/FirebaseUI-demo-swift/Samples/Auth/FUIAuthViewController.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ class FUIAuthViewController: UITableViewController {
9797
override func viewWillAppear(_ animated: Bool) {
9898
super.viewWillAppear(animated)
9999

100-
self.tableView.rowHeight = UITableViewAutomaticDimension;
100+
self.tableView.rowHeight = UITableView.automaticDimension;
101101
self.tableView.estimatedRowHeight = 240;
102102

103103
self.authStateDidChangeHandle =
@@ -116,7 +116,7 @@ class FUIAuthViewController: UITableViewController {
116116
}
117117

118118
override func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
119-
return UITableViewAutomaticDimension
119+
return UITableView.automaticDimension
120120
}
121121

122122
override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {

samples/swift/FirebaseUI-demo-swift/Samples/Auth/FUICustomAuthPickerViewController.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717
import UIKit
1818
import FirebaseUI
1919

20-
@objc(FUICustomAuthPickerViewController)
21-
2220
class FUICustomAuthPickerViewController: FUIAuthPickerViewController {
2321

2422
@IBAction func onClose(_ sender: AnyObject) {

samples/swift/FirebaseUI-demo-swift/Samples/Auth/FUICustomAuthUIDelegate.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@ class FUICustomAuthDelegate: NSObject, FUIAuthDelegate {
6363
return FUICustomPasswordSignUpViewController(nibName: "FUICustomPasswordSignUpViewController",
6464
bundle: Bundle.main,
6565
authUI: authUI,
66-
email: email)
66+
email: email,
67+
requireDisplayName: true)
6768
}
6869

6970
func passwordVerificationViewController(forAuthUI authUI: FUIAuth, email: String, newCredential: AuthCredential) -> FUIPasswordVerificationViewController {

samples/swift/FirebaseUI-demo-swift/Samples/Auth/FUICustomEmailEntryViewController.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717
import UIKit
1818
import FirebaseUI
1919

20-
@objc(FUICustomEmailEntryViewController)
21-
2220
class FUICustomEmailEntryViewController: FUIEmailEntryViewController, UITextFieldDelegate {
2321
@IBOutlet weak var emailTextField: UITextField!
2422
@IBOutlet weak var nextButton: UIBarButtonItem!

samples/swift/FirebaseUI-demo-swift/Samples/Auth/FUICustomPasswordRecoveryViewController.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717
import UIKit
1818
import FirebaseUI
1919

20-
@objc(FUICustomPasswordRecoveryViewController)
21-
2220
class FUICustomPasswordRecoveryViewController: FUIPasswordRecoveryViewController, UITextFieldDelegate {
2321
@IBOutlet weak var emailTextField: UITextField!
2422
@IBOutlet weak var recoverButton: UIBarButtonItem!

samples/swift/FirebaseUI-demo-swift/Samples/Auth/FUICustomPasswordSignInViewController.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717
import UIKit
1818
import FirebaseUI
1919

20-
@objc(FUICustomPasswordSignInViewController)
21-
2220
class FUICustomPasswordSignInViewController: FUIPasswordSignInViewController {
2321
@IBOutlet weak var emailTextField: UITextField!
2422
@IBOutlet weak var passwordTextField: UITextField!

samples/swift/FirebaseUI-demo-swift/Samples/Auth/FUICustomPasswordSignUpViewController.swift

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,19 @@
1717
import UIKit
1818
import FirebaseUI
1919

20-
@objc(FUICustomPasswordSignUpViewController)
21-
2220
class FUICustomPasswordSignUpViewController: FUIPasswordSignUpViewController, UITextFieldDelegate {
2321

2422
@IBOutlet weak var emailTextField: UITextField!
2523
@IBOutlet weak var usernameTextField: UITextField!
2624
@IBOutlet weak var passwordTextField: UITextField!
2725
@IBOutlet weak var nextButton: UIBarButtonItem!
28-
29-
override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?, authUI: FUIAuth, email: String?) {
30-
super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil, authUI: authUI, email: email)
26+
27+
override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?, authUI: FUIAuth, email: String?, requireDisplayName: Bool) {
28+
super.init(nibName: nibNameOrNil,
29+
bundle: nibBundleOrNil,
30+
authUI: authUI,
31+
email: email,
32+
requireDisplayName: requireDisplayName)
3133

3234
emailTextField.text = email
3335
}

0 commit comments

Comments
 (0)