https://github.com/workwithafridi/calc-swiftui_calculatorapp
A simple SwiftUI Calculator app designed for beginners to learn the basics of SwiftUI and building user interfaces. The app allows users to perform basic arithmetic calculations like addition, subtraction, multiplication, and division.
https://github.com/workwithafridi/calc-swiftui_calculatorapp
Last synced: about 1 month ago
JSON representation
A simple SwiftUI Calculator app designed for beginners to learn the basics of SwiftUI and building user interfaces. The app allows users to perform basic arithmetic calculations like addition, subtraction, multiplication, and division.
- Host: GitHub
- URL: https://github.com/workwithafridi/calc-swiftui_calculatorapp
- Owner: WorkWithAfridi
- Created: 2023-05-25T12:11:39.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-05-25T12:16:55.000Z (almost 2 years ago)
- Last Synced: 2025-02-13T15:17:27.823Z (3 months ago)
- Language: Swift
- Homepage:
- Size: 10.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Beginner Level SwiftUI Calculator App
CalculatorAppThis is a simple SwiftUI Calculator app designed for beginners to learn the basics of SwiftUI and building user interfaces. The app allows users to perform basic arithmetic calculations like addition, subtraction, multiplication, and division.
Features
Simple and intuitive user interface.
Performs basic arithmetic calculations.
Supports addition, subtraction, multiplication, and division.
Clear button to reset the input and result.
Error handling for division by zero.
Requirements
Xcode 12 or later
iOS 14 or later
Getting Started
To get started with the Calculator app, follow these steps:Clone the repository:
bash
Copy code
git clone https://github.com/WorkWithAfridi/SwiftUI-CalculatorApp.git
Open the project in Xcode.Build and run the app on the iOS simulator or a physical device.
Usage
Once you have the app running, you can use it to perform basic calculations. The user interface consists of buttons for numbers, operators, and a display for the input and result.Tap the number buttons to input numbers.
Tap the operator buttons to perform calculations.
Tap the equal (=) button to get the result.
Tap the clear (AC) button to reset the input and result.
Implementation Details
The Calculator app is implemented using SwiftUI, Apple's modern declarative UI framework. The UI is constructed using SwiftUI's view components, such as Text, Button, and VStack.The calculation logic is implemented using Swift functions and operators. The input and result are stored in @State properties that trigger UI updates when their values change.
Contributing
Contributions are welcome! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request.License
This project is licensed under the MIT License. You can find the license details in the LICENSE file.Acknowledgments
The Calculator app was inspired by the SwiftUI tutorials and documentation provided by Apple.
Contact
If you have any questions or need further assistance, feel free to reach out to me at [email protected]Happy coding! 🚀