Try iOS Sample App
Stay organized with collections
Save and categorize content based on your preferences.
Use our iOS and macOS sample app to see how Sign-In works, or
add Sign-In to your existing app.
This sample shows how to integrate Sign-In in Swift for iOS and
macOS.
For Objective-C, see the
SignInSample sample app in the Google Sign-In for iOS
repository.
To use this sample, make sure you have a current version of
Xcode installed.
Get the project
The DaysUntilBirthday Swift sample app is available in the Sign-In
repository using
CocoaPods and
Swift Package Manager.
Follow the instructions for your preferred option below to download and run the sample app:
CocoaPods
-
If you don't already have CocoaPods installed, follow the steps in
the
CocoaPods Getting Started guide.
-
Clone the Google Sign-In for iOS repository:
git clone https://github.com/google/GoogleSignIn-iOS
-
Navigate to the
DaysUntilBirthday
directory:
cd GoogleSignIn-iOS/Samples/Swift/DaysUntilBirthday
-
Install the Cocoapods dependencies:
pod install
-
Open the
DaysUntilBirthdayForPod
workspace in Xcode:
open DaysUntilBirthdayForPod.xcworkspace
Swift Package Manager
-
Clone the Sign-In for iOS repository:
git clone https://github.com/google/GoogleSignIn-iOS
-
Open the Swift sample project:
open GoogleSignIn-iOS/Samples/Swift/DaysUntilBirthday/DaysUntilBirthday.xcodeproj
Swift Package Manager will automatically add the dependencies when
Xcode opens the project.
Run the application
For iOS, select the DaysUntilBirthday (iOS)
target, then start the
sample application on a device or in the iOS simulator by clicking the run
button for the workspace.
For macOS, select the DaysUntilBirthday (macOS)
target, then start
the sample application by clicking the run button for the workspace.
Next steps
Did you have a good experience? Run into trouble?
Let us know!
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-08-28 UTC.
[null,null,["Last updated 2025-08-28 UTC."],[[["\u003cp\u003eThis page provides a Swift sample app, \u003cem\u003eDaysUntilBirthday\u003c/em\u003e, demonstrating Google Sign-In for iOS and macOS.\u003c/p\u003e\n"],["\u003cp\u003eYou can download and run the sample using either CocoaPods or Swift Package Manager.\u003c/p\u003e\n"],["\u003cp\u003eDetailed instructions are included for cloning the repository, installing dependencies, and running the application.\u003c/p\u003e\n"],["\u003cp\u003eObjective-C users can find a corresponding sample app (\u003cem\u003eSignInSample\u003c/em\u003e) in the GitHub repository.\u003c/p\u003e\n"],["\u003cp\u003eTo integrate Sign-In into your own app, refer to the provided implementation guide or explore the complete sample code on GitHub.\u003c/p\u003e\n"]]],[],null,["# Try iOS Sample App\n\nUse our iOS and macOS sample app to see how Sign-In works, or\n[add Sign-In to your existing app](/identity/sign-in/ios/start-integrating).\n\n\nThis sample shows how to integrate Sign-In in Swift for iOS and\nmacOS.\n\n\nFor Objective-C, see the\n[*SignInSample* sample app in the Google Sign-In for iOS\nrepository](https://github.com/google/GoogleSignIn-iOS/tree/main/Samples/ObjC/SignInSample).\n\n\nTo use this sample, make sure you have a current version of\n[Xcode](//developer.apple.com/xcode/) installed.\n\nGet the project\n---------------\n\n\nThe *DaysUntilBirthday* Swift sample app is available in the Sign-In\nrepository using\n[CocoaPods](https://cocoapods.org/) and\n[Swift Package Manager](https://www.swift.org/package-manager/).\nFollow the instructions for your preferred option below to download and run the sample app:\n\n### CocoaPods\n\n1. If you don't already have CocoaPods installed, follow the steps in the [CocoaPods Getting Started](https://guides.cocoapods.org/using/getting-started.html) guide.\n2. Clone the Google Sign-In for iOS repository: \n\n ```\n git clone https://github.com/google/GoogleSignIn-iOS\n ```\n3. Navigate to the `DaysUntilBirthday` directory: \n\n ```\n cd GoogleSignIn-iOS/Samples/Swift/DaysUntilBirthday\n ```\n4. Install the Cocoapods dependencies: \n\n ```\n pod install\n ```\n5. Open the `DaysUntilBirthdayForPod` workspace in Xcode: \n\n ```\n open DaysUntilBirthdayForPod.xcworkspace\n ```\n\n### Swift Package Manager\n\n1. Clone the Sign-In for iOS repository: \n\n ```\n git clone https://github.com/google/GoogleSignIn-iOS\n ```\n2. Open the Swift sample project: \n\n ```\n open GoogleSignIn-iOS/Samples/Swift/DaysUntilBirthday/DaysUntilBirthday.xcodeproj\n ```\n\n\nSwift Package Manager will automatically add the dependencies when\nXcode opens the project.\n\nRun the application\n-------------------\n\n\nFor iOS, select the `DaysUntilBirthday (iOS)` target, then start the\nsample application on a device or in the iOS simulator by clicking the run\nbutton for the workspace.\n\n\nFor macOS, select the `DaysUntilBirthday (macOS)` target, then start\nthe sample application by clicking the run button for the workspace.\n\nNext steps\n----------\n\n\nIf you want to see how you can implement Google Sign-In in your own\napp, take a look at our implementation guide. Or, take a look at the\ncomplete sample on GitHub.\n\n\n[Add Sign-In to your app](/identity/sign-in/ios/start-integrating)\n[See the sample apps on GitHub](https://github.com/google/GoogleSignIn-iOS/tree/main/Samples)\n\nDid you have a good experience? Run into trouble?\n[Let us know!]()"]]