diff --git a/.gitignore b/.gitignore index 94c47c6..330d167 100644 --- a/.gitignore +++ b/.gitignore @@ -88,4 +88,3 @@ fastlane/test_output # https://github.com/johnno1962/injectionforxcode iOSInjectionProject/ -xc.sh diff --git a/EasyCode/Source/BottomSheet/BottomSheetPresentationController.swift b/EasyCode/Source/BottomSheet/BottomSheetPresentationController.swift index 8c5e26c..9221207 100644 --- a/EasyCode/Source/BottomSheet/BottomSheetPresentationController.swift +++ b/EasyCode/Source/BottomSheet/BottomSheetPresentationController.swift @@ -38,7 +38,7 @@ class BottomSheetPresentationController: UIPresentationController { dimmingView.alpha = 0 containerView.addSubview(dimmingView) - presentedView.layer.cornerRadius = 12 + presentedView.layer.cornerRadius = 24 presentedView.layer.masksToBounds = true presentedView.layer.maskedCorners = [.layerMinXMinYCorner, .layerMaxXMinYCorner] diff --git a/EasyCode/Source/DI/DependencyInjector.swift b/EasyCode/Source/DI/DependencyInjector.swift index 68b067e..e78ce23 100644 --- a/EasyCode/Source/DI/DependencyInjector.swift +++ b/EasyCode/Source/DI/DependencyInjector.swift @@ -32,7 +32,6 @@ public class DependencyInjector { guard let dependency = dependencies[key], let typed = dependency as? T else { throw DependencyError.providerNotFound(type: T.self) } - return typed } } @@ -44,8 +43,16 @@ public class DependencyInjector { } } - public func unregister(type: T.Type) { - let key = String(describing: T.self) + public func unregister(_ type: T.Type) { + let baseType: Any.Type + if let optionalMeta = type as? OptionalType.Type { + baseType = optionalMeta.wrappedType + } else { + baseType = type + } + + let key = String(describing: baseType) + queue.async(flags: .barrier) { self.dependencies.removeValue(forKey: key) } diff --git a/EasyCode/Source/JailbreakDetection.swift b/EasyCode/Source/JailbreakDetection.swift index 1340472..96bf863 100644 --- a/EasyCode/Source/JailbreakDetection.swift +++ b/EasyCode/Source/JailbreakDetection.swift @@ -15,6 +15,8 @@ public protocol JailbreakDetectionService { /// A class for detecting jailbroken devices using various checks. public class JailbreakDetection: JailbreakDetectionService { + public init() {} + /// Checks if the device is jailbroken. /// /// - Returns: `true` if the device is jailbroken, `false` otherwise. diff --git a/Package.swift b/Package.swift index 66c8d79..1423395 100644 --- a/Package.swift +++ b/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version: 5.10 +// swift-tools-version: 5.7 // The swift-tools-version declares the minimum version of Swift required to build this package. import PackageDescription @@ -6,17 +6,7 @@ import PackageDescription let package = Package( name: "EasyCode", platforms: [.iOS(.v14)], - products: [ - .library(name: "EasyCode", targets: ["EasyCode"]) - ], - dependencies: [], - targets: [ - .target( - name: "EasyCode", - dependencies: [], - path: "EasyCode/Source" - ), - .testTarget(name: "EasyCodeTests", dependencies: ["EasyCode"]) - ], + products: [.library(name: "EasyCode", targets: ["EasyCode"])], + targets: [.target(name: "EasyCode", path: "EasyCode/Source")], swiftLanguageVersions: [.v5] ) diff --git a/xc.sh b/xc.sh new file mode 100755 index 0000000..b72f272 --- /dev/null +++ b/xc.sh @@ -0,0 +1,50 @@ +#!/bin/bash + +if [ -z "$1" ]; then + echo "Ошибка: Не указана схема для сборки." + exit 1 +fi + +SCHEME="$1" + +echo "📦 Сборка проекта для iOS устройств (arm64)" +xcodebuild build \ + -project "EasyCode.xcodeproj" \ + -scheme "$SCHEME" \ + -sdk iphoneos \ + -configuration Release \ + BUILD_LIBRARY_FOR_DISTRIBUTION=YES || exit 1 + +echo "📦 Сборка проекта для iOS симуляторов (x86_64, arm64)" +xcodebuild build \ + -project "EasyCode.xcodeproj" \ + -scheme "$SCHEME" \ + -sdk iphonesimulator \ + -configuration Release \ + BUILD_LIBRARY_FOR_DISTRIBUTION=YES || exit 1 + +echo "📱 Архивация для iOS устройств" +xcodebuild archive \ + -project "EasyCode.xcodeproj" \ + -scheme "$SCHEME" \ + -archivePath "./build/ios_devices.xcarchive" \ + -sdk iphoneos \ + SKIP_INSTALL=NO \ + BUILD_LIBRARY_FOR_DISTRIBUTION=YES || exit 1 + +echo "🖥 Архивация для iOS симулятора" +xcodebuild archive \ + -project "EasyCode.xcodeproj" \ + -scheme "$SCHEME" \ + -archivePath "./build/ios_simulators.xcarchive" \ + -sdk iphonesimulator \ + SKIP_INSTALL=NO \ + BUILD_LIBRARY_FOR_DISTRIBUTION=YES \ + EXCLUDED_ARCHS=arm64 || exit 1 + +echo "❇ Создание XCFramework" +xcodebuild -create-xcframework \ + -framework "./build/ios_devices.xcarchive/Products/Library/Frameworks/EasyCode.framework" \ + -framework "./build/ios_simulators.xcarchive/Products/Library/Frameworks/EasyCode.framework" \ + -output "EasyCode.xcframework" || exit 1 + echo "✅ XCFramework успешно создан!"