帖子
帖子
用户
博客
课程
12下一页
返回列表 发新帖
显示全部楼层
1
帖子
0
勋章
3
Y币

[建议] [Swift编写插件]求助

[复制链接]
发表于 2014-10-31 20:54:28
按官方代码重建Swift插件代码
import UIKit
import Foundation

class UZModuleDemo :UZModule {

    override func initWithUZWebView(webView : UZWebView){
        if (self =  super.initWithUZWebView(webView)){
            return self;
        }
        return nil;
    }

    func showAlert(paramDict: NSDictionary){
        var alert = UIAlertView(title: "test", message: "test", delegate: nil, cancelButtonTitle: "ok")
        alert.show()
    }
    override func dispose() {

    }
}

提示use of undeclared type 'UZWebView'

这个有什么办法可以解决呀?


18
帖子
0
勋章
398
Y币
不导入 头文件吗 ?
18
帖子
0
勋章
398
Y币
UZModule 的头文件
1
帖子
0
勋章
3
Y币
都导入了 并且真机运行正确进入了index.html  卡在了写插件这里
1
帖子
0
勋章
3
Y币
补充一下 是重建的SWIFT工程 Bridging-Header引用的官方UZEngine目录下所有文件
28
帖子
1
勋章
1万+
Y币
你把UZWebView改成UIWebView就可以了
1
帖子
0
勋章
3
Y币
改了,还是测试无效
import UIKit

class UZModuleDemo :UZModule {
//    override init() {
//        super.init()
//        println("moduleDemo")
//    }

     override init(UZWebView webView: UIWebView!) {
         super.init(UZWebView: webView);
     }
   
    func showAlert(paramDict: NSDictionary){
        println("333333")
        var alert = UIAlertView(title: "test", message: "test", delegate: nil, cancelButtonTitle: "ok")
        alert.show()
    }
}





//
//  UZModule.h
//  UZEngine
//
//  Created by broad on 13-11-6.
//  Copyright (c) 2013年 APICloud. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

typedef enum _KUZModuleErrorType {
    kUZModuleErrorTypeNormal = 0,
} KUZModuleErrorType;

typedef enum _KUZStringType {
    kUZStringType_JSON = 0,
    kUZStringType_TEXT,
} KUZStringType;

@class UZWebView;

@interface UZModule : NSObject

@property (nonatomic, readonly, weak) UIWebView *uzWebView;
@property (nonatomic, readonly, weak) UIViewController *viewController;

#pragma mark - lifeCycle
- (id)initWithUZWebViewUIWebView *)webView;
- (void)dispose;

#pragma mark - ret event
- (void)sendResultEventWithCallbackIdNSInteger)cbId dataDictNSDictionary *)dataDict errDictNSDictionary *)errDict doDeleteBOOL)doDelete;
- (void)sendResultEventWithCallbackIdNSInteger)cbId dataStringNSString *)dataString stringTypeKUZStringType)strType errDictNSDictionary *)errDict doDeleteBOOL)doDelete;
- (void)deleteCallback:(NSInteger)cbId;
- (void)evalJs:(NSString *)js;

#pragma mark - utility methods
- (NSString *)getPathWithUZSchemeURL:(NSString *)urlStr;
- (UIView *)getViewByName:(NSString *)name;
- (NSString *)securityValueForKey:(NSString *)key;

@end
1
帖子
0
勋章
3
Y币
想传工程上来,结果14M.......
18
帖子
0
勋章
398
Y币
yanfengstyle**.**  发我 邮箱  我看看  我也是 搞 iOS的  看看 到底是不是 官方的bug
1
帖子
0
勋章
3
Y币
发你了

打包下载地址:http://115.28.170.84/UZTest.zip
12下一页
您需要登录后才可以回帖 登录

本版积分规则