Compare commits

...

4 Commits

Author SHA1 Message Date
liyuhua
6116d259c2 企业包20.20.2 2023-10-31 11:30:24 +08:00
liyuhua
ae8d0804e1 公屏卡顿问题 2023-10-26 16:50:26 +08:00
liyuhua
cab4294e86 公屏卡顿问题 2023-10-26 16:31:32 +08:00
liyuhua
80eddb8c3d 公屏卡顿问题 2023-10-26 16:20:23 +08:00
9 changed files with 181 additions and 102 deletions

View File

@@ -82,6 +82,10 @@ post_install do |installer|
project.targets.each do |target| project.targets.each do |target|
target.build_configurations.each do |config| target.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '11.0' config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '11.0'
xcconfig_path = config.base_configuration_reference.real_path
xcconfig = File.read(xcconfig_path)
xcconfig_mod = xcconfig.gsub(/DT_TOOLCHAIN_DIR/, "TOOLCHAIN_DIR")
File.open(xcconfig_path, "w") { |file| file << xcconfig_mod }
end end
end end
end end

View File

@@ -3,7 +3,7 @@
archiveVersion = 1; archiveVersion = 1;
classes = { classes = {
}; };
objectVersion = 51; objectVersion = 54;
objects = { objects = {
/* Begin PBXBuildFile section */ /* Begin PBXBuildFile section */
@@ -345,6 +345,7 @@
23E9EB252A84E98300B792F2 /* pi_new_mine_info_online.svga in Resources */ = {isa = PBXBuildFile; fileRef = 23E9EB232A84E98300B792F2 /* pi_new_mine_info_online.svga */; }; 23E9EB252A84E98300B792F2 /* pi_new_mine_info_online.svga in Resources */ = {isa = PBXBuildFile; fileRef = 23E9EB232A84E98300B792F2 /* pi_new_mine_info_online.svga */; };
23E9EB312A85E5D100B792F2 /* pi_app_logo_new_bg.png in Resources */ = {isa = PBXBuildFile; fileRef = 23E9EB302A85E5D100B792F2 /* pi_app_logo_new_bg.png */; }; 23E9EB312A85E5D100B792F2 /* pi_app_logo_new_bg.png in Resources */ = {isa = PBXBuildFile; fileRef = 23E9EB302A85E5D100B792F2 /* pi_app_logo_new_bg.png */; };
23E9EB332A85E97C00B792F2 /* pi_login_new_logo.png in Resources */ = {isa = PBXBuildFile; fileRef = 23E9EB322A85E97B00B792F2 /* pi_login_new_logo.png */; }; 23E9EB332A85E97C00B792F2 /* pi_login_new_logo.png in Resources */ = {isa = PBXBuildFile; fileRef = 23E9EB322A85E97B00B792F2 /* pi_login_new_logo.png */; };
23F364322AF0A7E100286D79 /* YYTextAsyncLayer+XPTextAsyncLayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 23F364312AF0A7E100286D79 /* YYTextAsyncLayer+XPTextAsyncLayer.m */; };
23FF255B2AB956D50064E904 /* pi_home_new_pk.svga in Resources */ = {isa = PBXBuildFile; fileRef = 23FF255A2AB956D50064E904 /* pi_home_new_pk.svga */; }; 23FF255B2AB956D50064E904 /* pi_home_new_pk.svga in Resources */ = {isa = PBXBuildFile; fileRef = 23FF255A2AB956D50064E904 /* pi_home_new_pk.svga */; };
23FF25622ABAE6310064E904 /* pi_room_game_fine_love.svga in Resources */ = {isa = PBXBuildFile; fileRef = 23FF25612ABAE6310064E904 /* pi_room_game_fine_love.svga */; }; 23FF25622ABAE6310064E904 /* pi_room_game_fine_love.svga in Resources */ = {isa = PBXBuildFile; fileRef = 23FF25612ABAE6310064E904 /* pi_room_game_fine_love.svga */; };
23FF25652ABC3B3C0064E904 /* XPHomeGameView.m in Sources */ = {isa = PBXBuildFile; fileRef = 23FF25642ABC3B3B0064E904 /* XPHomeGameView.m */; }; 23FF25652ABC3B3C0064E904 /* XPHomeGameView.m in Sources */ = {isa = PBXBuildFile; fileRef = 23FF25642ABC3B3B0064E904 /* XPHomeGameView.m */; };
@@ -2103,6 +2104,8 @@
23E9EB232A84E98300B792F2 /* pi_new_mine_info_online.svga */ = {isa = PBXFileReference; lastKnownFileType = file; path = pi_new_mine_info_online.svga; sourceTree = "<group>"; }; 23E9EB232A84E98300B792F2 /* pi_new_mine_info_online.svga */ = {isa = PBXFileReference; lastKnownFileType = file; path = pi_new_mine_info_online.svga; sourceTree = "<group>"; };
23E9EB302A85E5D100B792F2 /* pi_app_logo_new_bg.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = pi_app_logo_new_bg.png; sourceTree = "<group>"; }; 23E9EB302A85E5D100B792F2 /* pi_app_logo_new_bg.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = pi_app_logo_new_bg.png; sourceTree = "<group>"; };
23E9EB322A85E97B00B792F2 /* pi_login_new_logo.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = pi_login_new_logo.png; sourceTree = "<group>"; }; 23E9EB322A85E97B00B792F2 /* pi_login_new_logo.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = pi_login_new_logo.png; sourceTree = "<group>"; };
23F364302AF0A7E000286D79 /* YYTextAsyncLayer+XPTextAsyncLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "YYTextAsyncLayer+XPTextAsyncLayer.h"; sourceTree = "<group>"; };
23F364312AF0A7E100286D79 /* YYTextAsyncLayer+XPTextAsyncLayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "YYTextAsyncLayer+XPTextAsyncLayer.m"; sourceTree = "<group>"; };
23FF255A2AB956D50064E904 /* pi_home_new_pk.svga */ = {isa = PBXFileReference; lastKnownFileType = file; path = pi_home_new_pk.svga; sourceTree = "<group>"; }; 23FF255A2AB956D50064E904 /* pi_home_new_pk.svga */ = {isa = PBXFileReference; lastKnownFileType = file; path = pi_home_new_pk.svga; sourceTree = "<group>"; };
23FF25612ABAE6310064E904 /* pi_room_game_fine_love.svga */ = {isa = PBXFileReference; lastKnownFileType = file; path = pi_room_game_fine_love.svga; sourceTree = "<group>"; }; 23FF25612ABAE6310064E904 /* pi_room_game_fine_love.svga */ = {isa = PBXFileReference; lastKnownFileType = file; path = pi_room_game_fine_love.svga; sourceTree = "<group>"; };
23FF25632ABC3B3B0064E904 /* XPHomeGameView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XPHomeGameView.h; sourceTree = "<group>"; }; 23FF25632ABC3B3B0064E904 /* XPHomeGameView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XPHomeGameView.h; sourceTree = "<group>"; };
@@ -6834,6 +6837,8 @@
2323E0362ABDAE8F00CCAD2F /* FBSDKSettings+PISDKSettings.m */, 2323E0362ABDAE8F00CCAD2F /* FBSDKSettings+PISDKSettings.m */,
E81C27AC26EF39AB0031E639 /* AppDelegate+ThirdConfig.h */, E81C27AC26EF39AB0031E639 /* AppDelegate+ThirdConfig.h */,
E81C27AD26EF39AB0031E639 /* AppDelegate+ThirdConfig.m */, E81C27AD26EF39AB0031E639 /* AppDelegate+ThirdConfig.m */,
23F364302AF0A7E000286D79 /* YYTextAsyncLayer+XPTextAsyncLayer.h */,
23F364312AF0A7E100286D79 /* YYTextAsyncLayer+XPTextAsyncLayer.m */,
); );
path = AppDelegate; path = AppDelegate;
sourceTree = "<group>"; sourceTree = "<group>";
@@ -11179,6 +11184,7 @@
9B044DA0282D32F700DE4859 /* MicroInviteExtModel.m in Sources */, 9B044DA0282D32F700DE4859 /* MicroInviteExtModel.m in Sources */,
E8D7D74B282BA1EC0007D7BD /* XPMonentsTableViewCell.m in Sources */, E8D7D74B282BA1EC0007D7BD /* XPMonentsTableViewCell.m in Sources */,
E8D34D5A28082357009C4835 /* UserGiftWallInfoModel.m in Sources */, E8D34D5A28082357009C4835 /* UserGiftWallInfoModel.m in Sources */,
23F364322AF0A7E100286D79 /* YYTextAsyncLayer+XPTextAsyncLayer.m in Sources */,
E82107842987E35300DE7040 /* MessageMonentsAutoModel.m in Sources */, E82107842987E35300DE7040 /* MessageMonentsAutoModel.m in Sources */,
189DD52E26DE255300AB55B1 /* AppDelegate.m in Sources */, 189DD52E26DE255300AB55B1 /* AppDelegate.m in Sources */,
E83DB4842746661800D8CBD1 /* XPRoomGiftBroadcastView.m in Sources */, E83DB4842746661800D8CBD1 /* XPRoomGiftBroadcastView.m in Sources */,
@@ -11813,7 +11819,7 @@
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
MARKETING_VERSION = 20.10.0; MARKETING_VERSION = 20.10.2;
PRODUCT_BUNDLE_IDENTIFIER = com.peko.enterprise.ios; PRODUCT_BUNDLE_IDENTIFIER = com.peko.enterprise.ios;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = ""; PROVISIONING_PROFILE_SPECIFIER = "";
@@ -11848,7 +11854,7 @@
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
MARKETING_VERSION = 20.10.0; MARKETING_VERSION = 20.10.2;
PRODUCT_BUNDLE_IDENTIFIER = com.peko.enterprise.ios; PRODUCT_BUNDLE_IDENTIFIER = com.peko.enterprise.ios;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = ""; PROVISIONING_PROFILE_SPECIFIER = "";

View File

@@ -0,0 +1,16 @@
//
// YYTextAsyncLayer+XPTextAsyncLayer.h
// xplan-ios
//
// Created by duoban on 2023/10/28.
//
#import <YYText/YYTextAsyncLayer.h>
NS_ASSUME_NONNULL_BEGIN
@interface YYTextAsyncLayer (XPTextAsyncLayer)
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,26 @@
//
// YYTextAsyncLayer+XPTextAsyncLayer.m
// xplan-ios
//
// Created by duoban on 2023/10/28.
//
#import "YYTextAsyncLayer+XPTextAsyncLayer.h"
@implementation YYTextAsyncLayer (XPTextAsyncLayer)
///iOS17bug退
+(void)load {
Method xp_displayMethod = class_getInstanceMethod(self, @selector(display));
Method xp_swizzingMethod = class_getInstanceMethod(self, @selector(xp_swizzing_display));
method_exchangeImplementations(xp_displayMethod, xp_swizzingMethod);
}
-(void)xp_swizzing_display{
//
if (self.bounds.size.width <= 0 || self.bounds.size.height <= 0) {
self.contents = nil;
return;
} else {
[self xp_swizzing_display];
}
}
@end

View File

@@ -49,7 +49,7 @@ isPhoneXSeries = [[UIApplication sharedApplication] delegate].window.safeAreaIns
#define PI_App_Version @"2.1.0" #define PI_App_Version @"2.1.2"
#ifdef DEBUG #ifdef DEBUG
#define API_HOST_URL [NSString stringWithFormat:@"%@%@",@"http://beta.api",@".pekolive.com"] #define API_HOST_URL [NSString stringWithFormat:@"%@%@",@"http://beta.api",@".pekolive.com"]

