Skip to content

Commit

Permalink
准备添加状态机
Browse files Browse the repository at this point in the history
  • Loading branch information
ming1016 committed Nov 28, 2017
1 parent 5a66f33 commit a294763
Show file tree
Hide file tree
Showing 7 changed files with 86 additions and 14 deletions.
16 changes: 16 additions & 0 deletions GCDFetchFeed/GCDFetchFeed.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,10 @@
0A35AD6C1F45B41E00780172 /* DCHook.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DCHook.m; sourceTree = "<group>"; };
0A35AD711F45B48400780172 /* UIViewController+clsCall.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIViewController+clsCall.h"; sourceTree = "<group>"; };
0A35AD721F45B48400780172 /* UIViewController+clsCall.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIViewController+clsCall.m"; sourceTree = "<group>"; };
0A600C1D1FC4643E00771AF1 /* SMStateMachine.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SMStateMachine.m; sourceTree = "<group>"; };
0A600C1E1FC4643E00771AF1 /* SMStateMachine.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SMStateMachine.h; sourceTree = "<group>"; };
0A600C1F1FC4643E00771AF1 /* SMState.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SMState.h; sourceTree = "<group>"; };
0A600C201FC4643E00771AF1 /* SMState.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SMState.m; sourceTree = "<group>"; };
0A8B09DB1D6DA2BB00BE4FEC /* STMAssembleMaker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = STMAssembleMaker.h; sourceTree = "<group>"; };
0A8B09DC1D6DA2BB00BE4FEC /* STMAssembleMaker.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = STMAssembleMaker.m; sourceTree = "<group>"; };
0A8B09DD1D6DA2BB00BE4FEC /* STMAssembleView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = STMAssembleView.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -306,6 +310,17 @@
name = Hook;
sourceTree = "<group>";
};
0A600C1C1FC4640200771AF1 /* StateMachine */ = {
isa = PBXGroup;
children = (
0A600C1E1FC4643E00771AF1 /* SMStateMachine.h */,
0A600C1D1FC4643E00771AF1 /* SMStateMachine.m */,
0A600C1F1FC4643E00771AF1 /* SMState.h */,
0A600C201FC4643E00771AF1 /* SMState.m */,
);
name = StateMachine;
sourceTree = "<group>";
};
0A8B09DA1D6DA2AD00BE4FEC /* UI */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -363,6 +378,7 @@
3E58A8611C50B86C0026A610 /* Vendors */ = {
isa = PBXGroup;
children = (
0A600C1C1FC4640200771AF1 /* StateMachine */,
0A35AD6A1F45B41400780172 /* Hook */,
0A149B991DE5C9210000D58F /* Cache */,
0A8B09DA1D6DA2AD00BE4FEC /* UI */,
Expand Down
2 changes: 1 addition & 1 deletion GCDFetchFeed/GCDFetchFeed/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ @implementation AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
//这里是做卡顿监测
[[SMLagMonitor shareInstance] beginMonitor];
// [[SMLagMonitor shareInstance] beginMonitor];
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
//首页
SMRootViewController *rootVC = [[SMRootViewController alloc] init];
Expand Down
26 changes: 13 additions & 13 deletions GCDFetchFeed/GCDFetchFeed/SMRootViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -112,19 +112,19 @@ - (void)viewDidLoad {
[self.navigationController pushViewController:feedList animated:YES];
}];

//monitor
[self.view addSubview:self.stackBt];
[self.view addSubview:self.clsCallBt];
[self.clsCallBt mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(self.view).offset(20);
make.right.equalTo(self.view).offset(-10);
make.size.mas_equalTo(CGSizeMake(40, 40));
}];
[self.stackBt mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(self.clsCallBt);
make.right.equalTo(self.clsCallBt.mas_left).offset(-10);
make.size.mas_equalTo(CGSizeMake(40, 40));
}];
//monitor 显示性能监控
// [self.view addSubview:self.stackBt];
// [self.view addSubview:self.clsCallBt];
// [self.clsCallBt mas_makeConstraints:^(MASConstraintMaker *make) {
// make.top.equalTo(self.view).offset(20);
// make.right.equalTo(self.view).offset(-10);
// make.size.mas_equalTo(CGSizeMake(40, 40));
// }];
// [self.stackBt mas_makeConstraints:^(MASConstraintMaker *make) {
// make.top.equalTo(self.clsCallBt);
// make.right.equalTo(self.clsCallBt.mas_left).offset(-10);
// make.size.mas_equalTo(CGSizeMake(40, 40));
// }];
}

#pragma mark - private
Expand Down
12 changes: 12 additions & 0 deletions GCDFetchFeed/GCDFetchFeed/SMState.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
//
// SMState.h
// CarpoolBusiness
//
// Created by DaiMing on 2017/11/21.
//

#import <Foundation/Foundation.h>

@interface SMState : NSObject

@end
12 changes: 12 additions & 0 deletions GCDFetchFeed/GCDFetchFeed/SMState.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
//
// SMState.m
// CarpoolBusiness
//
// Created by DaiMing on 2017/11/21.
//

#import "SMState.h"

@implementation SMState

@end
20 changes: 20 additions & 0 deletions GCDFetchFeed/GCDFetchFeed/SMStateMachine.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
//
// SMStateMachine.h
// CarpoolBusiness
//
// Created by DaiMing on 2017/11/21.
//

#import <Foundation/Foundation.h>
@class SMState;

@interface SMStateMachine : NSObject
@property (nonatomic, readonly) NSSet *states;
@property (nonatomic, strong) SMState *currentState;

- (void)addStates:(NSArray *)states;

- (SMState *)stateNamed:(NSString *)name;


@end
12 changes: 12 additions & 0 deletions GCDFetchFeed/GCDFetchFeed/SMStateMachine.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
//
// SMStateMachine.m
// CarpoolBusiness
//
// Created by DaiMing on 2017/11/21.
//

#import "SMStateMachine.h"

@implementation SMStateMachine

@end

0 comments on commit a294763

Please sign in to comment.