nixzhu / MonkeyKing

MonkeyKing helps you to post messages to Chinese Social Networks.
MIT License
2.76k stars 240 forks source link

请问一下有计划支持Objective-C吗? #61

Closed tinpont closed 7 years ago

tinpont commented 7 years ago

公司项目需要使用到Objective-C + Carthage,openshare没有支持carthage,MonkeyKing没有支持Objective-C,现在有点头疼。

xspyhack commented 7 years ago

openshare, the same library written with Objective-C.

tinpont commented 7 years ago

@xspyhack Thanks for your soon response. But openshare not support carthage.

xspyhack commented 7 years ago

Hi @tinpont ,

Look at #14 , you can easy to support Objective-C by yourself.

For example:

import Foundation
import MonkeyKing

@objc public class MonkeyKingBar: NSObject {

    public private(set) static var wechat: MonkeyKing.Account? = nil

    public static func registerWeChat(WithAppID appID: String) {
        wechat = .WeChat(appID: appID, appKey: nil)
        MonkeyKing.registerAccount(wechat!)
    }

}
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    [MonkeyKingBar registerWeChatWithAppID:YOUR_WECHAT_APP_ID];

    return YES;
}

Cheers 🍻