[iOS] development of integrated Weex notes

When writing this article, Weex is not completely open source, which is the official document center, which is the Weex team on the Github article, you can apply for access to the official website of the Weex Github page.

This article describes how to quickly integrate Weex into your iOS Project inside.

If you don’t have a Weex SDK, you can download the official to the WeexSample project, which has WeexSDK.framework this file, so if you use Objective-C, refer to this article, you can clearly know the Sample is how to write out, but this article doesn’t tell you these things:

  • There are two files SRWebSocket.h and SRWebSocket.m, this is the Facebook open source project SockerRocket, run the project must have this thing (at least temporarily, perhaps after the Weex team will try to do a similar thing out?)
  • There is no official version of the Swift Sample, here is an example from the third party, you can refer to this example, there is a little problem, code style is not too Swifty, I write in the following, such as print NSLog in this innocuous, anyhow is using Swift to run up
  • Weex is written in OC, Swift project integration, which need to be bridged file, if you don’t know what this is, you can refer to my previous article, this file only needs to write these (without import SRWebSocket):
#import < WeexSDK/WXSDKEngine.h> #import < WeexSDK/WXSDKInstance.h> #import < WeexSDK/WXLog.h> #import < WeexSDK/WXAppConfiguration.h>
  • Official display of the OC version of this code:
- (void) dealloc {[_instance destroyInstance];}

Inside the Swift is written:

Override func / / Deprecated / / finalize / / instance.destroyInstance () () {/ / deinit} ({instance.destroyInstance})

  • Although the official mentioned this in a lot of places, in order to prevent some people still ignore, write again: please join the Build Other Link Flags in -ObjC
  • The official website of the open source code, not the SDK into.Framework, but directly to a folder, to put this project through the Pod SDK integrated into the project, and also by Pod integrated with other content, this is the content of the Podfile (WeexSDK can be seen through the local path to the’https://github.com/CocoaPods/Specs.git’platform: IOS: source).’7.0′ #inhibit_all_warnings target’WeexDemo’do pod!’WeexSDK’:’../sdk/’pod’SDWebImage’, path=>’3.7.5′, pod’SocketRocket’,’0.4.2’pod’ATSDK-Weex’,’0.0.1’end