help@rskworld.in +91 93305 39277
RSK World
  • Home
  • Development
    • Web Development
    • Mobile Apps
    • Software
    • Games
    • Project
  • Technologies
    • Data Science
    • AI Development
    • Cloud Development
    • Blockchain
    • Cyber Security
    • Dev Tools
    • Testing Tools
  • About
  • Contact

Theme Settings

Color Scheme
Display Options
Font Size
100%
Back to Project
RSK World
swift-ios-calculator
RSK World
swift-ios-calculator
Swift iOS Calculator v1.0 - AI Math Solver + 3D Graphing + Apple Watch Integration + iOS Widgets + Siri Shortcuts + Currency Converter + Scientific Calculator + Matrix Operations + Platform Integration + Modern iOS Development
swift-ios-calculator
  • Assets.xcassets
  • Base.lproj
  • swift-ios-calculator.xcodeproj
  • AIMathSolverViewController.swift26.6 KB
  • AppDelegate.swift1.7 KB
  • CalculatorHistoryViewController.swift6.5 KB
  • CalculatorLogic.swift4.4 KB
  • CalculatorSettingsViewController.swift5.6 KB
  • CalculatorTheme.swift8.3 KB
  • CalculatorUtils.swift6.9 KB
  • CalculatorViewController.swift3.4 KB
  • CalculatorWidget.swift14.3 KB
  • CalculatorWidgetInfo.plist846 B
  • ChemistryCalculatorViewController.swift26.9 KB
  • CurrencyConverterViewController.swift13.3 KB
  • CustomFormulaBuilderViewController.swift22.1 KB
  • EngineeringCalculatorViewController.swift25.7 KB
  • EquationSolverViewController.swift22.8 KB
  • FinancialCalculatorViewController.swift27.5 KB
  • GeometryCalculatorViewController.swift29.7 KB
  • Graphing3DViewController.swift20.8 KB
  • GraphingCalculatorViewController.swift14.7 KB
  • Info.plist3.2 KB
  • LICENSE1.1 KB
  • MainTabBarController.swift22.3 KB
  • MatrixCalculatorViewController.swift26.6 KB
  • PRIVACY_POLICY.md1.6 KB
  • PhysicsCalculatorService.swift8.2 KB
  • ProgrammerCalculatorViewController.swift11 KB
  • README.md8.7 KB
  • RELEASE_NOTES.md6.5 KB
  • SceneDelegate.swift2.8 KB
  • ScientificCalculatorViewController.swift6.2 KB
  • SiriShortcutsManager.swift23.5 KB
  • Swift iOS Calculator.entitlements1.1 KB
  • UnitConverterViewController.swift14 KB
  • WatchCalculatorViewController.swift15.3 KB
  • index.html47.5 KB
CalculatorUtils.swiftPRIVACY_POLICY.md
CalculatorUtils.swift
Raw Download
Find: Go to:
//
//  CalculatorUtils.swift
//  Swift iOS Calculator
//
//  Created by RSK World on 23/01/2026.
//  Copyright © 2026 RSK World. All rights reserved.
//
//  Developer: Molla Samser (Founder, RSK World)
//  Designer & Tester: Rima Khatun
//  Contact: info@rskworld.com, +91 93305 39277
//  Website: https://rskworld.in
//  Address: Nutanhat, Mongolkote, Purba Burdwan, West Bengal, India - 713147
//

import UIKit
import AudioToolbox

// MARK: - Calculator Extensions
extension Double {
    
    /// Formats a double value for display
    func formattedWithDecimalPlaces(_ places: Int) -> String {
        let formatter = NumberFormatter()
        formatter.numberStyle = .decimal
        formatter.maximumFractionDigits = places
        formatter.minimumFractionDigits = 0
        
        if self.truncatingRemainder(dividingBy: 1) == 0 {
            formatter.maximumFractionDigits = 0
        }
        
        return formatter.string(from: NSNumber(value: self)) ?? String(self)
    }
    
