Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
BB9z committed Nov 24, 2019
2 parents 20f0430 + 6239b1e commit 83b6f59
Show file tree
Hide file tree
Showing 9 changed files with 35 additions and 30 deletions.
11 changes: 6 additions & 5 deletions Example/iOS-Swift/RFDAPITestViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,12 @@ - (void)viewDidLoad {
r4.title = @"Empty object";
r4.APIName = @"ObjEmpty";
// r4 no progress

RFDAPITestRequestObject *r5 = [RFDAPITestRequestObject new];
r5.title = @"Fail request";
r5.APIName = @"NotFound";

self.items = @[ r1, r2, r3, r4 ];
self.items = @[ r1, r2, r3, r4, r5 ];
}

#pragma mark - List
Expand All @@ -54,10 +58,7 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
[RFDTestAPI requestWithName:requestDefine.APIName parameters:nil viewController:self forceLoad:NO loadingMessage:requestDefine.message modal:requestDefine.modal success:^(AFHTTPRequestOperation *operation, id responseObject) {
@strongify(self);
[self displayResponse:responseObject error:nil];
} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
@strongify(self);
[self displayResponse:nil error:error];
} completion:nil];
} failure:nil completion:nil];
}

- (void)displayResponse:(id)responseObject error:(NSError *)error {
Expand Down
8 changes: 4 additions & 4 deletions Example/iOS-Swift/RFDTestAPI.m
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#import "RFDTestAPI.h"
#import "AFURLResponseSerialization.h"
#import <RFMessageManager/RFSVProgressMessageManager.h>
#import <RFMessageManager/RFNetworkActivityIndicatorMessage.h>
#import <RFMessageManager/RFNetworkActivityMessage.h>

@interface RFDTestAPI ()
@end
Expand All @@ -13,7 +13,7 @@ + (instancetype)sharedInstance {
static id sharedInstance = nil;
static dispatch_once_t oncePredicate;
dispatch_once(&oncePredicate, ^{
sharedInstance = [[self alloc] init];
sharedInstance = [self.alloc init];
});
return sharedInstance;
}
Expand All @@ -32,13 +32,13 @@ - (void)onInit {
+ (AFHTTPRequestOperation *)requestWithName:(NSString *)APIName parameters:(NSDictionary *)parameters viewController:(UIViewController *)viewController forceLoad:(BOOL)forceLoad loadingMessage:(NSString *)message modal:(BOOL)modal success:(void (^)(AFHTTPRequestOperation *, id))success failure:(void (^)(AFHTTPRequestOperation *operation, NSError *error))failure completion:(void (^)(AFHTTPRequestOperation *))completion {
RFAPIControl *cn = [[RFAPIControl alloc] init];
if (message) {
cn.message = [[RFNetworkActivityIndicatorMessage alloc] initWithIdentifier:APIName title:nil message:message status:RFNetworkActivityIndicatorStatusLoading];
cn.message = [[RFNetworkActivityMessage alloc] initWithIdentifier:APIName message:message status:RFNetworkActivityStatusLoading];
cn.message.modal = modal;
}
cn.identifier = APIName;
cn.groupIdentifier = viewController.APIGroupIdentifier;
cn.forceLoad = forceLoad;
return [[self sharedInstance] requestWithName:APIName parameters:parameters controlInfo:cn success:success failure:failure completion:completion];
return [self.sharedInstance requestWithName:APIName parameters:parameters controlInfo:cn success:success failure:failure completion:completion];
}

@end
Expand Down
7 changes: 7 additions & 0 deletions Example/iOS-Swift/TestAPIDefine.plist
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,12 @@
<key>Response Class</key>
<string>RFDTestEntity</string>
</dict>
<key>NotFound</key>
<dict>
<key>Path</key>
<string>404.json</string>
<key>Response Type</key>
<integer>0</integer>
</dict>
</dict>
</plist>
2 changes: 1 addition & 1 deletion Podfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

target 'Example-iOS' do
platform :ios, '8.0'
pod 'RFMessageManager', :subspecs => ['SVProgressHUD']
pod 'RFMessageManager', :subspecs => ['SVProgressHUD'], :git => 'https://github.com/RFUI/RFMessageManager.git', :branch => 'develop'
pod 'RFAPI', :path => '.'

target 'Test-iOS' do
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ pod 'RFAPI'
Specify develop branch to install the lastest version:

```ruby
pod 'RFMessageManager',
pod 'RFAPI',
:git => 'https://github.com/RFUI/RFAPI.git',
:branch => 'develop'
```
4 changes: 2 additions & 2 deletions RFAPI.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
@class AFSecurityPolicy;
@protocol AFMultipartFormData;

@class RFMessageManager, RFNetworkActivityIndicatorMessage, AFHTTPRequestOperation;
@class RFMessageManager, RFNetworkActivityMessage, AFHTTPRequestOperation;
@class RFAPIControl, RFHTTPRequestFormData;


Expand Down Expand Up @@ -171,7 +171,7 @@ extern NSString *_Nonnull const RFAPIRequestCustomizationControlKey;
/** Activity message.
请求开始前,自动进入消息显示队列。结束时自动从队列中清除。
*/
@property (nullable, strong) RFNetworkActivityIndicatorMessage *message;
@property (nullable, strong) RFNetworkActivityMessage *message;

/// Identifier for request.
@property (nullable, copy) NSString *identifier;
Expand Down
8 changes: 4 additions & 4 deletions RFAPI.m
Original file line number Diff line number Diff line change
Expand Up @@ -121,12 +121,12 @@ - (nullable AFHTTPRequestOperation *)requestWithName:(nonnull NSString *)APIName

// Request object get ready.
// Build operation block.
RFNetworkActivityIndicatorMessage *message = controlInfo.message;
RFNetworkActivityMessage *message = controlInfo.message;
void (^operationCompletion)(id) = ^(AFHTTPRequestOperation *blockOp) {
dispatch_async_on_main(^{
NSString *mid = message.identifier;
if (mid) {
[self.networkActivityIndicatorManager hideWithIdentifier:mid];
[self.networkActivityIndicatorManager hideMessage:message];
}

if (completion) {
Expand Down Expand Up @@ -157,7 +157,7 @@ - (nullable AFHTTPRequestOperation *)requestWithName:(nonnull NSString *)APIName
failure(blockOp, blockError);
}
else {
[self.networkActivityIndicatorManager alertError:blockError title:@"请求失败"];
[self.networkActivityIndicatorManager alertError:blockError title:nil fallbackMessage:@"Request Failed"];
}
};
operationCompletion(blockOp);
Expand Down Expand Up @@ -417,7 +417,7 @@ - (nonnull id)initWithIdentifier:(nonnull NSString *)identifier loadingMessage:(
self = [super init];
if (self) {
_identifier = identifier;
_message = [[RFNetworkActivityIndicatorMessage alloc] initWithIdentifier:identifier title:nil message:message status:RFNetworkActivityIndicatorStatusLoading];
_message = [[RFNetworkActivityMessage alloc] initWithIdentifier:identifier message:message status:RFNetworkActivityStatusLoading];
}
return self;
}
Expand Down
8 changes: 4 additions & 4 deletions RFAPI.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'RFAPI'
s.version = '1.1.0'
s.version = '1.2.0'
s.summary = 'API Manager.'

s.homepage = 'https://github.com/RFUI/RFAPI'
Expand All @@ -13,7 +13,7 @@ Pod::Spec.new do |s|

s.requires_arc = true
s.osx.deployment_target = '10.8'
s.ios.deployment_target = '7.0'
s.ios.deployment_target = '8.0'
# s.tvos.deployment_target = '9.0'

s.dependency 'JSONModel'
Expand All @@ -22,8 +22,8 @@ Pod::Spec.new do |s|
s.dependency 'RFKit/Category/NSDictionary'
s.dependency 'RFKit/Category/NSFileManager'
s.dependency 'RFInitializing', '>= 1.1'
s.dependency 'RFMessageManager/Manager', '>= 0.3'
s.dependency 'RFMessageManager/RFNetworkActivityIndicatorMessage'
s.dependency 'RFMessageManager/Manager', '>= 0.5'
s.dependency 'RFMessageManager/RFNetworkActivityMessage'
s.source_files = ['*.{h,m}', 'RFAPIDefine/*.{h,m}']
s.public_header_files = ['*.h', 'RFAPIDefine/*.h']

Expand Down
15 changes: 6 additions & 9 deletions RFAPI.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,6 @@
D54183BE206B685000DD25CE = {
CreatedOnToolsVersion = 9.2;
LastSwiftMigration = 0920;
ProvisioningStyle = Automatic;
};
D54183D8206BBA7B00DD25CE = {
CreatedOnToolsVersion = 9.2;
Expand Down Expand Up @@ -369,7 +368,7 @@
files = (
);
inputPaths = (
"${SRCROOT}/Pods/Target Support Files/Pods-Example-iOS/Pods-Example-iOS-resources.sh",
"${PODS_ROOT}/Target Support Files/Pods-Example-iOS/Pods-Example-iOS-resources.sh",
"${PODS_ROOT}/SVProgressHUD/SVProgressHUD/SVProgressHUD.bundle",
);
name = "[CP] Copy Pods Resources";
Expand All @@ -378,7 +377,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Example-iOS/Pods-Example-iOS-resources.sh\"\n";
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Example-iOS/Pods-Example-iOS-resources.sh\"\n";
showEnvVarsInLog = 0;
};
59B0456C642D28AD86304270 /* [CP] Check Pods Manifest.lock */ = {
Expand Down Expand Up @@ -423,7 +422,7 @@
files = (
);
inputPaths = (
"${SRCROOT}/Pods/Target Support Files/Pods-Example-iOS-Test-iOS/Pods-Example-iOS-Test-iOS-resources.sh",
"${PODS_ROOT}/Target Support Files/Pods-Example-iOS-Test-iOS/Pods-Example-iOS-Test-iOS-resources.sh",
"${PODS_ROOT}/SVProgressHUD/SVProgressHUD/SVProgressHUD.bundle",
);
name = "[CP] Copy Pods Resources";
Expand All @@ -432,7 +431,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Example-iOS-Test-iOS/Pods-Example-iOS-Test-iOS-resources.sh\"\n";
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Example-iOS-Test-iOS/Pods-Example-iOS-Test-iOS-resources.sh\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */
Expand Down Expand Up @@ -534,10 +533,9 @@
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = dwarf;
DEVELOPMENT_TEAM = "";
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu11;
Expand Down Expand Up @@ -600,10 +598,9 @@
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = "";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu11;
Expand Down

0 comments on commit 83b6f59

Please sign in to comment.