Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 8 additions & 6 deletions Split.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -5285,8 +5285,9 @@
SUPPORTS_MACCATALYST = YES;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_STRICT_MEMORY_SAFETY = NO;
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = "";
SWIFT_VERSION = 6.0;
TVOS_DEPLOYMENT_TARGET = 15.4;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
Expand Down Expand Up @@ -5351,8 +5352,9 @@
SUPPORTS_MACCATALYST = YES;
SWIFT_COMPILATION_MODE = wholemodule;
SWIFT_OPTIMIZATION_LEVEL = "-O";
SWIFT_STRICT_MEMORY_SAFETY = NO;
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = "";
SWIFT_VERSION = 6.0;
TVOS_DEPLOYMENT_TARGET = 15.4;
VALIDATE_PRODUCT = YES;
VERSIONING_SYSTEM = "apple-generic";
Expand Down Expand Up @@ -5397,7 +5399,7 @@
SWIFT_OBJC_BRIDGING_HEADER = "";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 5.0;
SWIFT_VERSION = 6.0;
TARGETED_DEVICE_FAMILY = "1,2,3,6";
TVOS_DEPLOYMENT_TARGET = 12.0;
USER_HEADER_SEARCH_PATHS = "";
Expand Down Expand Up @@ -5440,7 +5442,7 @@
SWIFT_INCLUDE_PATHS = "";
SWIFT_OBJC_BRIDGING_HEADER = "";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 5.0;
SWIFT_VERSION = 6.0;
TARGETED_DEVICE_FAMILY = "1,2,3,4";
TVOS_DEPLOYMENT_TARGET = 12.0;
USER_HEADER_SEARCH_PATHS = "";
Expand Down Expand Up @@ -5471,7 +5473,7 @@
SWIFT_OBJC_BRIDGING_HEADER = "";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 5.0;
SWIFT_VERSION = 6.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
Expand All @@ -5498,7 +5500,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 5.0;
SWIFT_VERSION = 6.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
Expand Down
67 changes: 67 additions & 0 deletions Split.xcodeproj/xcshareddata/xcschemes/SplitSwfit6.xcscheme
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1640"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES"
buildArchitectures = "Automatic">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "3B6DEE5920EA6A4E0067435E"
BuildableName = "Split.framework"
BlueprintName = "Split"
ReferencedContainer = "container:Split.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
shouldAutocreateTestPlan = "YES">
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "3B6DEE5920EA6A4E0067435E"
BuildableName = "Split.framework"
BlueprintName = "Split"
ReferencedContainer = "container:Split.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
2 changes: 1 addition & 1 deletion Split/Api/CertificatePinningConfig.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public typealias CertificatePinningFailureHandler = (String) -> Void

