Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
S
SuperCleaner
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lmj
SuperCleaner
Commits
f893e762
Commit
f893e762
authored
Aug 07, 2020
by
lmj_521aiau@163.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
日历 提醒 优化
parent
f2bbc23d
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
36 additions
and
29 deletions
+36
-29
ICHomeViewController.m
superCleaner/Home/Controller/ICHomeViewController.m
+7
-7
ICUserManager.m
superCleaner/Manager/ICUserManager.m
+0
-1
WMEventCalendarTool.m
superCleaner/Manager/WMEventCalendarTool.m
+14
-9
ICCalendarManageController.m
superCleaner/Other/ICCalendarManageController.m
+6
-3
superCleaner-PrefixHeader.pch
superCleaner/superCleaner-PrefixHeader.pch
+9
-9
No files found.
superCleaner/Home/Controller/ICHomeViewController.m
View file @
f893e762
...
@@ -78,7 +78,7 @@
...
@@ -78,7 +78,7 @@
-
(
void
)
viewDidAppear
:
(
BOOL
)
animated
{
-
(
void
)
viewDidAppear
:
(
BOOL
)
animated
{
[
super
viewDidAppear
:
animated
];
[
super
viewDidAppear
:
animated
];
//
[self.headerView.smartClearButton addRadarAnimation];
[
self
.
headerView
.
smartClearButton
addRadarAnimation
];
}
}
-
(
void
)
viewWillAppear
:
(
BOOL
)
animated
{
-
(
void
)
viewWillAppear
:
(
BOOL
)
animated
{
...
@@ -371,14 +371,14 @@
...
@@ -371,14 +371,14 @@
break
;
break
;
case
6
:
case
6
:
{
{
if
([
ICUserManager
shared
].
isMember
)
{
//
if ([ICUserManager shared].isMember) {
ICBatteryCareViewController
*
vc
=
[[
ICBatteryCareViewController
alloc
]
init
];
ICBatteryCareViewController
*
vc
=
[[
ICBatteryCareViewController
alloc
]
init
];
[
self
.
navigationController
pushViewController
:
vc
animated
:
true
];
[
self
.
navigationController
pushViewController
:
vc
animated
:
true
];
}
else
{
//
}else {
ICIAPViewController
*
iapVC
=
[[
UIStoryboard
storyboardWithName
:
@"Main"
bundle
:
nil
]
instantiateViewControllerWithIdentifier
:
@"ICIAPViewController"
];
//
ICIAPViewController *iapVC = [[UIStoryboard storyboardWithName:@"Main" bundle: nil] instantiateViewControllerWithIdentifier:@"ICIAPViewController"];
ICNavigationController
*
navc
=
[[
ICNavigationController
alloc
]
initWithRootViewController
:
iapVC
];
//
ICNavigationController *navc = [[ICNavigationController alloc] initWithRootViewController:iapVC];
[
self
presentViewController
:
navc
animated
:
true
completion
:
nil
];
//
[self presentViewController:navc animated:true completion:nil];
}
//
}
}
}
break
;
break
;
default
:
default
:
...
...
superCleaner/Manager/ICUserManager.m
View file @
f893e762
...
@@ -180,5 +180,4 @@ static ICUserManager * manager;
...
@@ -180,5 +180,4 @@ static ICUserManager * manager;
}];
}];
}
}
@end
@end
superCleaner/Manager/WMEventCalendarTool.m
View file @
f893e762
...
@@ -11,6 +11,8 @@
...
@@ -11,6 +11,8 @@
@interface
WMEventCalendarTool
()
@interface
WMEventCalendarTool
()
@property
(
nonatomic
,
copy
)
completion
completion
;
@property
(
nonatomic
,
copy
)
completion
completion
;
@property
(
nonatomic
,
copy
)
completion
calendarCompletion
;
@property
(
nonatomic
,
copy
)
completed
completed
;
@property
(
nonatomic
,
copy
)
completed
completed
;
@property
(
nonatomic
,
strong
)
EKEventStore
*
eventStore
;
@property
(
nonatomic
,
strong
)
EKEventStore
*
eventStore
;
...
@@ -34,12 +36,12 @@
...
@@ -34,12 +36,12 @@
-
(
void
)
checkCalendarCanUsedCompletion
:
(
completion
)
completion
{
-
(
void
)
checkCalendarCanUsedCompletion
:
(
completion
)
completion
{
// EKEntityTypeEvent日历事件
// EKEntityTypeEvent日历事件
// EKEntityTypeReminder提醒事项
// EKEntityTypeReminder提醒事项
self
.
completion
=
completion
;
self
.
c
alendarC
ompletion
=
completion
;
EKAuthorizationStatus
eventStatus
=
[
EKEventStore
authorizationStatusForEntityType
:
EKEntityTypeEvent
];
EKAuthorizationStatus
eventStatus
=
[
EKEventStore
authorizationStatusForEntityType
:
EKEntityTypeEvent
];
if
(
eventStatus
==
EKAuthorizationStatusAuthorized
)
{
if
(
eventStatus
==
EKAuthorizationStatusAuthorized
)
{
// 已授权,可使用
// 已授权,可使用
if
(
self
.
completion
)
{
if
(
self
.
c
alendarC
ompletion
)
{
self
.
completion
(
YES
,
nil
);
self
.
c
alendarC
ompletion
(
YES
,
nil
);
}
}
}
else
if
(
eventStatus
==
EKAuthorizationStatusNotDetermined
){
}
else
if
(
eventStatus
==
EKAuthorizationStatusNotDetermined
){
// 未进行授权选择
// 未进行授权选择
...
@@ -54,16 +56,16 @@
...
@@ -54,16 +56,16 @@
NSLog
(
@"用户没有点允许访问日历"
);
NSLog
(
@"用户没有点允许访问日历"
);
}
}
dispatch_async
(
dispatch_get_main_queue
(),
^
{
dispatch_async
(
dispatch_get_main_queue
(),
^
{
if
(
self
.
completion
){
if
(
self
.
c
alendarC
ompletion
){
self
.
completion
(
isGranted
,
isError
);
self
.
c
alendarC
ompletion
(
isGranted
,
isError
);
}
}
});
});
}];
}];
}
else
{
}
else
{
// 未授权
// 未授权
NSError
*
error
=
[
NSError
errorWithDomain
:
NSCocoaErrorDomain
code
:
NSUserCancelledError
userInfo
:
@{
NSLocalizedDescriptionKey
:
@"未授权"
}];
NSError
*
error
=
[
NSError
errorWithDomain
:
NSCocoaErrorDomain
code
:
NSUserCancelledError
userInfo
:
@{
NSLocalizedDescriptionKey
:
@"未授权"
}];
if
(
self
.
completion
)
{
if
(
self
.
c
alendarC
ompletion
)
{
self
.
completion
(
NO
,
error
);
self
.
c
alendarC
ompletion
(
NO
,
error
);
}
}
}
}
}
}
...
@@ -404,7 +406,10 @@
...
@@ -404,7 +406,10 @@
-
(
void
)
checkCompletedRemindersStartDate
:
(
NSDate
*
)
startDate
addEndDate
:
(
NSDate
*
)
endDate
fetchCompleted
:
(
completed
)
completed
{
-
(
void
)
checkCompletedRemindersStartDate
:
(
NSDate
*
)
startDate
addEndDate
:
(
NSDate
*
)
endDate
fetchCompleted
:
(
completed
)
completed
{
self
.
completed
=
completed
;
self
.
completed
=
completed
;
// 查询到所有的日历
// 查询到所有的日历
NSArray
*
tempA
=
[
self
.
eventStore
calendarsForEntityType
:
EKEntityTypeReminder
];
EKEventStore
*
store
=
[[
EKEventStore
alloc
]
init
];
NSArray
*
tempA
=
[
store
calendarsForEntityType
:
EKEntityTypeReminder
];
NSMutableArray
*
only3D
=
[
NSMutableArray
array
];
NSMutableArray
*
only3D
=
[
NSMutableArray
array
];
for
(
int
i
=
0
;
i
<
tempA
.
count
;
i
++
)
{
for
(
int
i
=
0
;
i
<
tempA
.
count
;
i
++
)
{
...
@@ -416,7 +421,7 @@
...
@@ -416,7 +421,7 @@
[
only3D
addObject
:
temCalendar
];
[
only3D
addObject
:
temCalendar
];
}
}
}
}
self
.
eventStore
=
store
;
NSPredicate
*
predicate
=
[
self
.
eventStore
predicateForCompletedRemindersWithCompletionDateStarting
:
startDate
ending
:
endDate
calendars
:
only3D
];
NSPredicate
*
predicate
=
[
self
.
eventStore
predicateForCompletedRemindersWithCompletionDateStarting
:
startDate
ending
:
endDate
calendars
:
only3D
];
// 获取到范围内的所有事件
// 获取到范围内的所有事件
...
...
superCleaner/Other/ICCalendarManageController.m
View file @
f893e762
...
@@ -48,8 +48,10 @@
...
@@ -48,8 +48,10 @@
if
(
granted
)
{
if
(
granted
)
{
NSArray
*
events
=
[[
WMEventCalendarTool
sharedCalendar
]
checkToStartDate
:[
NSDate
dateWithTimeIntervalSince1970
:
1514375207
]
addEndDate
:
[
NSDate
date
]
addModifytitle
:
nil
addCalendarIdentifier
:
nil
];
NSArray
*
events
=
[[
WMEventCalendarTool
sharedCalendar
]
checkToStartDate
:[
NSDate
dateWithTimeIntervalSince1970
:
1514375207
]
addEndDate
:
[
NSDate
date
]
addModifytitle
:
nil
addCalendarIdentifier
:
nil
];
self
.
events
=
events
.
mutableCopy
;
self
.
events
=
events
.
mutableCopy
;
dispatch_async
(
dispatch_get_main_queue
(),
^
{
[
self
.
tableView
reloadData
];
[
self
.
tableView
reloadData
];
[
self
.
tableView
layoutIfNeeded
];
});
// for (int i = 0; i < events.count; i++) {
// for (int i = 0; i < events.count; i++) {
// EKEvent *event = events[i];
// EKEvent *event = events[i];
// NSLog(@"%@ - %@",event.title,event.eventIdentifier);
// NSLog(@"%@ - %@",event.title,event.eventIdentifier);
...
@@ -65,9 +67,10 @@
...
@@ -65,9 +67,10 @@
[[
WMEventCalendarTool
sharedCalendar
]
checkCalendarReminderCanUsedCompletion
:
^
(
BOOL
granted
,
NSError
*
error
)
{
[[
WMEventCalendarTool
sharedCalendar
]
checkCalendarReminderCanUsedCompletion
:
^
(
BOOL
granted
,
NSError
*
error
)
{
if
(
granted
)
{
if
(
granted
)
{
[[
WMEventCalendarTool
sharedCalendar
]
checkCompletedRemindersStartDate
:[
NSDate
dateWithTimeIntervalSince1970
:
1514375207
]
addEndDate
:[
NSDate
date
]
fetchCompleted
:^
(
NSArray
<
EKReminder
*>
*
reminders
)
{
[[
WMEventCalendarTool
sharedCalendar
]
checkCompletedRemindersStartDate
:[
NSDate
dateWithTimeIntervalSince1970
:
1514375207
]
addEndDate
:[
NSDate
date
]
fetchCompleted
:^
(
NSArray
<
EKReminder
*>
*
reminders
)
{
dispatch_async
(
dispatch_get_main_queue
(),
^
{
self
.
reminders
=
reminders
.
mutableCopy
;
self
.
reminders
=
reminders
.
mutableCopy
;
dispatch_async
(
dispatch_get_main_queue
(),
^
{
[
self
.
tableView
reloadData
];
[
self
.
tableView
reloadData
];
[
self
.
tableView
layoutIfNeeded
];
// // EKReminder *event = reminders[i];
// // EKReminder *event = reminders[i];
// for (EKReminder *reminder in reminders) {
// for (EKReminder *reminder in reminders) {
// NSLog(@"提醒事项 - %@ ",reminder.title);
// NSLog(@"提醒事项 - %@ ",reminder.title);
...
...
superCleaner/superCleaner-PrefixHeader.pch
View file @
f893e762
...
@@ -60,19 +60,19 @@
...
@@ -60,19 +60,19 @@
#define ICLocalized(name) [NSString stringWithFormat:@"%@",NSLocalizedString(name, nil)]
#define ICLocalized(name) [NSString stringWithFormat:@"%@",NSLocalizedString(name, nil)]
// 正常打印(包括方法名和代码所在的行数)
// 正常打印(包括方法名和代码所在的行数)
#ifdef DEBUG
//
#ifdef DEBUG
//
#define ServerReport @"http://reporttest.zhangxinhulian.com"
//
#define ServerReport @"http://reporttest.zhangxinhulian.com"
#define ServerHost @"https://feedapitest.zhangxinhulian.com" // 服务端接口地址
//
#define ServerHost @"https://feedapitest.zhangxinhulian.com" // 服务端接口地址
//
#define NSLog(format, ...) printf("\n[%s] %s [%d行] %s\n", __TIME__, __FUNCTION__, __LINE__, [[NSString stringWithFormat:format, ## __VA_ARGS__] UTF8String]);
//
#define NSLog(format, ...) printf("\n[%s] %s [%d行] %s\n", __TIME__, __FUNCTION__, __LINE__, [[NSString stringWithFormat:format, ## __VA_ARGS__] UTF8String]);
#else
//
#else
#define ServerReport @"http://report.zhangxinhulian.com"
#define ServerReport @"http://report.zhangxinhulian.com"
#define ServerHost @"https://feedapi.zhangxinhulian.com"
#define ServerHost @"https://feedapi.zhangxinhulian.com"
#define NSLog(format, ...) nil
//
#define NSLog(format, ...) nil
#endif
//
#endif
typedef enum: NSUInteger {
typedef enum: NSUInteger {
SimilayNormalPhoto = 0,
SimilayNormalPhoto = 0,
...
...
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