Skip to content

Commit

Permalink
Remove usage of SWIFT_ENUM
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisballinger committed Jun 5, 2018
1 parent 20fe9bd commit d79187b
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 7 deletions.
4 changes: 4 additions & 0 deletions ChatSecure.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,7 @@
D9AE3A321BA8D9AB00255537 /* OTRConstants.h in Headers */ = {isa = PBXBuildFile; fileRef = 633105EE1A16D1A300C17BAE /* OTRConstants.h */; settings = {ATTRIBUTES = (Public, ); }; };
D9AE3A331BA8D9AB00255537 /* OTRConstants.m in Sources */ = {isa = PBXBuildFile; fileRef = 633105EF1A16D1A300C17BAE /* OTRConstants.m */; };
D9B3EC221FA196CE00E63C7F /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = D9B3EC211FA196CE00E63C7F /* AppDelegate.swift */; };
D9B3F9E720C6500F005000A9 /* RoomOccupantRole.h in Headers */ = {isa = PBXBuildFile; fileRef = D9B3F9E620C6500F005000A9 /* RoomOccupantRole.h */; settings = {ATTRIBUTES = (Public, ); }; };
D9B79B951ECF951F00883963 /* OTRFileItem.h in Headers */ = {isa = PBXBuildFile; fileRef = D9B79B931ECF951F00883963 /* OTRFileItem.h */; };
D9B79B961ECF951F00883963 /* OTRFileItem.m in Sources */ = {isa = PBXBuildFile; fileRef = D9B79B941ECF951F00883963 /* OTRFileItem.m */; };
D9B7C5CE1EC3C9ED008D99E6 /* OTRAccountMigrator.m in Sources */ = {isa = PBXBuildFile; fileRef = D93718521EC267F800766D49 /* OTRAccountMigrator.m */; };
Expand Down Expand Up @@ -1134,6 +1135,7 @@
D9AE3A2E1BA8D84500255537 /* OTRBranding.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OTRBranding.h; sourceTree = "<group>"; };
D9AE3A2F1BA8D84500255537 /* OTRBranding.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OTRBranding.m; sourceTree = "<group>"; };
D9B3EC211FA196CE00E63C7F /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
D9B3F9E620C6500F005000A9 /* RoomOccupantRole.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RoomOccupantRole.h; sourceTree = "<group>"; };
D9B79B931ECF951F00883963 /* OTRFileItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OTRFileItem.h; sourceTree = "<group>"; };
D9B79B941ECF951F00883963 /* OTRFileItem.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OTRFileItem.m; sourceTree = "<group>"; };
D9B9B1311DC7F3AC0007F5A7 /* UserInfoProfileCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UserInfoProfileCell.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1507,6 +1509,7 @@
633105B81A16D1A300C17BAE /* Yap Storage */ = {
isa = PBXGroup;
children = (
D9B3F9E620C6500F005000A9 /* RoomOccupantRole.h */,
D947C2FA1FB251410037DE84 /* SecondaryIndexes.swift */,
D9A1E6541F7309C100E42118 /* OTRDownloadMessage.swift */,
D91F9EF91ED6301500AEA62C /* OTRDownloadMessage.h */,
Expand Down Expand Up @@ -2221,6 +2224,7 @@
D9B79B951ECF951F00883963 /* OTRFileItem.h in Headers */,
637ABBC91DD5312200B18DD2 /* OTROutgoingMessage.h in Headers */,
D93DDB8C1BA79A8E00CD8331 /* OTRVideoItem.h in Headers */,
D9B3F9E720C6500F005000A9 /* RoomOccupantRole.h in Headers */,
D93DDB821BA79A8700CD8331 /* OTRValueSetting.h in Headers */,
D93DDB9E1BA79AA000CD8331 /* OTRUtilities.h in Headers */,
D93DDBDE1BA79AF900CD8331 /* OTRTouchAndHoldGestureRecognizer.h in Headers */,
Expand Down
1 change: 0 additions & 1 deletion ChatSecure/Classes/Model/OTRBuddyCache.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
NS_ASSUME_NONNULL_BEGIN

@class OTRXMPPRoom;
typedef SWIFT_ENUM(NSInteger, RoomOccupantRole);
@class OTRXMPPRoomOccupant;

@interface OTRXMPPRoomRuntimeProperties : NSObject
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,7 @@ import YapDatabase
import Mantle
import CocoaLumberjack

@objc public enum RoomOccupantRole:Int {
case none = 0
case participant = 1
case moderator = 2
case visitor = 3

extension RoomOccupantRole {
public init(stringValue: String) {
self = RoomOccupantRoleHelper.role(withString: stringValue)
}
Expand Down
16 changes: 16 additions & 0 deletions ChatSecure/Classes/Model/Yap Storage/RoomOccupantRole.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
//
// RoomOccupantRole.h
// ChatSecureCore
//
// Created by Chris Ballinger on 6/4/18.
// Copyright © 2018 Chris Ballinger. All rights reserved.
//

@import Foundation;

typedef NS_ENUM(NSInteger, RoomOccupantRole) {
RoomOccupantRoleNone = 0,
RoomOccupantRoleParticipant = 1,
RoomOccupantRoleModerator = 2,
RoomOccupantRoleVisitor = 3
};
2 changes: 2 additions & 0 deletions ChatSecureCore/ChatSecureCore.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ FOUNDATION_EXPORT const unsigned char ChatSecureCoreVersionString[];
#import "OTRXMPPRoomManager.h"
#import "OTRQRCodeReaderDelegate.h"
#import "OTRBuddyApprovalCell.h"
#import "RoomOccupantRole.h"


#import "OTRImageItem.h"
#import "OTRAudioItem.h"
Expand Down

0 comments on commit d79187b

Please sign in to comment.