/// Custom error type for certificate pinning errors, conforming to LocalizedError.
@objc
public class CertificatePinningError: NSObject, LocalizedError {
public class CertificatePinningError: NSObject, LocalizedError, @unchecked Sendable {
private let message: String

/// Initializes a new instance of CertificatePinningError with a custom message.
Expand Down
4 changes: 2 additions & 2 deletions Split/Api/DefaultSplitClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import Foundation

typealias DestroyHandler = () -> Void

public final class DefaultSplitClient: NSObject, SplitClient, TelemetrySplitClient {
public final class DefaultSplitClient: NSObject, SplitClient, TelemetrySplitClient, @unchecked Sendable {

private var storageContainer: SplitStorageContainer
private var key: Key
Expand Down Expand Up @@ -309,7 +309,7 @@ extension DefaultSplitClient {
destroy(completion: nil)
}

public func destroy(completion: (() -> Void)?) {
public func destroy(completion: (@Sendable () -> Void)?) {
isClientDestroyed = true
treatmentManager.destroy()
DispatchQueue.global().async { [weak self] in
Expand Down
2 changes: 1 addition & 1 deletion Split/Api/DefaultSplitFactoryBuilder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import Foundation
(Singleton pattern) and reusing it throughout your application.
"""

private static let factoryMonitor: FactoryMonitor = {
nonisolated(unsafe) private static let factoryMonitor: FactoryMonitor = {
return DefaultFactoryMonitor()
}()

Expand Down
2 changes: 1 addition & 1 deletion Split/Api/SplitClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public typealias SplitAction = () -> Void
// MARK: Client lifecycle
func flush()
func destroy()
func destroy(completion: (() -> Void)?)
func destroy(completion: (@Sendable () -> Void)?)

@objc(trackWithTrafficType:eventType:properties:) func track(trafficType: String,
eventType: String,
Expand Down
2 changes: 1 addition & 1 deletion Split/Api/SplitClientManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ protocol SplitClientManager: AnyObject {
var splitFactory: SplitFactory? { get }
}

class DefaultClientManager: SplitClientManager {
final class DefaultClientManager: SplitClientManager, @unchecked Sendable {
private(set) var defaultClient: SplitClient?

private var storageContainer: SplitStorageContainer
Expand Down
2 changes: 1 addition & 1 deletion Split/Api/SplitDatabaseHelper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ struct SplitDatabaseHelper {
GlobalSecureStorage.shared.set(item: keyBytes.base64EncodedString(options: []), for: .dbEncryptionKey(apiKey))
}

static func buildStorageContainer(splitClientConfig: SplitClientConfig,
nonisolated static func buildStorageContainer(splitClientConfig: SplitClientConfig,
apiKey: String,
userKey: String,
databaseName: String,
Expand Down
2 changes: 1 addition & 1 deletion Split/Common/Extensions/Bundle+Finder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ private class BundleFinder {}

extension Foundation.Bundle {
/// Returns the resource bundle associated with the current Swift module.
static var split: Bundle = {
nonisolated(unsafe) static var split: Bundle = {
let bundleName = Bundle.splitBundleName

let candidates = [
Expand Down
2 changes: 1 addition & 1 deletion Split/Common/Extensions/Date+Utils.swift
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ extension Date {
return seconds / 86400
}

private static var formatter: DateFormatter = {
nonisolated(unsafe) private static var formatter: DateFormatter = {
let formatter = DateFormatter()
formatter.dateFormat = "dd-MM-yyyy HH:mm:ss.SSS"
return formatter
Expand Down
2 changes: 1 addition & 1 deletion Split/Common/ServiceConstants.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import Foundation
struct ServiceConstants {

// Created for testing purposes only
static var values: Values?
nonisolated(unsafe) static var values: Values?

static let estimatedImpressionSizeInBytes = 150
// Estimated size of a UniqueKey having a key of 100 chars and
Expand Down
6 changes: 3 additions & 3 deletions Split/Common/Structs/ConcurrentDictionary.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@

import Foundation

class ConcurrentDictionary<K: Hashable, T> {
final class ConcurrentDictionary<K: Hashable & Sendable, T: Sendable>: Sendable {

private var queue: DispatchQueue
private var items: [K: T]
nonisolated(unsafe) private var queue: DispatchQueue
nonisolated(unsafe) private var items: [K: T]

var all: [K: T] {
var allItems: [K: T]?
Expand Down
2 changes: 1 addition & 1 deletion Split/Common/Structs/ConcurrentDictionaryList.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import Foundation

class ConcurrentDictionaryList<K: Hashable, T> {
class ConcurrentDictionaryList<K: Hashable & Sendable, T: Sendable>: @unchecked Sendable {

private var queue = DispatchQueue(label: "split-concurrent-dictionary-list",
attributes: .concurrent)
Expand Down
2 changes: 1 addition & 1 deletion Split/Common/Structs/LRUCache.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import Foundation

class LRUCache<K: Hashable, E> {
final class LRUCache<K: Hashable & Sendable, E: Sendable>: @unchecked Sendable {
/// Elements queue tracks objects usage
/// first element is last used
/// last element is least used
Expand Down
4 changes: 2 additions & 2 deletions Split/Common/Utils/Logger.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import Foundation

struct TimeChecker {

private static var startTime: Int64 = 0
nonisolated(unsafe) private static var startTime: Int64 = 0
private static let tag = "[SPTPRF] "
private static let showTimestamp = true
private static let showSinceMsg = true
Expand Down Expand Up @@ -71,7 +71,7 @@ class Logger {

var level: SplitLogLevel = .none

static let shared: Logger = {
nonisolated(unsafe) static let shared: Logger = {
return Logger()
}()

Expand Down
2 changes: 1 addition & 1 deletion Split/Common/Utils/NotificationsHelper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class DefaultNotificationHelper: NotificationHelper {

#endif

static let instance: DefaultNotificationHelper = {
nonisolated(unsafe) static let instance: DefaultNotificationHelper = {
return DefaultNotificationHelper()
}()

Expand Down
1 change: 0 additions & 1 deletion Split/Common/Utils/Spec.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,5 @@
import Foundation

class Spec {

static var flagsSpec = "1.3"
}
8 changes: 4 additions & 4 deletions Split/Common/Utils/ThreadUtils.swift
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class ThreadUtils {
}
}

protocol CancellableTask {
protocol CancellableTask: Sendable {
typealias Work = () -> Void
var taskId: Int64 { get }
var isCancelled: Bool { get }
Expand All @@ -59,7 +59,7 @@ protocol CancellableTask {
func cancel()
}

class DefaultTask: CancellableTask {
final class DefaultTask: CancellableTask, @unchecked Sendable {

private(set) var taskId: Int64
private(set) var isCancelled = false
Expand Down Expand Up @@ -87,11 +87,11 @@ struct TaskExecutor {
}

extension DispatchQueue {
static var critical: DispatchQueue = {
nonisolated(unsafe) static var critical: DispatchQueue = {
return DispatchQueue(label: "split-critical", qos: .userInteractive, attributes: .concurrent)
}()

static var general: DispatchQueue = {
nonisolated(unsafe) static var general: DispatchQueue = {
return DispatchQueue(label: "split-general", attributes: .concurrent)
}()
}
2 changes: 1 addition & 1 deletion Split/Common/Validators/ValidationConfig.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ struct ValidationConfig {
///
let maxEventPropertiesCount = 300

static var `default`: ValidationConfig = {
static let `default`: ValidationConfig = {
return ValidationConfig()
}()
}
2 changes: 1 addition & 1 deletion Split/Common/Yaml/YAMLParser.swift
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ struct Context {

private typealias Context = Yaml.Context

private var error = Yaml.Context.error
nonisolated(unsafe) private var error = Yaml.Context.error

private typealias ContextValue = (context: Context, value: Yaml)

Expand Down
2 changes: 1 addition & 1 deletion Split/Engine/Splitter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ protocol SplitterProtocol {

class Splitter: SplitterProtocol {

static let shared: Splitter = {
nonisolated(unsafe) static let shared: Splitter = {
let instance = Splitter()
return instance
}()
Expand Down
2 changes: 1 addition & 1 deletion Split/Events/EventsManagerCoordinator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ protocol SplitEventsManagerCoordinator: SplitEventsManager {
func remove(forKey key: Key)
}

class MainSplitEventsManager: SplitEventsManagerCoordinator {
class MainSplitEventsManager: SplitEventsManagerCoordinator, @unchecked Sendable {
private var defaultManager: SplitEventsManager?
private var managers = [Key: SplitEventsManager]()
private var triggered = Set<SplitInternalEvent>()
Expand Down
2 changes: 1 addition & 1 deletion Split/Events/SplitEvent.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import Foundation

@objc public enum SplitEvent: Int {
@objc public enum SplitEvent: Int, Sendable {
case sdkReady
case sdkReadyTimedOut
case sdkReadyFromCache
Expand Down
2 changes: 1 addition & 1 deletion Split/Events/SplitEventActionTask.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import Foundation

class SplitEventActionTask: SplitEventTask {
class SplitEventActionTask: SplitEventTask, @unchecked Sendable {

private var eventHandler: SplitAction?
private var queue: DispatchQueue?
Expand Down
2 changes: 1 addition & 1 deletion Split/Events/SplitEventTask.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import Foundation

protocol SplitEventTask {
protocol SplitEventTask: Sendable {
var event: SplitEvent { get }
var runInBackground: Bool { get }
func takeQueue() -> DispatchQueue?
Expand Down
Loading
Loading