Skip to content

Commit

Permalink
Removes specific migration work which focused on Push, but instead ma…
Browse files Browse the repository at this point in the history
…kes the entire public interface more idiomatic for Swift
  • Loading branch information
umair-ably committed Aug 5, 2024
1 parent f330227 commit 5708d9a
Show file tree
Hide file tree
Showing 89 changed files with 2,650 additions and 2,576 deletions.
24 changes: 0 additions & 24 deletions Ably.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -281,9 +281,6 @@
56190954238C3D3200A862A6 /* CryptoTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 56190953238C3D3200A862A6 /* CryptoTest.m */; };
56190955238C3D3200A862A6 /* CryptoTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 56190953238C3D3200A862A6 /* CryptoTest.m */; };
56190956238C3D3200A862A6 /* CryptoTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 56190953238C3D3200A862A6 /* CryptoTest.m */; };
8099DE8F2BF18E360071AB2A /* PlaceholderSwift.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8099DE8E2BF18E360071AB2A /* PlaceholderSwift.swift */; };
8099DE902BF18E360071AB2A /* PlaceholderSwift.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8099DE8E2BF18E360071AB2A /* PlaceholderSwift.swift */; };
8099DE912BF18E360071AB2A /* PlaceholderSwift.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8099DE8E2BF18E360071AB2A /* PlaceholderSwift.swift */; };
80E519C72BBCBE21006545B4 /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = 80E519C62BBCBE20006545B4 /* PrivacyInfo.xcprivacy */; };
80E519C82BBCBE21006545B4 /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = 80E519C62BBCBE20006545B4 /* PrivacyInfo.xcprivacy */; };
80E519C92BBCBE21006545B4 /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = 80E519C62BBCBE20006545B4 /* PrivacyInfo.xcprivacy */; };
Expand Down Expand Up @@ -1231,7 +1228,6 @@
21FD9F262A015BE400216482 /* Test.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Test.swift; sourceTree = "<group>"; };
560579D824AF1BA900A4D03D /* ARTDefaultTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ARTDefaultTests.swift; sourceTree = "<group>"; };
56190953238C3D3200A862A6 /* CryptoTest.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CryptoTest.m; sourceTree = "<group>"; };
8099DE8E2BF18E360071AB2A /* PlaceholderSwift.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlaceholderSwift.swift; sourceTree = "<group>"; };
80E519C62BBCBE20006545B4 /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = PrivacyInfo.xcprivacy; sourceTree = "<group>"; };
841134772722205400CFA837 /* ARTArchiveTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ARTArchiveTests.m; sourceTree = "<group>"; };
8412FDE12661AC37001FE9E6 /* AblyDeltaCodec.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = AblyDeltaCodec.xcframework; path = Carthage/Build/AblyDeltaCodec.xcframework; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1750,14 +1746,6 @@
path = "Test Utilities";
sourceTree = "<group>";
};
8099DE8D2BF18E130071AB2A /* PushSwift */ = {
isa = PBXGroup;
children = (
8099DE8E2BF18E360071AB2A /* PlaceholderSwift.swift */,
);
path = PushSwift;
sourceTree = "<group>";
};
856AAC8B1B6E304B00B07119 /* Test */ = {
isa = PBXGroup;
children = (
Expand All @@ -1783,7 +1771,6 @@
D5A22170266F3CB700C87C42 /* Package.swift */,
D75B85F921BAF8F900FD8DD2 /* Ably.xcconfig */,
D7EE14F51F07964500C178D5 /* Version.xcconfig */,
8099DE8D2BF18E130071AB2A /* PushSwift */,
96BF61331A35B2AB004CF2B3 /* Source */,
217D17EE25421FC100DFF07E /* SocketRocket */,
856AAC8B1B6E304B00B07119 /* Test */,
Expand Down Expand Up @@ -3170,7 +3157,6 @@
961343D91A42E0B7006DC822 /* ARTClientOptions.m in Sources */,
96BF615F1A35C1C8004CF2B3 /* ARTTypes.m in Sources */,
217D1838254222F600DFF07E /* NSRunLoop+ARTSRWebSocket.m in Sources */,
8099DE8F2BF18E360071AB2A /* PlaceholderSwift.swift in Sources */,
D7D8F82E1BC2C706009718F2 /* ARTTokenParams.m in Sources */,
D746AE411BBC5B14003ECEF8 /* ARTEventEmitter.m in Sources */,
2104EFA82A4CC30C00CC1184 /* ARTAttachRetryState.m in Sources */,
Expand Down Expand Up @@ -3411,7 +3397,6 @@
D710D55E21949C97008F54AD /* ARTPushActivationStateMachine.m in Sources */,
D710D49C21949ACA008F54AD /* ARTNSMutableRequest+ARTRest.m in Sources */,
217D184F254222F700DFF07E /* NSRunLoop+ARTSRWebSocket.m in Sources */,
8099DE902BF18E360071AB2A /* PlaceholderSwift.swift in Sources */,
D710D66C21949E78008F54AD /* ARTMsgPackEncoder.m in Sources */,
D710D48621949A5B008F54AD /* ARTDefault.m in Sources */,
2104EFA92A4CC30C00CC1184 /* ARTAttachRetryState.m in Sources */,
Expand Down Expand Up @@ -3536,7 +3521,6 @@
D710D56421949C98008F54AD /* ARTPushActivationStateMachine.m in Sources */,
D710D4A621949ACB008F54AD /* ARTNSMutableRequest+ARTRest.m in Sources */,
217D1866254222FA00DFF07E /* NSRunLoop+ARTSRWebSocket.m in Sources */,
8099DE912BF18E360071AB2A /* PlaceholderSwift.swift in Sources */,
D710D65221949E77008F54AD /* ARTMsgPackEncoder.m in Sources */,
D710D48821949A5C008F54AD /* ARTDefault.m in Sources */,
2104EFAA2A4CC30C00CC1184 /* ARTAttachRetryState.m in Sources */,
Expand Down Expand Up @@ -3667,7 +3651,6 @@
856AAC931B6E304B00B07119 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
CLANG_ENABLE_MODULES = YES;
DEBUG_INFORMATION_FORMAT = dwarf;
DYLIB_COMPATIBILITY_VERSION = 1;
Expand Down Expand Up @@ -3696,7 +3679,6 @@
856AAC941B6E304B00B07119 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
CLANG_ENABLE_MODULES = YES;
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
Expand Down Expand Up @@ -3935,7 +3917,6 @@
D7093C13219E2DB200723F17 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
Expand Down Expand Up @@ -3972,7 +3953,6 @@
D7093C14219E2DB200723F17 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
Expand Down Expand Up @@ -4007,7 +3987,6 @@
D7093C69219EE1AE00723F17 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
Expand Down Expand Up @@ -4043,7 +4022,6 @@
D7093C6A219EE1AE00723F17 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
Expand Down Expand Up @@ -4297,7 +4275,6 @@
EB3630A923804F7C00B83598 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
Expand Down Expand Up @@ -4333,7 +4310,6 @@
EB3630AA23804F7C00B83598 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
Expand Down
15 changes: 0 additions & 15 deletions PushSwift/PlaceholderSwift.swift

This file was deleted.

6 changes: 0 additions & 6 deletions Source/ARTPushAdmin.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,6 @@
#import "ARTInternalLog.h"
#import "ARTJsonEncoder.h"
#import "ARTJsonLikeEncoder.h"
#import <Ably/Ably-Swift.h>

@class PlaceholderSwiftClass;
@interface randomSwift : NSObject<PlaceholderSwiftProtocol>

@end

@implementation ARTPushAdmin {
ARTQueuedDealloc *_dealloc;
Expand Down
4 changes: 2 additions & 2 deletions Source/PrivateHeaders/Ably/ARTConstants.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#import <Foundation/Foundation.h>

extern NSString *const ARTHttpHeaderFieldErrorCodeKey;
extern NSString *const ARTHttpHeaderFieldErrorMessageKey;
extern NSString *const ARTHttpHeaderFieldErrorCodeKey NS_SWIFT_NAME(HttpHeaderFieldErrorCodeKey);
extern NSString *const ARTHttpHeaderFieldErrorMessageKey NS_SWIFT_NAME(HttpHeaderFieldErrorMessageKey);
2 changes: 2 additions & 0 deletions Source/PrivateHeaders/Ably/ARTDataEncoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
NS_ASSUME_NONNULL_BEGIN

/// :nodoc:
NS_SWIFT_NAME(DataEncoderOutput)
@interface ARTDataEncoderOutput : NSObject

@property (readonly, nonatomic, nullable) id data;
Expand All @@ -21,6 +22,7 @@ NS_ASSUME_NONNULL_BEGIN
@end

/// :nodoc:
NS_SWIFT_NAME(DataEncoder)
@interface ARTDataEncoder : NSObject

- (instancetype)initWithCipherParams:(ARTCipherParams *_Nullable)params logger:(ARTInternalLog *)logger error:(NSError *_Nullable*_Nullable)error;
Expand Down
1 change: 1 addition & 0 deletions Source/PrivateHeaders/Ably/ARTLocalDeviceStorage.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
NS_ASSUME_NONNULL_BEGIN

/// :nodoc:
NS_SWIFT_NAME(LocalDeviceStorage)
@interface ARTLocalDeviceStorage : NSObject<ARTDeviceStorage>

- (instancetype)initWithLogger:(ARTInternalLog *)logger;
Expand Down
1 change: 1 addition & 0 deletions Source/PrivateHeaders/Ably/ARTNSMutableRequest+ARTRest.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#import <Foundation/Foundation.h>

NS_SWIFT_NAME(Encoder)
@protocol ARTEncoder;

NS_ASSUME_NONNULL_BEGIN
Expand Down
1 change: 1 addition & 0 deletions Source/PrivateHeaders/Ably/ARTPush+Private.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

NS_ASSUME_NONNULL_BEGIN

NS_SWIFT_NAME(PushInternal)
@interface ARTPushInternal : NSObject <ARTPushProtocol>

@property (nonatomic, readonly) ARTPushAdminInternal *admin;
Expand Down
13 changes: 13 additions & 0 deletions Source/PrivateHeaders/Ably/ARTPushActivationEvent.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

NS_ASSUME_NONNULL_BEGIN

NS_SWIFT_NAME(PushActivationEvent)
@interface ARTPushActivationEvent : NSObject <NSSecureCoding>

- (NSData *)archiveWithLogger:(nullable ARTInternalLog *)logger;
Expand All @@ -15,6 +16,7 @@ NS_ASSUME_NONNULL_BEGIN
@end

/// Event with Error info
NS_SWIFT_NAME(PushActivationErrorEvent)
@interface ARTPushActivationErrorEvent : ARTPushActivationEvent

@property (nonatomic, readonly) ARTErrorInfo *error;
Expand All @@ -25,6 +27,7 @@ NS_ASSUME_NONNULL_BEGIN
@end

/// Event with Device Identity Token details
NS_SWIFT_NAME(PushActivationDeviceIdentityEvent)
@interface ARTPushActivationDeviceIdentityEvent : ARTPushActivationEvent

@property (nonatomic, readonly, nullable) ARTDeviceIdentityTokenDetails *identityTokenDetails;
Expand All @@ -39,33 +42,43 @@ NS_ASSUME_NONNULL_BEGIN

#pragma mark - Events

NS_SWIFT_NAME(PushActivationEventCalledActivate)
@interface ARTPushActivationEventCalledActivate : ARTPushActivationEvent
@end

NS_SWIFT_NAME(PushActivationEventCalledDeactivate)
@interface ARTPushActivationEventCalledDeactivate : ARTPushActivationEvent
@end

NS_SWIFT_NAME(PushActivationEventGotPushDeviceDetails)
@interface ARTPushActivationEventGotPushDeviceDetails : ARTPushActivationEvent
@end

NS_SWIFT_NAME(PushActivationEventGettingPushDeviceDetailsFailed)
@interface ARTPushActivationEventGettingPushDeviceDetailsFailed : ARTPushActivationErrorEvent
@end

NS_SWIFT_NAME(PushActivationEventGotDeviceRegistration)
@interface ARTPushActivationEventGotDeviceRegistration : ARTPushActivationDeviceIdentityEvent
@end

NS_SWIFT_NAME(PushActivationEventGettingDeviceRegistrationFailed)
@interface ARTPushActivationEventGettingDeviceRegistrationFailed : ARTPushActivationErrorEvent
@end

NS_SWIFT_NAME(PushActivationEventRegistrationSynced)
@interface ARTPushActivationEventRegistrationSynced : ARTPushActivationDeviceIdentityEvent
@end

NS_SWIFT_NAME(PushActivationEventSyncRegistrationFailed)
@interface ARTPushActivationEventSyncRegistrationFailed : ARTPushActivationErrorEvent
@end

NS_SWIFT_NAME(PushActivationEventDeregistered)
@interface ARTPushActivationEventDeregistered : ARTPushActivationEvent
@end

NS_SWIFT_NAME(PushActivationEventDeregistrationFailed)
@interface ARTPushActivationEventDeregistrationFailed : ARTPushActivationErrorEvent
@end

Expand Down
11 changes: 11 additions & 0 deletions Source/PrivateHeaders/Ably/ARTPushActivationState.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

NS_ASSUME_NONNULL_BEGIN

NS_SWIFT_NAME(PushActivationState)
@interface ARTPushActivationState : NSObject <NSSecureCoding>

- (instancetype)init NS_UNAVAILABLE;
Expand All @@ -25,23 +26,29 @@ NS_ASSUME_NONNULL_BEGIN
@end

/// Persistent State
NS_SWIFT_NAME(PushActivationPersistantState)
@interface ARTPushActivationPersistentState : ARTPushActivationState
@end

#pragma mark - States

NS_SWIFT_NAME(PushActivationStateNotActivated)
@interface ARTPushActivationStateNotActivated : ARTPushActivationPersistentState
@end

NS_SWIFT_NAME(PushActivationStateWaitingForDeviceRegistration)
@interface ARTPushActivationStateWaitingForDeviceRegistration : ARTPushActivationState
@end

NS_SWIFT_NAME(PushActivationStateWaitingForPushDeviceDetails)
@interface ARTPushActivationStateWaitingForPushDeviceDetails : ARTPushActivationPersistentState
@end

NS_SWIFT_NAME(PushActivationStateWaitingForNewPushDeviceDetails)
@interface ARTPushActivationStateWaitingForNewPushDeviceDetails : ARTPushActivationPersistentState
@end

NS_SWIFT_NAME(PushActivationStateWaitingForRegistrationSync)
@interface ARTPushActivationStateWaitingForRegistrationSync : ARTPushActivationState

- (instancetype)initWithMachine:(ARTPushActivationStateMachine *)machine logger:(ARTInternalLog *)logger NS_UNAVAILABLE;
Expand All @@ -54,14 +61,17 @@ NS_ASSUME_NONNULL_BEGIN

@end

NS_SWIFT_NAME(PushActivationStateAfterRegistrationSyncFailed)
@interface ARTPushActivationStateAfterRegistrationSyncFailed : ARTPushActivationPersistentState
@end

NS_SWIFT_NAME(PushActivationStateWaitingForDeregistration)
@interface ARTPushActivationStateWaitingForDeregistration : ARTPushActivationState
@end

// Deprecated states; kept around for persistence backwards-compatibility

NS_SWIFT_NAME(PushActivationDeprecatedPersistentState)
@interface ARTPushActivationDeprecatedPersistentState : ARTPushActivationPersistentState

- (instancetype)initWithMachine:(ARTPushActivationStateMachine *)machine NS_UNAVAILABLE;
Expand All @@ -70,6 +80,7 @@ NS_ASSUME_NONNULL_BEGIN

@end

NS_SWIFT_NAME(PushActivationStateAfterRegistrationUpdateFailed)
@interface ARTPushActivationStateAfterRegistrationUpdateFailed : ARTPushActivationDeprecatedPersistentState
@end

Expand Down
1 change: 1 addition & 0 deletions Source/PrivateHeaders/Ably/ARTPushActivationStateMachine.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

NS_ASSUME_NONNULL_BEGIN

NS_SWIFT_NAME(PushActivationStateMachine)
@interface ARTPushActivationStateMachine : NSObject

@property (readonly, nonatomic) ARTPushActivationEvent *lastEvent;
Expand Down
1 change: 1 addition & 0 deletions Source/PrivateHeaders/Ably/ARTPushAdmin+Private.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

NS_ASSUME_NONNULL_BEGIN

NS_SWIFT_NAME(PushAdminInternal)
@interface ARTPushAdminInternal : NSObject <ARTPushAdminProtocol>

@property (nonatomic, readonly) ARTPushDeviceRegistrationsInternal *deviceRegistrations;
Expand Down
1 change: 1 addition & 0 deletions Source/PrivateHeaders/Ably/ARTPushChannel+Private.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
@class ARTRestInternal;
@class ARTInternalLog;

NS_SWIFT_NAME(PushChannelInternal)
@interface ARTPushChannelInternal : NSObject <ARTPushChannelProtocol>

- (instancetype)init:(ARTRestInternal *)rest withChannel:(ARTChannel *)channel logger:(ARTInternalLog *)logger;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
@class ARTRestInternal;
@class ARTInternalLog;

NS_SWIFT_NAME(PushChannelSubscriptionsInternal)
@interface ARTPushChannelSubscriptionsInternal : NSObject <ARTPushChannelSubscriptionsProtocol>

- (instancetype)initWithRest:(ARTRestInternal *)rest logger:(ARTInternalLog *)logger;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
@class ARTRestInternal;
@class ARTInternalLog;

NS_SWIFT_NAME(PushDeviceRegistrationsInternal)
@interface ARTPushDeviceRegistrationsInternal : NSObject <ARTPushDeviceRegistrationsProtocol>

- (instancetype)initWithRest:(ARTRestInternal *)rest logger:(ARTInternalLog *)logger;
Expand Down
2 changes: 2 additions & 0 deletions Source/include/Ably/ARTAuth.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ NS_ASSUME_NONNULL_BEGIN
/**
The protocol upon which the `ARTAuth` is implemented.
*/
NS_SWIFT_NAME(AuthProtocol)
@protocol ARTAuthProtocol

/**
Expand Down Expand Up @@ -88,6 +89,7 @@ NS_ASSUME_NONNULL_BEGIN
*
* @see See `ARTAuthProtocol` for details.
*/
NS_SWIFT_NAME(Auth)
@interface ARTAuth : NSObject <ARTAuthProtocol>

@end
Expand Down
1 change: 1 addition & 0 deletions Source/include/Ably/ARTBaseMessage.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ NS_ASSUME_NONNULL_BEGIN
/**
A base interface for an `ARTMessage` and an `ARTPresenceMessage` objects.
*/
NS_SWIFT_NAME(BaseMessage)
@interface ARTBaseMessage : NSObject<NSCopying>

/**
Expand Down
Loading

0 comments on commit 5708d9a

Please sign in to comment.