Docker 搭建 GitLab 添加用户
想要使用 Docker 来搭建 GitLab 的话需要先安装 Docker, 官方的说法Desktop版本是最方便的部署方式,安装非常简单就官网下载即可,另外可以设置一下免sudo使用docker也挺方便的。
NSCalendarsUsageDescription 【访问日历】
func checkAuth()->Bool{
let eventStore = EKEventStore()
switch EKEventStore.authorizationStatus(for: .event) {
case .authorized:
return true
case .denied:
print("Access denied")
return false
case .notDetermined:
eventStore.requestAccess(to: .event, completion: { (granted: Bool, NSError) -> Void in
if granted {
print("Access Ok")
}else{
print("Access denied")
}
})
default:
return false
}
return true
}
Create a new event with the init(eventStore:) method of the EKEvent class.
You can edit the details of a new event or an event you previously fetched from the Calendar database by setting the event’s corresponding properties. Some of the details you can edit include:
let doneEvent = EKEvent(eventStore: eventStore)
doneEvent.calendar = calendarForEvent
doneEvent.title = title
doneEvent.startDate = Date(timeIntervalSince1970: Double(start))
doneEvent.endDate = Date()
var notes = "{code:\(item.code),span:\(Int(Double(span)/60.0))"
if desc != "" {
notes += ",desc:\(desc)"
}
if spnd > 0 {
notes += ",spnd:\(spnd)"
}
doneEvent.notes = notes + "}"
do{
try eventStore.save(doneEvent, span: .thisEvent, commit: true)
print("saved event id = \(doneEvent.eventIdentifier)")
}catch{
uiLogError(msg: "add Event to calendar failed!")
}
Leave a Comment