Skip to content
This repository has been archived by the owner on Jun 3, 2021. It is now read-only.

Commit

Permalink
初步optional适配
Browse files Browse the repository at this point in the history
  • Loading branch information
Txink committed Aug 26, 2019
1 parent 1ee8c74 commit 3c3dd9e
Show file tree
Hide file tree
Showing 67 changed files with 386 additions and 141 deletions.
10 changes: 8 additions & 2 deletions ios/sdk/WeexSDK.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -2947,6 +2947,8 @@
};
77D160FC1C02DBE70010B15B = {
CreatedOnToolsVersion = 7.1.1;
DevelopmentTeam = 5783442933;
ProvisioningStyle = Automatic;
};
DCA445241EFA555400D0CFA8 = {
CreatedOnToolsVersion = 8.3.3;
Expand Down Expand Up @@ -3675,9 +3677,10 @@
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = NO;
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
CODE_SIGN_STYLE = Automatic;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = "";
DEVELOPMENT_TEAM = 5783442933;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
Expand Down Expand Up @@ -3715,6 +3718,7 @@
PODS_ROOT = "";
PRODUCT_BUNDLE_IDENTIFIER = com.taobao.WeexSDK;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SKIP_INSTALL = YES;
VALID_ARCHS = "arm64 armv7 x86_64 i386";
WARNING_CFLAGS = "";
Expand All @@ -3732,8 +3736,9 @@
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = NO;
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
CODE_SIGN_STYLE = Automatic;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = "";
DEVELOPMENT_TEAM = 5783442933;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
Expand Down Expand Up @@ -3771,6 +3776,7 @@
PODS_ROOT = "";
PRODUCT_BUNDLE_IDENTIFIER = com.taobao.WeexSDK;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SKIP_INSTALL = YES;
VALID_ARCHS = "arm64 armv7 x86_64 i386";
WARNING_CFLAGS = "";
Expand Down
6 changes: 5 additions & 1 deletion ios/sdk/WeexSDK/Sources/Bridge/JSContext+Weex.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,12 @@

#import <JavaScriptCore/JavaScriptCore.h>

NS_ASSUME_NONNULL_BEGIN

@interface JSContext (Weex)

@property (nonatomic, strong) NSString *instanceId;
@property (nonatomic, strong) NSString * _Nullable instanceId;

@end

NS_ASSUME_NONNULL_END
6 changes: 5 additions & 1 deletion ios/sdk/WeexSDK/Sources/Bridge/WXBridgeMethod.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
*/

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

@class WXSDKInstance;

@interface WXBridgeMethod : NSObject
Expand All @@ -27,10 +30,11 @@
@property (nonatomic, weak, readonly) WXSDKInstance *instance;

- (instancetype)initWithMethodName:(NSString *)methodName
arguments:(NSArray *)arguments
arguments:(NSArray * _Nullable)arguments
instance:(WXSDKInstance *)instance;

- (NSInvocation *)invocationWithTarget:(id)target selector:(SEL)selector;

@end

NS_ASSUME_NONNULL_END
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,12 @@
* under the License.
*/

#import "WXScrollerComponent.h"
#import <WeexSDK/WXScrollerComponent.h>

NS_ASSUME_NONNULL_BEGIN

@interface WXRecyclerComponent : WXScrollerComponent

@end

NS_ASSUME_NONNULL_END
6 changes: 5 additions & 1 deletion ios/sdk/WeexSDK/Sources/Component/WXAComponent.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,12 @@
* under the License.
*/

#import "WXComponent.h"
#import <WeexSDK/WXComponent.h>

NS_ASSUME_NONNULL_BEGIN

@interface WXAComponent : WXComponent <UIGestureRecognizerDelegate>

@end

NS_ASSUME_NONNULL_END
6 changes: 5 additions & 1 deletion ios/sdk/WeexSDK/Sources/Component/WXIndicatorComponent.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
* under the License.
*/

#import "WXComponent.h"
#import <WeexSDK/WXComponent.h>

NS_ASSUME_NONNULL_BEGIN

typedef enum
{
Expand Down Expand Up @@ -50,3 +52,5 @@ typedef enum
@property (nonatomic, weak) id<WXIndicatorComponentDelegate> delegate;

@end

NS_ASSUME_NONNULL_END
6 changes: 5 additions & 1 deletion ios/sdk/WeexSDK/Sources/Component/WXListComponent.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,12 @@
* under the License.
*/

#import "WXScrollerComponent.h"
#import <WeexSDK/WXScrollerComponent.h>

NS_ASSUME_NONNULL_BEGIN

@interface WXListComponent : WXScrollerComponent

@end

NS_ASSUME_NONNULL_END
6 changes: 5 additions & 1 deletion ios/sdk/WeexSDK/Sources/Component/WXRefreshComponent.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
* under the License.
*/

#import "WXComponent.h"
#import <WeexSDK/WXComponent.h>

NS_ASSUME_NONNULL_BEGIN

#define REFRESH_DISTANCE_Y @"dy"
#define REFRESH_PULLINGDISTANCE @"pullingDistance"
Expand All @@ -36,3 +38,5 @@
- (void)setDisplay;

@end

NS_ASSUME_NONNULL_END
6 changes: 5 additions & 1 deletion ios/sdk/WeexSDK/Sources/Component/WXRichText.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,12 @@
* under the License.
*/

#import "WXComponent.h"
#import <WeexSDK/WXComponent.h>

NS_ASSUME_NONNULL_BEGIN

@interface WXRichText : WXComponent<UITextViewDelegate>

@end

NS_ASSUME_NONNULL_END
9 changes: 6 additions & 3 deletions ios/sdk/WeexSDK/Sources/Component/WXScrollerComponent.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,16 @@
* under the License.
*/

#import "WXScrollerProtocol.h"
#import "WXComponent.h"
#import <WeexSDK/WXScrollerProtocol.h>
#import <WeexSDK/WXComponent.h>

NS_ASSUME_NONNULL_BEGIN

@interface WXScrollerComponent : WXComponent <WXScrollerProtocol, UIScrollViewDelegate>

@property (nonatomic, copy) void (^onScroll)(UIScrollView *scrollView);

@property (nonatomic, copy) void (^scrollEventListener)(WXScrollerComponent* sender, NSString* event, NSDictionary* params);
@property (nonatomic, copy) void (^scrollEventListener)(WXScrollerComponent* sender, NSString* event, NSDictionary* _Nullable params);

@property (nonatomic, assign) NSUInteger loadmoreretry;

Expand All @@ -36,3 +38,4 @@

@end

NS_ASSUME_NONNULL_END
4 changes: 4 additions & 0 deletions ios/sdk/WeexSDK/Sources/Controller/WXBaseViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@

#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN

/**
* The WXBaseViewController class provides the infrastructure for managing the weex view in your app. It is
* responsible for creating a weex instance or rendering the weex view, for observing the lifecycle of the
Expand All @@ -44,3 +46,5 @@
- (void)refreshWeex;

@end

NS_ASSUME_NONNULL_END
4 changes: 4 additions & 0 deletions ios/sdk/WeexSDK/Sources/Controller/WXRootViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@

#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN

/**
* The WXRootViewController class inherited from UINavigationController class which implements a specialized
* view controller that manages the navigation of hierarchical content. Developing an iOS application, you
Expand All @@ -42,3 +44,5 @@
- (id)initWithSourceURL:(NSURL *)sourceURL;

@end

NS_ASSUME_NONNULL_END
8 changes: 6 additions & 2 deletions ios/sdk/WeexSDK/Sources/Debug/WXDebugTool.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
*/

#import <Foundation/Foundation.h>
#import "WXModuleProtocol.h"
#import <WeexSDK/WXModuleProtocol.h>

NS_ASSUME_NONNULL_BEGIN

@interface WXDebugTool : NSObject<WXModuleProtocol>

Expand All @@ -42,7 +44,7 @@

+ (NSString*)getReplacedJSFramework;

+ (BOOL) cacheJsService: (NSString *)name withScript: (NSString *)script withOptions: (NSDictionary *) options;
+ (BOOL) cacheJsService: (NSString *)name withScript: (NSString *)script withOptions: (NSDictionary * _Nullable) options;

+ (BOOL) removeCacheJsService: (NSString *)name;

Expand All @@ -53,3 +55,5 @@
+ (void)setRemoteTracing:(BOOL)isRemoteTracing;

@end

NS_ASSUME_NONNULL_END
6 changes: 5 additions & 1 deletion ios/sdk/WeexSDK/Sources/Eagle/WXDataRenderHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

@protocol WXDataRenderHandler <NSObject>

- (void)createPage:(NSString *)pageId template:(NSString *)jsBundleString options:(NSDictionary *)options data:(id)data;
Expand All @@ -31,7 +33,7 @@

- (void)refreshDataRenderInstance:(NSString *)pageId data:(NSString *)data;

- (void)fireEvent:(NSString *)pageId ref:(NSString *)ref event:(NSString *)event args:(NSDictionary *)args domChanges:(NSDictionary *)domChanges;
- (void)fireEvent:(NSString *)pageId ref:(NSString *)ref event:(NSString *)event args:(NSDictionary *)args domChanges:(NSDictionary * _Nullable)domChanges;

- (void)registerModules:(NSDictionary *)modules;

Expand All @@ -42,3 +44,5 @@
- (void)DispatchPageLifecycle:(NSString *)pageId;

@end

NS_ASSUME_NONNULL_END
14 changes: 9 additions & 5 deletions ios/sdk/WeexSDK/Sources/Engine/WXSDKEngine.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

@class WXSDKInstance;

@interface WXSDKEngine : NSObject
Expand Down Expand Up @@ -68,7 +70,7 @@
* @param properties properties to apply to the component
*
*/
+ (void)registerComponent:(NSString *)name withClass:(Class)clazz withProperties:(NSDictionary *)properties;
+ (void)registerComponent:(NSString *)name withClass:(Class)clazz withProperties:(NSDictionary * _Nullable)properties;

/**
* @abstract Registers a component for a given name, options and js code
Expand All @@ -80,7 +82,7 @@
* @param serviceScript service js code to invoke
*
*/
+ (void)registerService:(NSString *)name withScript:(NSString *)serviceScript withOptions:(NSDictionary *)options;
+ (void)registerService:(NSString *)name withScript:(NSString *)serviceScript withOptions:(NSDictionary * _Nullable)options;

/**
* @abstract Registers a component for a given name, options and js code
Expand All @@ -94,7 +96,7 @@
* @param completion Completion callback. JS is executed in asynchronously.
*
*/
+ (void)registerService:(NSString *)name withScript:(NSString *)serviceScript withOptions:(NSDictionary *)options completion:(void(^)(BOOL result))completion;
+ (void)registerService:(NSString *)name withScript:(NSString *)serviceScript withOptions:(NSDictionary * _Nullable)options completion:(void(^)(BOOL result))completion;

/**
* @abstract Registers a component for a given name, options and js url
Expand All @@ -106,7 +108,7 @@
* @param serviceScriptUrl The service url to register
*
*/
+ (void)registerService:(NSString *)name withScriptUrl:(NSURL *)serviceScriptUrl withOptions:(NSDictionary *)options;
+ (void)registerService:(NSString *)name withScriptUrl:(NSURL *)serviceScriptUrl withOptions:(NSDictionary * _Nullable)options;

/**
* @abstract Registers a component for a given name, options and js url
Expand All @@ -120,7 +122,7 @@
* @param completion Completion callback. JS is executed in asynchronously.
*
*/
+ (void)registerService:(NSString *)name withScriptUrl:(NSURL *)serviceScriptUrl withOptions:(NSDictionary *)options completion:(void(^)(BOOL result))completion;
+ (void)registerService:(NSString *)name withScriptUrl:(NSURL *)serviceScriptUrl withOptions:(NSDictionary * _Nullable)options completion:(void(^)(BOOL result))completion;

/**
* @abstract Registers a component for a given name, options and js code
Expand Down Expand Up @@ -238,3 +240,5 @@
+ (void)initSDKEnviroment:(NSString *)script DEPRECATED_MSG_ATTRIBUTE("To fix typo, use initSDKEnvironment: method instead.");

@end

NS_ASSUME_NONNULL_END
5 changes: 4 additions & 1 deletion ios/sdk/WeexSDK/Sources/Engine/WXSDKError.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
*/

#import <Foundation/Foundation.h>
#import "WXSDKInstance.h"
#import <WeexSDK/WXSDKInstance.h>

NS_ASSUME_NONNULL_BEGIN

#define WX_ERROR_GROUP_NATIVE @"NATIVE"
#define WX_ERROR_GROUP_JS @"JS"
Expand Down Expand Up @@ -137,3 +139,4 @@ typedef NS_ENUM (NSInteger,WXSDKErrorGroup){

@end

NS_ASSUME_NONNULL_END
6 changes: 5 additions & 1 deletion ios/sdk/WeexSDK/Sources/Handler/WXNavigationDefaultImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,12 @@
*/

#import <Foundation/Foundation.h>
#import "WXNavigationProtocol.h"
#import <WeexSDK/WXNavigationProtocol.h>

NS_ASSUME_NONNULL_BEGIN

@interface WXNavigationDefaultImpl : NSObject <WXNavigationProtocol>

@end

NS_ASSUME_NONNULL_END
6 changes: 3 additions & 3 deletions ios/sdk/WeexSDK/Sources/Layout/WXComponent+Layout.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
* under the License.
*/

#import "WXComponent.h"
#import "WXSDKInstance.h"
#import "WXUtility.h"
#import <WeexSDK/WXComponent.h>
#import <WeexSDK/WXSDKInstance.h>
#import <WeexSDK/WXUtility.h>

#define FlexUndefined NAN

Expand Down
Loading

0 comments on commit 3c3dd9e

Please sign in to comment.