Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parameter and function naming issue #2

Open
maxxfrazer opened this issue Dec 18, 2023 · 5 comments
Open

Parameter and function naming issue #2

maxxfrazer opened this issue Dec 18, 2023 · 5 comments

Comments

@maxxfrazer
Copy link
Contributor

maxxfrazer commented Dec 18, 2023

The function ChatroomUIKitClient/launchRoomViewWithOptionsWithRoomId should just have one with, and that should be the first parameter, so should instead be called: launchRoomViewWithRoomId. With the current set-up it appears in Swift as launchRoomViewWithOptions(roomId:frame:is:options:)

The parameter isOwner is set up as: is:(BOOL) owner, so when imported to swift the parameter is just is. Instead it should be isOwner:(BOOL) owner.

With those changes, the swift function will become launchRoomView(roomId:frame:isOwner:options:).

@maxxfrazer
Copy link
Contributor Author

Similarly, ChatroomUIKitClient/setupWith:

  • should be - (EMError *) setupWithAppKey:(NSString *) appKey;

  • instead of - (EMError *) setupWith:(NSString *) appKey;

@maxxfrazer
Copy link
Contributor Author

maxxfrazer commented Dec 18, 2023

Also:

- (void) loginWith:(NSString *) userId 
             token:(NSString *) token 
        completion:(void (^)(EMError *)) completion;

should be

- (void) loginWithUserId:(NSString *) userId 
                   token:(NSString *) token 
              completion:(void (^)(EMError *)) completion;

@maxxfrazer
Copy link
Contributor Author

There's many more, please check objc-swift interoperability in general across the package

@zjc19891106
Copy link
Collaborator

If I want to adapt to the standard official recommended format of Objective-C language declaration function, I need to do a lot of function name refactoring work. Then it needs to be modified to perform regression testing demo and example projects, which all require a lot of time. Our compatibility with OC language is only to allow them to use it. As for the naming problem, it does exist, but the time and cost of transformation are too high, so we will maintain the status quo for the time being.

@maxxfrazer
Copy link
Contributor Author

@zjc19891106 could at least the ones above be addressed? these are some pretty low hanging fixes, and are going to be used by a majority of developers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants