Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
GMBase
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gengmeiios
GMBase
Commits
77e6500d
Commit
77e6500d
authored
May 13, 2020
by
jz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
38d291a0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
+9
-9
GMCalendarEventManager.swift
GMBase/Classes/AddClass/GMCalendarEventManager.swift
+9
-9
No files found.
GMBase/Classes/AddClass/GMCalendarEventManager.swift
View file @
77e6500d
...
...
@@ -10,12 +10,12 @@ import UIKit
//import GMBaseSwift
import
EventKit
typealias
CalendarAuthorizationAllowedBlock
=
()
->
Void
public
typealias
CalendarAuthorizationAllowedBlock
=
()
->
Void
@objcMembers
class
GMCalendarEventManager
:
NSObject
{
var
authorizationAllowed
:
CalendarAuthorizationAllowedBlock
?
var
eventStore
=
EKEventStore
()
override
init
()
{
public
class
GMCalendarEventManager
:
NSObject
{
public
var
authorizationAllowed
:
CalendarAuthorizationAllowedBlock
?
public
var
eventStore
=
EKEventStore
()
public
override
init
()
{
super
.
init
()
//请求授权
...
...
@@ -45,7 +45,7 @@ class GMCalendarEventManager: NSObject {
- parameter triggerTime: 提醒事件
- parameter url: 跳转到美购详情页面的地址
*/
func
addEvent
(
_
title
:
String
=
""
,
startDate
:
TimeInterval
,
endDate
:
TimeInterval
,
serviceId
:
String
,
url
:
String
)
{
public
func
addEvent
(
_
title
:
String
=
""
,
startDate
:
TimeInterval
,
endDate
:
TimeInterval
,
serviceId
:
String
,
url
:
String
)
{
let
timeZone
=
TimeZone
.
current
let
deltaTime
=
timeZone
.
secondsFromGMT
()
let
event
=
EKEvent
(
eventStore
:
eventStore
)
...
...
@@ -75,7 +75,7 @@ class GMCalendarEventManager: NSObject {
- author: wangjun 07-07-2016 in 6.1.0
- parameter title: 事件的标题
*/
func
removeEvent
(
_
serviceId
:
String
)
{
public
func
removeEvent
(
_
serviceId
:
String
)
{
//取出对应的event eventId
guard
let
eventId
=
(
UserDefaults
.
standard
.
object
(
forKey
:
serviceId
))
as?
String
else
{
...
...
@@ -96,7 +96,7 @@ class GMCalendarEventManager: NSObject {
- author: wangjun
- date: 16-07-04 18:07:22 07-04-2016 in 6.1.0
*/
func
checkAuthorized
()
->
Bool
{
public
func
checkAuthorized
()
->
Bool
{
return
EKEventStore
.
authorizationStatus
(
for
:
.
event
)
==
.
authorized
}
...
...
@@ -104,7 +104,7 @@ class GMCalendarEventManager: NSObject {
提醒用户开启日历服务的alert
- author: wangjun 07-07-2016 in 6.1.0
*/
func
showAlertcontrolle
()
{
public
func
showAlertcontrolle
()
{
let
status
=
EKEventStore
.
authorizationStatus
(
for
:
.
event
)
if
status
==
.
authorized
{
...
...
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