forked from BigShow1949/BigShow1949
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
big show
committed
Dec 9, 2018
1 parent
39b8e60
commit 14af6f4
Showing
46 changed files
with
934 additions
and
53 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
15 changes: 15 additions & 0 deletions
15
...ow1949/Classes/10 - DesignPattern(设计模式)/Viper/Note/EditorModule/Builder/YFEditorBuilder.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// | ||
// YFEditorBuilder.h | ||
// BigShow1949 | ||
// | ||
// Created by big show on 2018/12/9. | ||
// Copyright © 2018年 BigShowCompany. All rights reserved. | ||
// | ||
|
||
#import <Foundation/Foundation.h> | ||
|
||
@protocol YFEditorDelegate,YFViperRouter; | ||
@interface YFEditorBuilder : NSObject | ||
+ (UIViewController *)viewForCreatingNoteWithDelegate:(id<YFEditorDelegate>)delegate router:(id<YFViperRouter>)router; | ||
+ (UIViewController *)viewForEditingNoteWithUUID:(NSString *)uuid title:(NSString *)title content:(NSString *)content delegate:(id<YFEditorDelegate>)delegate router:(id<YFViperRouter>)router; | ||
@end |
45 changes: 45 additions & 0 deletions
45
...ow1949/Classes/10 - DesignPattern(设计模式)/Viper/Note/EditorModule/Builder/YFEditorBuilder.m
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// | ||
// YFEditorBuilder.m | ||
// BigShow1949 | ||
// | ||
// Created by big show on 2018/12/9. | ||
// Copyright © 2018年 BigShowCompany. All rights reserved. | ||
// | ||
|
||
#import "YFEditorBuilder.h" | ||
#import "YFEditorViewController.h" | ||
#import "YFEditorViewPresenter.h" | ||
#import "YFEditorInteractor.h" | ||
#import "YFEditorWireframe.h" | ||
|
||
#import "YFViperViewPrivate.h" | ||
#import "YFViperInteractorPrivate.h" | ||
#import "YFViperPresenterPrivate.h" | ||
#import "YFNoteModel.h" | ||
|
||
#import "NSObject+YFViperAssembly.h" | ||
|
||
@implementation YFEditorBuilder | ||
+ (UIViewController *)viewForCreatingNoteWithDelegate:(id<YFEditorDelegate>)delegate router:(id<YFViperRouter>)router { | ||
YFEditorViewController *view = [[YFEditorViewController alloc] init]; | ||
view.delegate = delegate; | ||
[self buildView:(id<YFViperViewPrivate>)view note:nil router:router]; | ||
return view; | ||
} | ||
|
||
+ (UIViewController *)viewForEditingNoteWithUUID:(NSString *)uuid title:(NSString *)title content:(NSString *)content delegate:(id<YFEditorDelegate>)delegate router:(id<YFViperRouter>)router { | ||
return nil; | ||
} | ||
|
||
+ (void)buildView:(id<YFViperViewPrivate>)view note:(nullable YFNoteModel *)note router:(id<YFViperRouter>)router { | ||
YFEditorViewPresenter *presenter = [[YFEditorViewPresenter alloc] init]; | ||
YFEditorInteractor *interactor = [[YFEditorInteractor alloc] initWithEditingNote:note]; | ||
id<YFViperWireframePrivate> wireframe = (id)[[YFEditorWireframe alloc] init]; | ||
|
||
[self assembleViperForView:view | ||
presenter:(id<YFViperPresenterPrivate>)presenter | ||
interactor:(id<YFViperInteractorPrivate>)interactor | ||
wireframe:(id<YFViperWireframePrivate>)wireframe | ||
router:(id<YFViperRouter>)router]; | ||
} | ||
@end |
15 changes: 15 additions & 0 deletions
15
.../Classes/10 - DesignPattern(设计模式)/Viper/Note/EditorModule/Interactor/YFEditorInteractor.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// | ||
// YFEditorInteractor.h | ||
// BigShow1949 | ||
// | ||
// Created by big show on 2018/12/9. | ||
// Copyright © 2018年 BigShowCompany. All rights reserved. | ||
// | ||
|
||
#import <Foundation/Foundation.h> | ||
#import "YFViperInteractor.h" | ||
|
||
@class YFNoteModel; | ||
@interface YFEditorInteractor : NSObject<YFViperInteractor> | ||
- (instancetype)initWithEditingNote:(nullable YFNoteModel *)note; | ||
@end |
30 changes: 30 additions & 0 deletions
30
.../Classes/10 - DesignPattern(设计模式)/Viper/Note/EditorModule/Interactor/YFEditorInteractor.m
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// | ||
// YFEditorInteractor.m | ||
// BigShow1949 | ||
// | ||
// Created by big show on 2018/12/9. | ||
// Copyright © 2018年 BigShowCompany. All rights reserved. | ||
// | ||
|
||
#import "YFEditorInteractor.h" | ||
#import "YFNoteModel.h" | ||
|
||
@interface YFEditorInteractor() | ||
@property (nonatomic, strong, nullable) YFNoteModel *currentEditingNote; | ||
|
||
@end | ||
|
||
@implementation YFEditorInteractor | ||
- (instancetype)initWithEditingNote:(nullable YFNoteModel*)note { | ||
if (self = [super init]) { | ||
if (note) { | ||
_currentEditingNote = note; | ||
} | ||
} | ||
return self; | ||
} | ||
@synthesize dataSource; | ||
|
||
@synthesize eventHandler; | ||
|
||
@end |
13 changes: 13 additions & 0 deletions
13
...0 - DesignPattern(设计模式)/Viper/Note/EditorModule/Interactor/YFEditorInteractorDataSource.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// | ||
// YFEditorInteractorDataSource.h | ||
// BigShow1949 | ||
// | ||
// Created by big show on 2018/12/9. | ||
// Copyright © 2018年 BigShowCompany. All rights reserved. | ||
// | ||
|
||
#ifndef YFEditorInteractorDataSource_h | ||
#define YFEditorInteractorDataSource_h | ||
|
||
|
||
#endif /* YFEditorInteractorDataSource_h */ |
13 changes: 13 additions & 0 deletions
13
...- DesignPattern(设计模式)/Viper/Note/EditorModule/Interactor/YFEditorInteractorEventHandler.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// | ||
// YFEditorInteractorEventHandler.h | ||
// BigShow1949 | ||
// | ||
// Created by big show on 2018/12/9. | ||
// Copyright © 2018年 BigShowCompany. All rights reserved. | ||
// | ||
|
||
#ifndef YFEditorInteractorEventHandler_h | ||
#define YFEditorInteractorEventHandler_h | ||
|
||
|
||
#endif /* YFEditorInteractorEventHandler_h */ |
13 changes: 13 additions & 0 deletions
13
...ses/10 - DesignPattern(设计模式)/Viper/Note/EditorModule/Interactor/YFEditorInteractorInput.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// | ||
// YFEditorInteractorInput.h | ||
// BigShow1949 | ||
// | ||
// Created by big show on 2018/12/9. | ||
// Copyright © 2018年 BigShowCompany. All rights reserved. | ||
// | ||
|
||
#ifndef YFEditorInteractorInput_h | ||
#define YFEditorInteractorInput_h | ||
|
||
|
||
#endif /* YFEditorInteractorInput_h */ |
14 changes: 14 additions & 0 deletions
14
...lasses/10 - DesignPattern(设计模式)/Viper/Note/EditorModule/Presenter/YFEditorViewPresenter.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// | ||
// YFEditorViewPresenter.h | ||
// BigShow1949 | ||
// | ||
// Created by big show on 2018/12/9. | ||
// Copyright © 2018年 BigShowCompany. All rights reserved. | ||
// | ||
|
||
#import <Foundation/Foundation.h> | ||
#import "YFViperPresenter.h" | ||
#import "YFEditorViewEventHandler.h" | ||
@interface YFEditorViewPresenter : NSObject<YFViperPresenter,YFEditorViewEventHandler> | ||
|
||
@end |
13 changes: 13 additions & 0 deletions
13
...lasses/10 - DesignPattern(设计模式)/Viper/Note/EditorModule/Presenter/YFEditorViewPresenter.m
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// | ||
// YFEditorViewPresenter.m | ||
// BigShow1949 | ||
// | ||
// Created by big show on 2018/12/9. | ||
// Copyright © 2018年 BigShowCompany. All rights reserved. | ||
// | ||
|
||
#import "YFEditorViewPresenter.h" | ||
|
||
@implementation YFEditorViewPresenter | ||
|
||
@end |
15 changes: 15 additions & 0 deletions
15
BigShow1949/Classes/10 - DesignPattern(设计模式)/Viper/Note/EditorModule/View/YFEditorDelegate.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// | ||
// YFEditorDelegate.h | ||
// BigShow1949 | ||
// | ||
// Created by big show on 2018/12/9. | ||
// Copyright © 2018年 BigShowCompany. All rights reserved. | ||
// | ||
|
||
#ifndef YFEditorDelegate_h | ||
#define YFEditorDelegate_h | ||
@protocol YFEditorDelegate | ||
|
||
@end | ||
|
||
#endif /* YFEditorDelegate_h */ |
16 changes: 16 additions & 0 deletions
16
...49/Classes/10 - DesignPattern(设计模式)/Viper/Note/EditorModule/View/YFEditorViewController.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// | ||
// YFEditorViewController.h | ||
// BigShow1949 | ||
// | ||
// Created by big show on 2018/12/9. | ||
// Copyright © 2018年 BigShowCompany. All rights reserved. | ||
// | ||
|
||
#import <UIKit/UIKit.h> | ||
#import "YFEditorViewProtocol.h" | ||
#import "YFViperView.h" | ||
@protocol YFEditorDelegate; | ||
@interface YFEditorViewController : UIViewController<YFViperView,YFEditorViewProtocol> | ||
@property (nonatomic, weak) id<YFEditorDelegate> delegate; | ||
|
||
@end |
57 changes: 57 additions & 0 deletions
57
...49/Classes/10 - DesignPattern(设计模式)/Viper/Note/EditorModule/View/YFEditorViewController.m
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
// | ||
// YFEditorViewController.m | ||
// BigShow1949 | ||
// | ||
// Created by big show on 2018/12/9. | ||
// Copyright © 2018年 BigShowCompany. All rights reserved. | ||
// | ||
|
||
#import "YFEditorViewController.h" | ||
|
||
#import "YFEditorViewDataSource.h" | ||
#import "YFEditorViewEventHandler.h" | ||
|
||
@interface YFEditorViewController () | ||
@property (nonatomic, strong) id<YFEditorViewEventHandler> eventHandler; | ||
@property (nonatomic, strong) id<YFEditorViewDataSource> viewDataSource; | ||
@end | ||
|
||
@implementation YFEditorViewController | ||
|
||
- (void)viewDidLoad { | ||
[super viewDidLoad]; | ||
self.view.backgroundColor = [UIColor whiteColor]; | ||
[self setupNav]; | ||
} | ||
|
||
- (void)viewWillAppear:(BOOL)animated { | ||
[super viewWillAppear:animated]; | ||
} | ||
|
||
- (void)viewDidAppear:(BOOL)animated { | ||
[super viewDidAppear:animated]; | ||
} | ||
|
||
- (void)viewWillDisappear:(BOOL)animated { | ||
[super viewWillDisappear:animated]; | ||
} | ||
|
||
#pragma mark - Private | ||
- (void)setupNav { | ||
self.title = @"Editor"; | ||
UIBarButtonItem *addNoteItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:self.eventHandler action:@selector(didTouchNavigationBarDoneButton)]; | ||
self.navigationItem.rightBarButtonItem = addNoteItem; | ||
|
||
// if ([self.eventHandler respondsToSelector:@selector(handleViewReady)]) { | ||
// [self.eventHandler handleViewReady]; | ||
// } | ||
} | ||
|
||
- (void)done { | ||
|
||
} | ||
|
||
|
||
|
||
|
||
@end |
16 changes: 16 additions & 0 deletions
16
...49/Classes/10 - DesignPattern(设计模式)/Viper/Note/EditorModule/View/YFEditorViewDataSource.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// | ||
// YFEditorViewDataSource.h | ||
// BigShow1949 | ||
// | ||
// Created by big show on 2018/12/9. | ||
// Copyright © 2018年 BigShowCompany. All rights reserved. | ||
// | ||
|
||
#ifndef YFEditorViewDataSource_h | ||
#define YFEditorViewDataSource_h | ||
|
||
@protocol YFEditorViewDataSource | ||
|
||
@end | ||
|
||
#endif /* YFEditorViewDataSource_h */ |
18 changes: 18 additions & 0 deletions
18
.../Classes/10 - DesignPattern(设计模式)/Viper/Note/EditorModule/View/YFEditorViewEventHandler.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// | ||
// YFEditorViewEventHandler.h | ||
// BigShow1949 | ||
// | ||
// Created by big show on 2018/12/9. | ||
// Copyright © 2018年 BigShowCompany. All rights reserved. | ||
// | ||
|
||
#ifndef YFEditorViewEventHandler_h | ||
#define YFEditorViewEventHandler_h | ||
|
||
@protocol YFViperRouter; | ||
@protocol YFEditorViewEventHandler | ||
- (void)didTouchNavigationBarDoneButton; | ||
- (id<YFViperRouter>)router; | ||
@end | ||
|
||
#endif /* YFEditorViewEventHandler_h */ |
16 changes: 16 additions & 0 deletions
16
...1949/Classes/10 - DesignPattern(设计模式)/Viper/Note/EditorModule/View/YFEditorViewProtocol.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// | ||
// YFEditorViewViewProtocol.h | ||
// BigShow1949 | ||
// | ||
// Created by big show on 2018/12/9. | ||
// Copyright © 2018年 BigShowCompany. All rights reserved. | ||
// | ||
|
||
#ifndef YFEditorViewProtocol_h | ||
#define YFEditorViewProtocol_h | ||
|
||
@protocol YFEditorViewProtocol | ||
|
||
@end | ||
|
||
#endif /* YFEditorViewViewProtocol_h */ |
13 changes: 13 additions & 0 deletions
13
...49/Classes/10 - DesignPattern(设计模式)/Viper/Note/EditorModule/Wireframe/YFEditorWireframe.m
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// | ||
// YFEditorWireframe.m | ||
// BigShow1949 | ||
// | ||
// Created by big show on 2018/12/9. | ||
// Copyright © 2018年 BigShowCompany. All rights reserved. | ||
// | ||
|
||
#import "YFEditorWireframe.h" | ||
|
||
@implementation YFEditorWireframe | ||
|
||
@end |
13 changes: 13 additions & 0 deletions
13
...asses/10 - DesignPattern(设计模式)/Viper/Note/EditorModule/Wireframe/YFEditorWireframeInput.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// | ||
// YFEditorWireframeInput.h | ||
// BigShow1949 | ||
// | ||
// Created by big show on 2018/12/9. | ||
// Copyright © 2018年 BigShowCompany. All rights reserved. | ||
// | ||
|
||
#ifndef YFEditorWireframeInput_h | ||
#define YFEditorWireframeInput_h | ||
|
||
|
||
#endif /* YFEditorWireframeInput_h */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
BigShow1949/Classes/10 - DesignPattern(设计模式)/Viper/Note/NoteListModule/Enity/YFNoteModel.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// | ||
// YFNoteModel.h | ||
// BigShow1949 | ||
// | ||
// Created by big show on 2018/12/9. | ||
// Copyright © 2018年 BigShowCompany. All rights reserved. | ||
// | ||
|
||
#import <Foundation/Foundation.h> | ||
|
||
@interface YFNoteModel : NSObject | ||
@property (nonatomic, readonly, copy) NSString *uuid; | ||
@property (nonatomic, readonly, copy) NSString *title; | ||
@property (nonatomic, readonly, copy) NSString *content; | ||
@end |
Oops, something went wrong.