    /// Checks if the number is too large for display
    var isTooLarge: Bool {
        return abs(self) > 1e100
    }
    
    /// Checks if the number is effectively zero
    var isEffectivelyZero: Bool {
        return abs(self) < 1e-10
    }
}

// MARK: - Sound and Haptic Feedback
class CalculatorFeedback {
    
    static let shared = CalculatorFeedback()
    
    private var soundEnabled: Bool {
        return UserDefaults.standard.bool(forKey: "SoundEnabled")
    }
    
    private var hapticEnabled: Bool {
        return UserDefaults.standard.bool(forKey: "HapticFeedbackEnabled")
    }
    
    private init() {}
    
    // MARK: - Sound Feedback
    func playButtonTapSound() {
        guard soundEnabled else { return }
        
        AudioServicesPlaySystemSound(1104) // System sound for button tap
    }
    
    func playErrorSound() {
        guard soundEnabled else { return }
        
        AudioServicesPlaySystemSound(1072) // System sound for error
    }
    
    func playCalculationCompleteSound() {
        guard soundEnabled else { return }
        
        AudioServicesPlaySystemSound(1016) // System sound for success
    }
    
    // MARK: - Haptic Feedback
    func buttonTapHaptic() {
        guard hapticEnabled else { return }
        
        let impactFeedback = UIImpactFeedbackGenerator(style: .light)
        impactFeedback.impactOccurred()
    }
    
    func errorHaptic() {
        guard hapticEnabled else { return }
        
        let notificationFeedback = UINotificationFeedbackGenerator()
        notificationFeedback.notificationOccurred(.error)
    }
    
    func successHaptic() {
        guard hapticEnabled else { return }
        
        let notificationFeedback = UINotificationFeedbackGenerator()
        notificationFeedback.notificationOccurred(.success)
    }
}

// MARK: - Animation Helpers
extension UIView {
    
    /// Performs a button press animation
    func animateButtonPress() {
        UIView.animate(withDuration: 0.1, animations: {
            self.transform = CGAffineTransform(scaleX: 0.95, y: 0.95)
        }) { _ in
            UIView.animate(withDuration: 0.1) {
                self.transform = CGAffineTransform.identity
            }
        }
    }
    
    /// Performs a shake animation for errors
    func shake() {
        let animation = CABasicAnimation(keyPath: "position")
        animation.duration = 0.07
        animation.repeatCount = 3
        animation.autoreverses = true
        animation.fromValue = NSValue(cgPoint: CGPoint(x: self.center.x - 10, y: self.center.y))
        animation.toValue = NSValue(cgPoint: CGPoint(x: self.center.x + 10, y: self.center.y))
        
        self.layer.add(animation, forKey: "position")
    }
    
    /// Performs a fade in animation
    func fadeIn(duration: TimeInterval = 0.3) {
        alpha = 0
        UIView.animate(withDuration: duration) {
            self.alpha = 1
        }
    }
    
    /// Performs a fade out animation
    func fadeOut(duration: TimeInterval = 0.3) {
        UIView.animate(withDuration: duration) {
            self.alpha = 0
        }
    }
}

// MARK: - String Extensions
extension String {
    
    /// Validates if string is a valid number
    var isValidNumber: Bool {
        return Double(self) != nil
    }
    
    /// Removes unnecessary decimal points
    var cleanedNumber: String {
        guard let double = Double(self) else { return self }
        
        if double.truncatingRemainder(dividingBy: 1) == 0 {
            return String(Int(double))
        }
        
        return self
    }
    
    /// Truncates string to fit in display
    func truncated(to length: Int) -> String {
        if self.count <= length {
            return self
        }
        
        return String(self.prefix(length - 3)) + "..."
    }
}

// MARK: - Device Orientation Helper
extension UIDevice {
    
    /// Checks if device is in landscape orientation
    var isLandscape: Bool {
        return orientation.isLandscape
    }
    
