123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- //
- // MTCreatQunViewModel.m
- //
- // Created by Simon on 2019/8/16.
- // Copyright © 2019 Simon. All rights reserved.
- //
- #import "MTCreatQunViewModel.h"
- @implementation MTCreatQunViewModel
- -(NSArray *)listArray{
- if (!_listArray) {
- _listArray = [NSArray array];
- }
- return _listArray;
- }
- - (RACCommand *)command {
- if (!_command) {
- _command = [[RACCommand alloc] initWithSignalBlock:^RACSignal * _Nonnull(id _Nullable input) {
- return [RACSignal createSignal:^RACDisposable * _Nullable(id<RACSubscriber> _Nonnull subscriber) {
- [MTHttpTool httpRequest:HttpRequestTypeOfPOST url:HTTP_SEVER_APPEND(@"") para:input success:^(MTBaseModel *baseModel) {
- [baseModel clarifyResultWithSuccess:^{
- [subscriber sendNext:baseModel.data];
- } failed:^(NSInteger code) {
- ShowMessage(baseModel.msg);
- }];
- [subscriber sendCompleted];
- } failure:^(NSError *error) {
- ShowMessage(@"网络链接失败");
- [subscriber sendCompleted];
- }];
- return nil;
- }];
- }];
- }
- return _command;
- }
- - (RACSubject *)subject {
- if (!_subject) {
- _subject = [RACSubject subject];
- }
- return _subject;
- }
- @end
|