View File

@@ -1202,18 +1202,19 @@
CGFloat scale = image.size.width / image.size.height; CGFloat scale = image.size.width / image.size.height;
imageView.bounds = CGRectMake(0, 0, 18 * scale, 18); imageView.bounds = CGRectMake(0, 0, 18 * scale, 18);
} else { } else {
NSURL *imgUrl = [NSURL URLWithString:imageName]; // NSURL *imgUrl = [NSURL URLWithString:imageName];
UIImage *myImage = [UIImage imageWithData:[NSData dataWithContentsOfURL:imgUrl]]; //
if (myImage) { // UIImage *myImage = [UIImage imageWithData:[NSData dataWithContentsOfURL:imgUrl]];
CGFloat scale = myImage.size.width / myImage.size.height; // if (myImage) {
if (scale == 0) { // CGFloat scale = myImage.size.width / myImage.size.height;
imageView.bounds = CGRectMake(0, 0, 60, 18); // if (scale == 0) {
}else { // imageView.bounds = CGRectMake(0, 0, 60, 18);
imageView.bounds = CGRectMake(0, 0, 18* scale, 18); // }else {
} // imageView.bounds = CGRectMake(0, 0, 18* scale, 18);
} else { // }
// } else {
imageView.bounds = CGRectMake(0, 0, 60, 18); imageView.bounds = CGRectMake(0, 0, 60, 18);
} // }
} }
imageView.contentMode = UIViewContentModeScaleAspectFit; imageView.contentMode = UIViewContentModeScaleAspectFit;
// //

