- Go to the
ios
project path under the project directory created by theweexend plugin create
command. Update the cocoapods with the following commands to initialize the ios project
$ pod update
-
Follow Extend to iOS to complete plug-in development.
-
Add plug-in registration information in the code:
// Register Component
WX_PlUGIN_EXPORT_COMPONENT(test, WPTestModule)
// Register Module
WX_PlUGIN_EXPORT_MODULE(test, WPTestComponent)
// Register Handler
WX_PlUGIN_EXPORT_HANDLER(WPTestHandler, WXImgLoaderProtocol)
After finished the plugin development, you can test on playground/ios
.
- Initialize the test project
$ pod update
- Verify the test results, after the demo run up, following information should be output on the console:
2017-03-24 16:54:52.934 WeexDemo[88059:2693902] WPTestComponent register
2017-03-24 16:54:52.936 WeexDemo[88059:2693902] WXImgLoaderProtocol register
2017-03-24 16:54:52.937 WeexDemo[88059:2693902] WPTestModule register
Also you can use Dotwe to wrote some vue script to test on your playground app
.