feat:add slider in iOS

This commit is contained in:
pengfei.zhou 2019-11-19 16:23:51 +08:00
parent c3b656d539
commit 3c9d66db1a
7 changed files with 144 additions and 0 deletions

View File

@ -31,6 +31,8 @@
#import "DoricListNode.h"
#import "DoricListItemNode.h"
#import "DoricScrollerNode.h"
#import "DoricSliderNode.h"
#import "DoricSlideItemNode.h"
@interface DoricRegistry ()
@ -64,6 +66,8 @@ - (void)innerRegister {
[self registerViewNode:DoricListNode.class withName:@"List"];
[self registerViewNode:DoricListItemNode.class withName:@"ListItem"];
[self registerViewNode:DoricScrollerNode.class withName:@"Scroller"];
[self registerViewNode:DoricSliderNode.class withName:@"Slider"];
[self registerViewNode:DoricSlideItemNode.class withName:@"SlideItem"];
}
- (void)registerJSBundle:(NSString *)bundle withName:(NSString *)name {

View File

@ -13,6 +13,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
//
// DoricScrollerNode.h
// Doric
//
// Created by pengfei.zhou on 2019/11/19.
//
#import <Foundation/Foundation.h>
#import "DoricSuperNode.h"

View File

@ -13,6 +13,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
//
// DoricScrollerNode.m
// Doric
//
// Created by pengfei.zhou on 2019/11/19.
//
#import "DoricScrollerNode.h"
#import "DoricExtensions.h"

View File

@ -0,0 +1,26 @@
/*
* Copyright [2019] [Doric.Pub]
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
//
// DoricSlideItemNode.h
// Doric
//
// Created by pengfei.zhou on 2019/11/19.
//
#import <Foundation/Foundation.h>
#import "DoricStackNode.h"
@interface DoricSlideItemNode : DoricStackNode
@end

View File

@ -0,0 +1,47 @@
/*
* Copyright [2019] [Doric.Pub]
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
//
// DoricSlideItemNode.m
// Doric
//
// Created by pengfei.zhou on 2019/11/19.
//
#import "DoricSlideItemNode.h"
@interface DoricSlideItemView : DoricStackView
@end
@implementation DoricSlideItemView
@end
@implementation DoricSlideItemNode
- (instancetype)initWithContext:(DoricContext *)doricContext {
if (self = [super initWithContext:doricContext]) {
self.reusable = YES;
}
return self;
}
- (void)initWithSuperNode:(DoricSuperNode *)superNode {
[super initWithSuperNode:superNode];
self.reusable = YES;
}
- (DoricStackView *)build {
return [DoricSlideItemView new];
}
@end

View File

@ -0,0 +1,27 @@
/*
* Copyright [2019] [Doric.Pub]
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
//
// DoricSliderNode.h
// Doric
//
// Created by pengfei.zhou on 2019/11/19.
//
#import <Foundation/Foundation.h>
#import "DoricSuperNode.h"
@interface DoricSliderNode : DoricSuperNode<UICollectionView *>
@end

View File

@ -0,0 +1,28 @@
/*
* Copyright [2019] [Doric.Pub]
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
//
// DoricSliderNode.m
// Doric
//
// Created by pengfei.zhou on 2019/11/19.
//
#import "DoricSliderNode.h"
@implementation DoricSliderNode {
}
@end