View File

@@ -74,6 +74,7 @@ NSString * const kRoomShowTopicKey = @"kRoomShowTopicKey";
/// ///
@property (nonatomic,assign) BOOL isLarge; @property (nonatomic,assign) BOOL isLarge;
@property(nonatomic,strong) PIRoomPhotoAlbumItemModel *lookUpModel; @property(nonatomic,strong) PIRoomPhotoAlbumItemModel *lookUpModel;
@property(nonatomic,assign) BOOL isLoadHistoryMessage;
@end @end
@@ -86,6 +87,7 @@ NSString * const kRoomShowTopicKey = @"kRoomShowTopicKey";
- (instancetype)initWithDelegate:(id<RoomHostDelegate>)delegate { - (instancetype)initWithDelegate:(id<RoomHostDelegate>)delegate {
self = [super init]; self = [super init];
if (self) { if (self) {
self.isLoadHistoryMessage = YES;
self.hostDelegate = delegate; self.hostDelegate = delegate;
[self initSubViews]; [self initSubViews];
[self initSubViewConstraints]; [self initSubViewConstraints];
@@ -286,6 +288,7 @@ NSString * const kRoomShowTopicKey = @"kRoomShowTopicKey";
#pragma mark - #pragma mark -
/// ///
- (void)addRoomMessage:(NIMMessage *)message { - (void)addRoomMessage:(NIMMessage *)message {
if(self.isLoadHistoryMessage == YES)return;
[self.incomingMessages addObject:message]; [self.incomingMessages addObject:message];
if (!self.isMiniEnter) {/// if (!self.isMiniEnter) {///
if (self.hostDelegate.getRoomInfo.isCloseScreen) { if (self.hostDelegate.getRoomInfo.isCloseScreen) {
@@ -711,78 +714,99 @@ NSString * const kRoomShowTopicKey = @"kRoomShowTopicKey";
option.order = NIMMessageSearchOrderDesc; option.order = NIMMessageSearchOrderDesc;
option.messageTypes = @[@(NIMMessageTypeText)]; option.messageTypes = @[@(NIMMessageTypeText)];
[[NIMSDK sharedSDK].chatroomManager fetchMessageHistory:roomId option:option result:^(NSError * _Nullable error, NSArray<NIMMessage *> * _Nullable messages) { [[NIMSDK sharedSDK].chatroomManager fetchMessageHistory:roomId option:option result:^(NSError * _Nullable error, NSArray<NIMMessage *> * _Nullable messages) {
if (self.datasource.count > kRoomMessageMaxLength) { dispatch_async(dispatch_get_main_queue(), ^{///UI,线UI
NSIndexSet *set = [NSIndexSet indexSetWithIndexesInRange:NSMakeRange(0, kRoomMessageMaxLength/2)]; if (self.datasource.count > kRoomMessageMaxLength) {
NSArray *needRemoveMsgArray = [self.datasource objectsAtIndexes:set]; NSIndexSet *set = [NSIndexSet indexSetWithIndexesInRange:NSMakeRange(0, kRoomMessageMaxLength/2)];
[self.datasource removeObjectsInArray:needRemoveMsgArray]; NSArray *needRemoveMsgArray = [self.datasource objectsAtIndexes:set];
} [self.datasource removeObjectsInArray:needRemoveMsgArray];
// }
for (NIMMessage *item in messages.reverseObjectEnumerator) { //
[self.datasource addObject:[self.messageParser parseMessageAttribute:item]]; for (NIMMessage *item in messages.reverseObjectEnumerator) {
if (!self.isMiniEnter) {/// [self.datasource addObject:[self.messageParser parseMessageAttribute:item]];
if (self.hostDelegate.getRoomInfo.isCloseScreen) { if (!self.isMiniEnter) {///
NIMCustomObject *obj = (NIMCustomObject *)item.messageObject; if (self.hostDelegate.getRoomInfo.isCloseScreen) {
if (obj.attachment != nil && [obj.attachment isKindOfClass:[AttachmentModel class]]) { NIMCustomObject *obj = (NIMCustomObject *)item.messageObject;
AttachmentModel *attachment = (AttachmentModel *)obj.attachment; if (obj.attachment != nil && [obj.attachment isKindOfClass:[AttachmentModel class]]) {
if (attachment.first == CustomMessageType_Update_RoomInfo && attachment.second == Custom_Message_Sub_Update_RoomInfo_MessageState){ AttachmentModel *attachment = (AttachmentModel *)obj.attachment;
[[XPRoomMiniManager shareManager] saveRoomMessage:item]; if (attachment.first == CustomMessageType_Update_RoomInfo && attachment.second == Custom_Message_Sub_Update_RoomInfo_MessageState){
[[XPRoomMiniManager shareManager] saveRoomMessage:item];
}
} }
} else {
[[XPRoomMiniManager shareManager] saveRoomMessage:item];
} }
} else {
[[XPRoomMiniManager shareManager] saveRoomMessage:item];
} }
} }
} self.isLoadHistoryMessage = NO;
[self.messageTableView reloadData]; [self.messageTableView reloadData];
// //
[self scrollToBottom:YES]; [self scrollToBottom:YES];
BOOL hideEnter = [self handleHideEnter:message]; BOOL hideEnter = [self handleHideEnter:message];
if (!hideEnter) { if (!hideEnter) {
/// ///
[self addRoomMessage:message]; [self addRoomMessage:message];
} }
if (!roomInfo.hasAnimationEffect) { if (!roomInfo.hasAnimationEffect) {
[self roomInfoNoGiftAnimationMessage:message]; [self roomInfoNoGiftAnimationMessage:message];
} }
[self createUserEnterRoomAddRoomtopicMessage]; [self createUserEnterRoomAddRoomtopicMessage];
}]; });
}];
return; return;
} }
if (self.datasource.count > kRoomMessageMaxLength) { dispatch_async(dispatch_get_main_queue(), ^{
NSIndexSet *set = [NSIndexSet indexSetWithIndexesInRange:NSMakeRange(0, kRoomMessageMaxLength/2)]; if (self.datasource.count > kRoomMessageMaxLength) {
NSArray *needRemoveMsgArray = [self.datasource objectsAtIndexes:set]; NSIndexSet *set = [NSIndexSet indexSetWithIndexesInRange:NSMakeRange(0, kRoomMessageMaxLength/2)];
[self.datasource removeObjectsInArray:needRemoveMsgArray]; NSArray *needRemoveMsgArray = [self.datasource objectsAtIndexes:set];
} [self.datasource removeObjectsInArray:needRemoveMsgArray];
// }
for (NIMMessage *item in messages) { //
[self.datasource addObject:[self.messageParser parseMessageAttribute:item]]; for (NIMMessage *item in messages) {
if (!self.isMiniEnter) {/// [self.datasource addObject:[self.messageParser parseMessageAttribute:item]];
if (self.hostDelegate.getRoomInfo.isCloseScreen) { if (!self.isMiniEnter) {///
NIMCustomObject *obj = (NIMCustomObject *)item.messageObject; if (self.hostDelegate.getRoomInfo.isCloseScreen) {
if (obj.attachment != nil && [obj.attachment isKindOfClass:[AttachmentModel class]]) { NIMCustomObject *obj = (NIMCustomObject *)item.messageObject;
AttachmentModel *attachment = (AttachmentModel *)obj.attachment; if (obj.attachment != nil && [obj.attachment isKindOfClass:[AttachmentModel class]]) {
if (attachment.first == CustomMessageType_Update_RoomInfo && attachment.second == Custom_Message_Sub_Update_RoomInfo_MessageState){ AttachmentModel *attachment = (AttachmentModel *)obj.attachment;
[[XPRoomMiniManager shareManager] saveRoomMessage:item]; if (attachment.first == CustomMessageType_Update_RoomInfo && attachment.second == Custom_Message_Sub_Update_RoomInfo_MessageState){
[[XPRoomMiniManager shareManager] saveRoomMessage:item];
}
} }
} else {
[[XPRoomMiniManager shareManager] saveRoomMessage:item];
} }
} else {
[[XPRoomMiniManager shareManager] saveRoomMessage:item];
} }
} }
self.isLoadHistoryMessage = NO;
[self.messageTableView reloadData];
//
[self scrollToBottom:YES];
BOOL hideEnter = [self handleHideEnter:message];
if (!hideEnter) {
///
[self addRoomMessage:message];
}
if (!roomInfo.hasAnimationEffect) {
[self roomInfoNoGiftAnimationMessage:message];
}
[self createUserEnterRoomAddRoomtopicMessage];
});
}else{
dispatch_async(dispatch_get_main_queue(), ^{
self.isLoadHistoryMessage = NO;
BOOL hideEnter = [self handleHideEnter:message];
if (!hideEnter) {
///
[self addRoomMessage:message];
} }
[self.messageTableView reloadData]; if (!roomInfo.hasAnimationEffect) {
// [self roomInfoNoGiftAnimationMessage:message];
[self scrollToBottom:YES]; }
[self createUserEnterRoomAddRoomtopicMessage];
});
} }
BOOL hideEnter = [self handleHideEnter:message];
if (!hideEnter) {
///
[self addRoomMessage:message];
}
if (!roomInfo.hasAnimationEffect) {
[self roomInfoNoGiftAnimationMessage:message];
}
[self createUserEnterRoomAddRoomtopicMessage];
}]; }];
} }

View File

@@ -454,7 +454,9 @@
// //
NSString * sessionId = [NSString stringWithFormat:@"%ld", roomInfo.roomId]; NSString * sessionId = [NSString stringWithFormat:@"%ld", roomInfo.roomId];
NIMSession *session = [NIMSession session:sessionId type:NIMSessionTypeChatroom]; NIMSession *session = [NIMSession session:sessionId type:NIMSessionTypeChatroom];
[[NIMSDK sharedSDK].chatManager sendMessage:message toSession:session error:nil]; [[NIMSDK sharedSDK].chatManager sendMessage:message toSession:session completion:^(NSError * _Nullable error) {
}];
} }
} roomUid:roomUid micUid:uid position:position uid:uid]; } roomUid:roomUid micUid:uid position:position uid:uid];
} }