    /// Checks if device is in portrait orientation
    var isPortrait: Bool {
        return orientation.isPortrait
    }
}

// MARK: - Calculator Constants
struct CalculatorConstants {
    
    // MARK: - Display Limits
    static let maxDisplayLength = 9
    static let maxDecimalPlaces = 8
    static let maxNumberValue: Double = 1e100
    
    // MARK: - Animation Durations
    static let buttonPressDuration: TimeInterval = 0.1
    static let displayUpdateDuration: TimeInterval = 0.2
    static let themeChangeDuration: TimeInterval = 0.3
    
    // MARK: - User Defaults Keys
    static let themeKey = "CalculatorTheme"
    static let soundEnabledKey = "SoundEnabled"
    static let hapticEnabledKey = "HapticFeedbackEnabled"
    static let decimalPlacesKey = "DecimalPlaces"
    static let scientificModeKey = "ScientificModeEnabled"
    static let historyEnabledKey = "HistoryEnabled"
    
    // MARK: - Notification Names
    static let themeChangedNotification = Notification.Name("CalculatorThemeChanged")
    static let settingsChangedNotification = Notification.Name("CalculatorSettingsChanged")
    static let historyUpdatedNotification = Notification.Name("CalculatorHistoryUpdated")
}

// MARK: - Error Types
enum CalculatorError: Error, LocalizedError {
    case divisionByZero
    case invalidInput
    case overflow
    case underflow
    case invalidOperation
    
    var errorDescription: String? {
        switch self {
        case .divisionByZero:
            return "Cannot divide by zero"
        case .invalidInput:
            return "Invalid input"
        case .overflow:
            return "Number too large"
        case .underflow:
            return "Number too small"
        case .invalidOperation:
            return "Invalid operation"
        }
    }
}
238 lines•6.9 KB
swift
PRIVACY_POLICY.md
Raw Download

PRIVACY_POLICY.md

# Privacy Policy

**Swift iOS Calculator**
*Last Updated: January 24, 2026*

## Information We Collect

### No Personal Data Collection
Swift iOS Calculator does not collect, store, or transmit any personal information from users.

### Local Processing Only
- All calculations are performed locally on your device
- No data is sent to external servers
- No internet connection required for core functionality

### Data Stored on Device
- Calculation history (stored locally, can be cleared)
- User preferences and settings (stored locally)
- Theme selections (stored locally)

## Permissions Used

### Camera Access
- **Purpose**: Scan QR codes containing currency exchange rates
- **Usage**: Only when you explicitly use the camera scanning feature
- **Data**: Images are processed locally and not stored

### Face ID / Touch ID
- **Purpose**: Secure your calculation history and settings
- **Usage**: Only when you enable biometric protection
- **Data**: Biometric data is handled by iOS and never accessed by our app

## Data Security

- All calculations are processed locally using device-native APIs
- No analytics or tracking software is included
- No third-party data sharing
- No advertising or data monetization

## Contact Information

For privacy concerns, please contact:
- **Email**: info@rskworld.com
- **Website**: https://rskworld.in
- **Developer**: RSK World

## Changes to This Policy

We may update this privacy policy from time to time. Any changes will be posted in this document.

---

*This privacy policy applies to the Swift iOS Calculator mobile application only.*

About RSK World

Founded by Molla Samser, with Designer & Tester Rima Khatun, RSK World is your one-stop destination for free programming resources, source code, and development tools.

Founder: Molla Samser
Designer & Tester: Rima Khatun

Development

  • Game Development
  • Web Development
  • Mobile Development
  • AI Development
  • Development Tools

Legal

  • Terms & Conditions
  • Privacy Policy
  • Disclaimer

Contact Info

Nutanhat, Mongolkote
Purba Burdwan, West Bengal
India, 713147

+91 93305 39277

hello@rskworld.in
support@rskworld.in

© 2026 RSK World. All rights reserved.

Content used for educational purposes only. View Disclaimer