https://github.com/steelcityamir/ios-swift-mandatory-update-check
This repository demonstrates how to implement a mandatory update check in a SwiftUI iOS app.
https://github.com/steelcityamir/ios-swift-mandatory-update-check
app-update force-update ios ios17 mobile-app swift swiftui update-check update-checker xcode
Last synced: 3 months ago
JSON representation
This repository demonstrates how to implement a mandatory update check in a SwiftUI iOS app.
- Host: GitHub
- URL: https://github.com/steelcityamir/ios-swift-mandatory-update-check
- Owner: steelcityamir
- License: mit
- Created: 2025-02-22T18:52:06.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2025-02-22T19:33:16.000Z (3 months ago)
- Last Synced: 2025-02-22T19:33:48.511Z (3 months ago)
- Topics: app-update, force-update, ios, ios17, mobile-app, swift, swiftui, update-check, update-checker, xcode
- Language: Swift
- Homepage:
- Size: 0 Bytes
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# iOS SwiftUI Mandatory Update Check
This repository demonstrates how to implement a mandatory update check in a SwiftUI iOS app. It ensures users are prompted to update their app when their version is below the minimum supported.
## Requirements
- iOS 17 or higher
- SwiftUI
- Xcode 15+## Features
- Checks the minimum supported app version from a remote source
- Displays an alert forcing users to update
- Simple and lightweight SwiftUI implementation## Use Cases
- Ensure all users are on supported version(s)
- Enforce critical updates for bug fixes and security patches
- Improve user experience by preventing outdated app usage📌 Ideal for iOS developers looking to add a force update mechanism to their SwiftUI apps!
## Steps to Run the App
### Clone the repository```sh
git clone https://github.com/steelcityamir/ios-swift-mandatory-update-check.git
cd ios-swift-mandatory-update-check
```### Open the project in Xcode
Double-click the .xcodeproj or .xcworkspace file.
Alternatively, open Xcode and select File > Open, then choose the project folder.### Select a Simulator or Device
In the top menu bar of Xcode, click on the device selector.
Choose an iPhone or iPad simulator, or a connected physical device.### Run the App
1. Click the ▶️ "Run" button in Xcode to launch the app in your selected simulator or device.
2. By default, the app version is set to 1.0.0, which is below the minimum required version (2.0.0). As a result, the Mandatory Update screen will be displayed.3. To bypass the update prompt and access the main view:
- Open Xcode > Project Navigator.
- Locate the app's Info.plist file.
- Update the CFBundleShortVersionString to 2.0.0 or higher.
- Rebuild and relaunch the app.