View File

@@ -412,32 +412,32 @@ UIKIT_EXTERN NSString *kTabShowAnchorCardKey;
} }
#pragma mark - #pragma mark -
- (void)networkReachability{ - (void)networkReachability{
@kWeakify(self); // @kWeakify(self);
[[AFNetworkReachabilityManager sharedManager] startMonitoring]; // [[AFNetworkReachabilityManager sharedManager] startMonitoring];
[[AFNetworkReachabilityManager sharedManager] setReachabilityStatusChangeBlock:^(AFNetworkReachabilityStatus status) { // [[AFNetworkReachabilityManager sharedManager] setReachabilityStatusChangeBlock:^(AFNetworkReachabilityStatus status) {
@kStrongify(self); // @kStrongify(self);
switch (status) { // switch (status) {
case AFNetworkReachabilityStatusUnknown: // case AFNetworkReachabilityStatusUnknown:
self.isFirstReachability = YES; // self.isFirstReachability = YES;
break; // break;
case AFNetworkReachabilityStatusNotReachable: // case AFNetworkReachabilityStatusNotReachable:
self.isFirstReachability = YES; // self.isFirstReachability = YES;
break; // break;
case AFNetworkReachabilityStatusReachableViaWWAN: // case AFNetworkReachabilityStatusReachableViaWWAN:
case AFNetworkReachabilityStatusReachableViaWiFi: // case AFNetworkReachabilityStatusReachableViaWiFi:
{ // {
if (self.isFirstReachability) { // if (self.isFirstReachability) {
[[NSNotificationCenter defaultCenter] postNotificationName:kNetworkReachabilityKey object:nil userInfo:nil]; // [[NSNotificationCenter defaultCenter] postNotificationName:kNetworkReachabilityKey object:nil userInfo:nil];
[self.presenter autoLogin]; // [self.presenter autoLogin];
[[ClientConfig shareConfig] clientInit]; // [[ClientConfig shareConfig] clientInit];
} // }
self.isFirstReachability = YES; // self.isFirstReachability = YES;
} // }
break; // break;
default: // default:
break; // break;
} // }
}]; // }];
} }
#pragma mark - BaseMvpProtocol #pragma mark - BaseMvpProtocol