Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
O
Opple-iOS
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张杰
Opple-iOS
Commits
81beb6dc
Commit
81beb6dc
authored
Dec 01, 2016
by
曹云霄
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改项说明:优化网络请求、提示框
parent
6218ab28
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
79 additions
and
9 deletions
+79
-9
AppDelegate.m
Lighting/AppDelegate.m
+1
-2
XBLoadingView.h
Tools/LoadingView/XBLoadingView.h
+7
-1
XBLoadingView.m
Tools/LoadingView/XBLoadingView.m
+70
-6
PrefixHeader.pch
Tools/PrefixHeader.pch
+1
-0
No files found.
Lighting/AppDelegate.m
View file @
81beb6dc
...
@@ -88,13 +88,12 @@
...
@@ -88,13 +88,12 @@
{
{
[[
AFNetworkReachabilityManager
sharedManager
]
startMonitoring
];
[[
AFNetworkReachabilityManager
sharedManager
]
startMonitoring
];
[[
AFNetworkReachabilityManager
sharedManager
]
setReachabilityStatusChangeBlock
:
^
(
AFNetworkReachabilityStatus
status
)
{
[[
AFNetworkReachabilityManager
sharedManager
]
setReachabilityStatusChangeBlock
:
^
(
AFNetworkReachabilityStatus
status
)
{
switch
(
status
)
{
switch
(
status
)
{
case
AFNetworkReachabilityStatusUnknown
:
case
AFNetworkReachabilityStatusUnknown
:
case
AFNetworkReachabilityStatusNotReachable
:{
case
AFNetworkReachabilityStatusNotReachable
:{
NSLog
(
@"无网络"
);
NSLog
(
@"无网络"
);
[
XBLoadingView
showHUDViewWithText
:
NETWORK
];
break
;
break
;
}
}
case
AFNetworkReachabilityStatusReachableViaWiFi
:{
case
AFNetworkReachabilityStatusReachableViaWiFi
:{
...
...
Tools/LoadingView/XBLoadingView.h
View file @
81beb6dc
...
@@ -23,6 +23,12 @@
...
@@ -23,6 +23,12 @@
*/
*/
+
(
void
)
showHUDViewWithText
:(
NSString
*
)
text
;
+
(
void
)
showHUDViewWithText
:(
NSString
*
)
text
;
/**
显示成功提示框
@param text 提示信息
*/
+
(
void
)
showHUDViewWithSuccessText
:(
NSString
*
)
text
;
/**
/**
显示进度框
显示进度框
...
@@ -31,7 +37,7 @@
...
@@ -31,7 +37,7 @@
@return XBLoadingView
@return XBLoadingView
*/
*/
+
(
instancetype
)
showHUDViewProgressLabel
:(
NSString
*
)
text
;
+
(
MBProgressHUD
*
)
showHUDViewProgressLabel
:(
NSString
*
)
text
;
/**
/**
隐藏加载框
隐藏加载框
...
...
Tools/LoadingView/XBLoadingView.m
View file @
81beb6dc
...
@@ -10,12 +10,76 @@
...
@@ -10,12 +10,76 @@
@implementation
XBLoadingView
@implementation
XBLoadingView
/*
/**
// Only override drawRect: if you perform custom drawing.
显示普通加载框
// An empty implementation adversely affects performance during animation.
*/
- (void)drawRect:(CGRect)rect {
+
(
void
)
showHUDViewWithDefault
// Drawing code
{
MBProgressHUD
*
hud
=
[
MBProgressHUD
showHUDAddedTo
:
SHARED_APPDELEGATE
.
window
animated
:
YES
];
hud
.
animationType
=
MBProgressHUDAnimationZoom
;
hud
.
mode
=
MBProgressHUDModeIndeterminate
;
hud
.
color
=
[
UIColor
clearColor
];
hud
.
activityIndicatorColor
=
kMainBlueColor
;
hud
.
removeFromSuperViewOnHide
=
YES
;
}
/**
显示文本提示框
@param text 提示信息
*/
+
(
void
)
showHUDViewWithText
:
(
NSString
*
)
text
{
MBProgressHUD
*
hud
=
[
MBProgressHUD
showHUDAddedTo
:
SHARED_APPDELEGATE
.
window
animated
:
YES
];
hud
.
labelText
=
text
;
hud
.
margin
=
20
.
f
;
hud
.
color
=
[[
UIColor
blackColor
]
colorWithAlphaComponent
:
0
.
5
];
hud
.
animationType
=
MBProgressHUDAnimationZoom
;
hud
.
mode
=
MBProgressHUDModeText
;
hud
.
removeFromSuperViewOnHide
=
YES
;
[
hud
hide
:
YES
afterDelay
:
3
.
0
f
];
}
/**
显示成功提示框
@param text 提示信息
*/
+
(
void
)
showHUDViewWithSuccessText
:
(
NSString
*
)
text
{
MBProgressHUD
*
hud
=
[
MBProgressHUD
showHUDAddedTo
:
SHARED_APPDELEGATE
.
window
animated
:
YES
];
hud
.
mode
=
MBProgressHUDModeCustomView
;
UIImage
*
image
=
[[
UIImage
imageNamed
:
@"Checkmark"
]
imageWithRenderingMode
:
UIImageRenderingModeAlwaysOriginal
];
hud
.
customView
=
[[
UIImageView
alloc
]
initWithImage
:
image
];
hud
.
color
=
[[
UIColor
blackColor
]
colorWithAlphaComponent
:
0
.
6
];
hud
.
labelFont
=
[
UIFont
systemFontOfSize
:
15
];
hud
.
labelText
=
text
;
[
hud
hide
:
YES
afterDelay
:
3
];
}
/**
显示进度框
@param text 提示信息
@return XBLoadingView
*/
+
(
MBProgressHUD
*
)
showHUDViewProgressLabel
:
(
NSString
*
)
text
{
MBProgressHUD
*
hud
=
[
MBProgressHUD
showHUDAddedTo
:
SHARED_APPDELEGATE
.
window
animated
:
YES
];
hud
.
mode
=
MBProgressHUDModeDeterminate
;
hud
.
labelText
=
text
;
hud
.
labelFont
=
[
UIFont
systemFontOfSize
:
12
];
hud
.
removeFromSuperViewOnHide
=
YES
;
return
hud
;
}
/**
隐藏加载框
*/
+
(
void
)
hideHUDViewWithDefault
{
[[
self
class
]
hideHUDForView
:
SHARED_APPDELEGATE
.
window
animated
:
YES
];
}
}
*/
@end
@end
Tools/PrefixHeader.pch
View file @
81beb6dc
...
@@ -38,6 +38,7 @@
...
@@ -38,6 +38,7 @@
#import "XLPlainFlowLayout.h"
#import "XLPlainFlowLayout.h"
#import "MDScratchImageView.h"
#import "MDScratchImageView.h"
#import "WYPopoverController.h"
#import "WYPopoverController.h"
#import "XBLoadingView.h"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment