The document discusses the Event Kit framework for interacting with the Calendar and Reminders apps in iOS. It provides code examples for requesting access to calendars, fetching calendar and event data using predicates, creating, modifying and deleting events and reminders. It also covers observing external changes to the calendar database and using interfaces like EKEventViewController for displaying event data.
CamundaCon 2018: Using Zeebe with Spring Boot and Apache Camel (Holisticon)camunda services GmbH
Presented by Jan Galinski
Zeebe is the new microservice orchestration engine by camunda. It allows clients to subscribe to tasks and track the completion and overall end-to-end progress of your business processes. It basically consists of a network of brokers and clients, which can be written in multiple languages.
Spring Boot is a platform to create self-contained microservice on the JVM and supports integration in „cloud“ environments.
Bringing those two ideas together seems like a natural fit. To simplify writing jvm-based zeebe-clients with spring boot, I set up the spring-zeebe extension, which brings the „everything just works“ feeling you expect from a spring boot starter to the zeebee world.
But what if you run these spring boot clients in a cloud environment? The current broker-client architecture relies on host/port binding, a luxuary you might not have when your components are highly distributed and cannot see each other in the network.
That’s where apache camel comes to the rescue. Camel is an enterprise integration solution that supports many messaging middlewares and frees your code from actually knowing if the communication will be tcp, jms, kafka or even file-based. With the camel-zeebe extension you can leverage these benefits and subscribe to arbitrary message channels to connect to the broker instead of relying on a tcp host/port connection.
What happens in this talk: – short introduction to zeebe, spring boot, camel – life demo setting up broker/client with spring boot – life demo enhancing this approach with camel and rabbitMq
Ce cours vise à présenter le JDBC (Java Database Connectivity) et comment utiliser JDBC à travers des applications Java à d'accéder à des bases de données.
Exemple d'application qui montre comment utiliser les bonnes pratiques de JEE pour développer un site web de commerce électronique en utilisant les outils :
- Eclipse comme environnement de développement
- Maven comme outil d’intégration
- JUnit comme Framework des tsts unitaire
- Spring IOC pour l'inversion de contrôle
- Spring MVC pour la couche web
- Spring Security pour la sécurité
- JPA, Hibernate
- Web Service SOAP
- Web Service REST
- Service RMI
Onboarding tecnológico: Pasar los niveles del juegoRoberto Canales
Un programador es todo aquel que vive de la programación. La aproximación a la profesión es diferente en cada persona, puede que provenga de ingenierías, formación profesional, módulos, estudios no técnicos, bootcamps… En muchos casos hay gran inconsciencia del desconocimiento.
Por tanto cuando una persona se incorpora a una empresa puede haber grandes deficiencias formativas, incluso siendo profesionales completamente funcionales y competentes, por lo que se hace necesario unificar niveles de conocimiento, crear sentimientos de pertenencia y ayuda al grupo y definir qué es ser un buen profesional y cuando estamos haciendo una verdadera entrega de valor a los clientes.
Si nos planteamos la vida profesional como un juego deberíamos ser consciente cuales son las pantallas que dan paso a distintos niveles de ese juego.
How To Monetise & Bill CloudStack - A Practical Open ApproachShapeBlue
This talk is for ISPs looking to bill CloudStack resources, and for software developers looking to build a billing solution around CloudStack. This talk looks at covering multiple business and technical use cases (for example: plans, catalogues, flexible billing, tiered offerings, account management, etc.) for running a public cloud and how the same can be achieved using CloudStack. It does not delve into any specific billing system but instead focuses on an open approach to how ACS features can be leveraged to implement billing and monetise CloudStack.
Shiv is the Co-Founder and CTO of IndiQus Technologies Pvt. Ltd. and a CloudStack user turned evangelist since 2013. He loves tinkering on CloudStack and the possibilities it offers. He has deployed multiple public and private clouds running CloudStack in the South Asian region and has also integrated legacy systems with CloudStack. He would love to share his experiences with like-minded professionals.
-----------------------------------------
CloudStack Collaboration Conference 2022 took place on 14th-16th November in Sofia, Bulgaria and virtually. The day saw a hybrid get-together of the global CloudStack community hosting 370 attendees. The event hosted 43 sessions from leading CloudStack experts, users and skilful engineers from the open-source world, which included: technical talks, user stories, new features and integrations presentations and more.
CamundaCon 2018: Using Zeebe with Spring Boot and Apache Camel (Holisticon)camunda services GmbH
Presented by Jan Galinski
Zeebe is the new microservice orchestration engine by camunda. It allows clients to subscribe to tasks and track the completion and overall end-to-end progress of your business processes. It basically consists of a network of brokers and clients, which can be written in multiple languages.
Spring Boot is a platform to create self-contained microservice on the JVM and supports integration in „cloud“ environments.
Bringing those two ideas together seems like a natural fit. To simplify writing jvm-based zeebe-clients with spring boot, I set up the spring-zeebe extension, which brings the „everything just works“ feeling you expect from a spring boot starter to the zeebee world.
But what if you run these spring boot clients in a cloud environment? The current broker-client architecture relies on host/port binding, a luxuary you might not have when your components are highly distributed and cannot see each other in the network.
That’s where apache camel comes to the rescue. Camel is an enterprise integration solution that supports many messaging middlewares and frees your code from actually knowing if the communication will be tcp, jms, kafka or even file-based. With the camel-zeebe extension you can leverage these benefits and subscribe to arbitrary message channels to connect to the broker instead of relying on a tcp host/port connection.
What happens in this talk: – short introduction to zeebe, spring boot, camel – life demo setting up broker/client with spring boot – life demo enhancing this approach with camel and rabbitMq
Ce cours vise à présenter le JDBC (Java Database Connectivity) et comment utiliser JDBC à travers des applications Java à d'accéder à des bases de données.
Exemple d'application qui montre comment utiliser les bonnes pratiques de JEE pour développer un site web de commerce électronique en utilisant les outils :
- Eclipse comme environnement de développement
- Maven comme outil d’intégration
- JUnit comme Framework des tsts unitaire
- Spring IOC pour l'inversion de contrôle
- Spring MVC pour la couche web
- Spring Security pour la sécurité
- JPA, Hibernate
- Web Service SOAP
- Web Service REST
- Service RMI
Onboarding tecnológico: Pasar los niveles del juegoRoberto Canales
Un programador es todo aquel que vive de la programación. La aproximación a la profesión es diferente en cada persona, puede que provenga de ingenierías, formación profesional, módulos, estudios no técnicos, bootcamps… En muchos casos hay gran inconsciencia del desconocimiento.
Por tanto cuando una persona se incorpora a una empresa puede haber grandes deficiencias formativas, incluso siendo profesionales completamente funcionales y competentes, por lo que se hace necesario unificar niveles de conocimiento, crear sentimientos de pertenencia y ayuda al grupo y definir qué es ser un buen profesional y cuando estamos haciendo una verdadera entrega de valor a los clientes.
Si nos planteamos la vida profesional como un juego deberíamos ser consciente cuales son las pantallas que dan paso a distintos niveles de ese juego.
How To Monetise & Bill CloudStack - A Practical Open ApproachShapeBlue
This talk is for ISPs looking to bill CloudStack resources, and for software developers looking to build a billing solution around CloudStack. This talk looks at covering multiple business and technical use cases (for example: plans, catalogues, flexible billing, tiered offerings, account management, etc.) for running a public cloud and how the same can be achieved using CloudStack. It does not delve into any specific billing system but instead focuses on an open approach to how ACS features can be leveraged to implement billing and monetise CloudStack.
Shiv is the Co-Founder and CTO of IndiQus Technologies Pvt. Ltd. and a CloudStack user turned evangelist since 2013. He loves tinkering on CloudStack and the possibilities it offers. He has deployed multiple public and private clouds running CloudStack in the South Asian region and has also integrated legacy systems with CloudStack. He would love to share his experiences with like-minded professionals.
-----------------------------------------
CloudStack Collaboration Conference 2022 took place on 14th-16th November in Sofia, Bulgaria and virtually. The day saw a hybrid get-together of the global CloudStack community hosting 370 attendees. The event hosted 43 sessions from leading CloudStack experts, users and skilful engineers from the open-source world, which included: technical talks, user stories, new features and integrations presentations and more.
Slides of my talk at Coding-Berlin November Meetup on 01.11.2017 (https://www.meetup.com/CODING-BERLIN/events/244169839). Also have a look at the demo repo at Github: https://github.com/coding-berlin/vuejs-demo
Les bases de javascript. Introduction au langage javascript. Les boucles, les fonctions, scope local et global. Accès et modification des éléments du Dom (Document object model)
A presentation delivered to the Melbourne AWS Meetup on the May 24, 2018 . Discusses the implementation of the new AWS Containers sub-generator, which allows JHipster applications to be deployed on Amazon ECS, leveraging Fargate.
An Introduction to OpenCL™ Programming with AMD GPUs - AMD & Acceleware WebinarAMD Developer Central
This deck presents highlights from the Introduction to OpenCL™ Programming Webinar presented by Acceleware & AMD on Sept. 17, 2014. Watch a replay of this popular webinar on the AMD Dev Central YouTube channel here: https://www.youtube.com/user/AMDDevCentral or here for the direct link: http://bit.ly/1r3DgfF
Reactive programming is a general programming term focused on reacting to changes, such as data values or events. It can and often is done imperatively. A callback, delegate is an approach to reactive programming done imperatively.
Spring Framework Petclinic sample applicationAntoine Rey
Spring Petclinic is a sample application that has been designed to show how the Spring Framework can be used to build simple but powerful database-oriented applications.
The fork named Spring Framework Petclinic maintains a version both with a plain old Spring Framework configuration and a 3-layer architecture (i.e. presentation --> service --> repository).
Object-Oriented JavaScript presentation given at the 2010 ESRI Developer Summit. Code and slides are also available at http://github.com/kvangork/OOJS-Presentation
Find me on twitter @kvangork
or my blog http://prng.vangorkom.org
Slides of my talk at Coding-Berlin November Meetup on 01.11.2017 (https://www.meetup.com/CODING-BERLIN/events/244169839). Also have a look at the demo repo at Github: https://github.com/coding-berlin/vuejs-demo
Les bases de javascript. Introduction au langage javascript. Les boucles, les fonctions, scope local et global. Accès et modification des éléments du Dom (Document object model)
A presentation delivered to the Melbourne AWS Meetup on the May 24, 2018 . Discusses the implementation of the new AWS Containers sub-generator, which allows JHipster applications to be deployed on Amazon ECS, leveraging Fargate.
An Introduction to OpenCL™ Programming with AMD GPUs - AMD & Acceleware WebinarAMD Developer Central
This deck presents highlights from the Introduction to OpenCL™ Programming Webinar presented by Acceleware & AMD on Sept. 17, 2014. Watch a replay of this popular webinar on the AMD Dev Central YouTube channel here: https://www.youtube.com/user/AMDDevCentral or here for the direct link: http://bit.ly/1r3DgfF
Reactive programming is a general programming term focused on reacting to changes, such as data values or events. It can and often is done imperatively. A callback, delegate is an approach to reactive programming done imperatively.
Spring Framework Petclinic sample applicationAntoine Rey
Spring Petclinic is a sample application that has been designed to show how the Spring Framework can be used to build simple but powerful database-oriented applications.
The fork named Spring Framework Petclinic maintains a version both with a plain old Spring Framework configuration and a 3-layer architecture (i.e. presentation --> service --> repository).
Object-Oriented JavaScript presentation given at the 2010 ESRI Developer Summit. Code and slides are also available at http://github.com/kvangork/OOJS-Presentation
Find me on twitter @kvangork
or my blog http://prng.vangorkom.org
Object-Oriented JavaScript presentation given at ESRI's 2010 Developer Summit. Slides and code available at http://github.com/kvangork/OOJS-Presentation
Find me on twitter @kvangork
or at my blog: http://prng.vangorkom.org
Ten useful JavaScript tips & best practicesAnkit Rastogi
In this presentation there are ten useful JavaScript techniques which can be included in your application easily with less friction along with some AngularJs tips and best practices as a bonus. These tips and best practices are accompanied by examples & will cover script loading, design pattern, performance optimization and other areas.
Since best practices are very subjective topics, proper benchmarking needs to be done.
Introduction to CQRS and Event SourcingSamuel ROZE
Event Sourcing is the idea that every state of your application can be represented by a sequence of events. Using these two principles as the heart of a system or an application is quite common but can be challenging if we don’t use the right tools or architecture.
Refactoring can either completely disrupt your project or make you go faster. This presentation will help you to avoid some pitfalls.
It also demonstrates refactorings that you could apply straight away to make your code better.
Formacion en movilidad: Conceptos de desarrollo en iOS (IV) Mobivery
En esta cuarta sesión formativa, impartida por Sergi Hernando, CTO de Mobivery, se trataron los siguientes conceptos: Alert, Search Bar, Action Sheet, Activity,
Customizing y Testing
This is the support of a course to teach mainly Redux, and Redux with React for Java and C# programmers. It is the third part of the course to recycle programmers from desktop app programming to web app programming. This course covers from history of Redux, its origin, step by step what is a reducer, and later concepts like reducer splitting, action handling, async and many more.
You also can use repositories:
- https://github.com/drpicox/learn-redux-bytesting
- https://github.com/drpicox/learn-redux-zoo-bytesting
To improve your skills.
DWR, Hibernate and Dojo.E - A Tutorialjbarciauskas
This tutorial will walk you through the steps of creating a simple database-driven AJAX application using Direct Web Remoting (DWR) 2.0, Hibernate 3.0 and a new open source project from Nexaweb Technologies, dojo.E. dojo.E is an extensible markup processing engine that out-of-the-box will translate XML into dojo components.
Data in Motion: Streaming Static Data EfficientlyMartin Zapletal
Distributed streaming performance, consistency, reliable delivery, durability, optimisations, event time processing and other concepts discussed and explained on Akka Persistence and other examples.
Similar to iOS. EventKit Framework. Work with calendars and reminders (20)
Essentials of Automations: The Art of Triggers and Actions in FMESafe Software
In this second installment of our Essentials of Automations webinar series, we’ll explore the landscape of triggers and actions, guiding you through the nuances of authoring and adapting workspaces for seamless automations. Gain an understanding of the full spectrum of triggers and actions available in FME, empowering you to enhance your workspaces for efficient automation.
We’ll kick things off by showcasing the most commonly used event-based triggers, introducing you to various automation workflows like manual triggers, schedules, directory watchers, and more. Plus, see how these elements play out in real scenarios.
Whether you’re tweaking your current setup or building from the ground up, this session will arm you with the tools and insights needed to transform your FME usage into a powerhouse of productivity. Join us to discover effective strategies that simplify complex processes, enhancing your productivity and transforming your data management practices with FME. Let’s turn complexity into clarity and make your workspaces work wonders!
Welcome to the first live UiPath Community Day Dubai! Join us for this unique occasion to meet our local and global UiPath Community and leaders. You will get a full view of the MEA region's automation landscape and the AI Powered automation technology capabilities of UiPath. Also, hosted by our local partners Marc Ellis, you will enjoy a half-day packed with industry insights and automation peers networking.
📕 Curious on our agenda? Wait no more!
10:00 Welcome note - UiPath Community in Dubai
Lovely Sinha, UiPath Community Chapter Leader, UiPath MVPx3, Hyper-automation Consultant, First Abu Dhabi Bank
10:20 A UiPath cross-region MEA overview
Ashraf El Zarka, VP and Managing Director MEA, UiPath
10:35: Customer Success Journey
Deepthi Deepak, Head of Intelligent Automation CoE, First Abu Dhabi Bank
11:15 The UiPath approach to GenAI with our three principles: improve accuracy, supercharge productivity, and automate more
Boris Krumrey, Global VP, Automation Innovation, UiPath
12:15 To discover how Marc Ellis leverages tech-driven solutions in recruitment and managed services.
Brendan Lingam, Director of Sales and Business Development, Marc Ellis
A tale of scale & speed: How the US Navy is enabling software delivery from l...sonjaschweigert1
Rapid and secure feature delivery is a goal across every application team and every branch of the DoD. The Navy’s DevSecOps platform, Party Barge, has achieved:
- Reduction in onboarding time from 5 weeks to 1 day
- Improved developer experience and productivity through actionable findings and reduction of false positives
- Maintenance of superior security standards and inherent policy enforcement with Authorization to Operate (ATO)
Development teams can ship efficiently and ensure applications are cyber ready for Navy Authorizing Officials (AOs). In this webinar, Sigma Defense and Anchore will give attendees a look behind the scenes and demo secure pipeline automation and security artifacts that speed up application ATO and time to production.
We will cover:
- How to remove silos in DevSecOps
- How to build efficient development pipeline roles and component templates
- How to deliver security artifacts that matter for ATO’s (SBOMs, vulnerability reports, and policy evidence)
- How to streamline operations with automated policy checks on container images
In his public lecture, Christian Timmerer provides insights into the fascinating history of video streaming, starting from its humble beginnings before YouTube to the groundbreaking technologies that now dominate platforms like Netflix and ORF ON. Timmerer also presents provocative contributions of his own that have significantly influenced the industry. He concludes by looking at future challenges and invites the audience to join in a discussion.
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...SOFTTECHHUB
The choice of an operating system plays a pivotal role in shaping our computing experience. For decades, Microsoft's Windows has dominated the market, offering a familiar and widely adopted platform for personal and professional use. However, as technological advancements continue to push the boundaries of innovation, alternative operating systems have emerged, challenging the status quo and offering users a fresh perspective on computing.
One such alternative that has garnered significant attention and acclaim is Nitrux Linux 3.5.0, a sleek, powerful, and user-friendly Linux distribution that promises to redefine the way we interact with our devices. With its focus on performance, security, and customization, Nitrux Linux presents a compelling case for those seeking to break free from the constraints of proprietary software and embrace the freedom and flexibility of open-source computing.
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex ProofsAlex Pruden
This paper presents Reef, a system for generating publicly verifiable succinct non-interactive zero-knowledge proofs that a committed document matches or does not match a regular expression. We describe applications such as proving the strength of passwords, the provenance of email despite redactions, the validity of oblivious DNS queries, and the existence of mutations in DNA. Reef supports the Perl Compatible Regular Expression syntax, including wildcards, alternation, ranges, capture groups, Kleene star, negations, and lookarounds. Reef introduces a new type of automata, Skipping Alternating Finite Automata (SAFA), that skips irrelevant parts of a document when producing proofs without undermining soundness, and instantiates SAFA with a lookup argument. Our experimental evaluation confirms that Reef can generate proofs for documents with 32M characters; the proofs are small and cheap to verify (under a second).
Paper: https://eprint.iacr.org/2023/1886
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfPaige Cruz
Monitoring and observability aren’t traditionally found in software curriculums and many of us cobble this knowledge together from whatever vendor or ecosystem we were first introduced to and whatever is a part of your current company’s observability stack.
While the dev and ops silo continues to crumble….many organizations still relegate monitoring & observability as the purview of ops, infra and SRE teams. This is a mistake - achieving a highly observable system requires collaboration up and down the stack.
I, a former op, would like to extend an invitation to all application developers to join the observability party will share these foundational concepts to build on:
Enhancing Performance with Globus and the Science DMZGlobus
ESnet has led the way in helping national facilities—and many other institutions in the research community—configure Science DMZs and troubleshoot network issues to maximize data transfer performance. In this talk we will present a summary of approaches and tips for getting the most out of your network infrastructure using Globus Connect Server.
The Art of the Pitch: WordPress Relationships and SalesLaura Byrne
Clients don’t know what they don’t know. What web solutions are right for them? How does WordPress come into the picture? How do you make sure you understand scope and timeline? What do you do if sometime changes?
All these questions and more will be explored as we talk about matching clients’ needs with what your agency offers without pulling teeth or pulling your hair out. Practical tips, and strategies for successful relationship building that leads to closing the deal.
PHP Frameworks: I want to break free (IPC Berlin 2024)Ralf Eggert
In this presentation, we examine the challenges and limitations of relying too heavily on PHP frameworks in web development. We discuss the history of PHP and its frameworks to understand how this dependence has evolved. The focus will be on providing concrete tips and strategies to reduce reliance on these frameworks, based on real-world examples and practical considerations. The goal is to equip developers with the skills and knowledge to create more flexible and future-proof web applications. We'll explore the importance of maintaining autonomy in a rapidly changing tech landscape and how to make informed decisions in PHP development.
This talk is aimed at encouraging a more independent approach to using PHP frameworks, moving towards a more flexible and future-proof approach to PHP development.
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...James Anderson
Effective Application Security in Software Delivery lifecycle using Deployment Firewall and DBOM
The modern software delivery process (or the CI/CD process) includes many tools, distributed teams, open-source code, and cloud platforms. Constant focus on speed to release software to market, along with the traditional slow and manual security checks has caused gaps in continuous security as an important piece in the software supply chain. Today organizations feel more susceptible to external and internal cyber threats due to the vast attack surface in their applications supply chain and the lack of end-to-end governance and risk management.
The software team must secure its software delivery process to avoid vulnerability and security breaches. This needs to be achieved with existing tool chains and without extensive rework of the delivery processes. This talk will present strategies and techniques for providing visibility into the true risk of the existing vulnerabilities, preventing the introduction of security issues in the software, resolving vulnerabilities in production environments quickly, and capturing the deployment bill of materials (DBOM).
Speakers:
Bob Boule
Robert Boule is a technology enthusiast with PASSION for technology and making things work along with a knack for helping others understand how things work. He comes with around 20 years of solution engineering experience in application security, software continuous delivery, and SaaS platforms. He is known for his dynamic presentations in CI/CD and application security integrated in software delivery lifecycle.
Gopinath Rebala
Gopinath Rebala is the CTO of OpsMx, where he has overall responsibility for the machine learning and data processing architectures for Secure Software Delivery. Gopi also has a strong connection with our customers, leading design and architecture for strategic implementations. Gopi is a frequent speaker and well-known leader in continuous delivery and integrating security into software delivery.
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Albert Hoitingh
In this session I delve into the encryption technology used in Microsoft 365 and Microsoft Purview. Including the concepts of Customer Key and Double Key Encryption.
3. Requesting Permission to Access Calendars
Init EKEventStore:
eventStore = EKEventStore()
Check authorization status:
let status:EKAuthorizationStatus = EKEventStore.authorizationStatusForEntityType(EKEntityTypeEvent)
switch (status) {
case .Authorized: accessGrantedForCalendar()
break
case .NotDetermined: requestCalendarAccess()
break
case .Denied, .Restricted:
break
}
Request Calendar access:
eventStore?.requestAccessToEntityType(EKEntityTypeEvent, completion: {
[weak self] (granted:Bool, error:NSError!) -> Void in
dispatch_async(dispatch_get_main_queue()) {
self!.accessGrantedForCalendar()
}
})
4. func fetchCallendarGroups(eventStore:EKEventStore) {
for source in eventStore.sources() as [EKSource] {
println("Group: title = (source.title)" +
" type = (source.sourceType.value)")
}
}
/* Log
Group: title = Default type = 0
Group: title = Other type = 5
Group: title = Gmail type = 2
Group: title = CalDAV type = 2
Group: title = iCloud type = 2
*/
Event. Fetch Calendar Groups
5. func fetchAllCallendars() {
Event. Fetch All Calendars
let calendars = eventStore.calendarsForEntityType(EKEntityTypeEvent) as [EKCalendar]
for calendar in calendars {
println("Calendar: title = (calendar.title)" +
" type = (calendar.type.value)" +
" allows modifications = (calendar.allowsContentModifications)")
}
}
/* Log
Calendar: title = Work type = 1 allows modifications = true
Calendar: title = Home type = 1 allows modifications = true
Calendar: title = Birthdays type = 4 allows modifications = false
Calendar: title = a.voityuk@gmail.com type = 1 allows modifications = true
Calendar: title = Calendar type = 1 allows modifications = false
*/
6. Event. Fetch Events Using Predicates
func fetchEvents(calendar: EKCalendar) {
/* The event starts from today, right now */
let startDate = NSDate()
/* The end date will be 7 day from now */
let endDate = startDate.dateByAddingTimeInterval(24 * 60 * 60 * 7)
/* Create the predicate that we can later pass to the event store in order to fetch the events */
let searchPredicate = eventStore.predicateForEventsWithStartDate(startDate, endDate: endDate, calendars: nil)
/* Fetch all the events that fall between the starting and the ending dates */
let events = eventStore.eventsMatchingPredicate(searchPredicate) as [EKEvent]
for event in events {
println("Event: title = (event.title)")
}
}
/* Log
Event: title = Alexander Voityuk’s 28. Birthday
Event: title = Maxim Matyash’s 30. Birthday
*/
7. func createEventWithTitle(title: String, startDate: NSDate, endDate: NSDate, inCalendar: EKCalendar, inEventStore: EKEventStore) -> Bool {
/* Create an event */
var event = EKEvent(eventStore: inEventStore)
event.calendar = inCalendar
/* Set the properties of the event such as its title, start date/time, end date/time, etc. */
event.title = title
event.startDate = startDate
event.endDate = endDate
/* Finally, save the event into the calendar */
var error:NSError?
let result = inEventStore.saveEvent(event,
span: EKSpanThisEvent,
error: &error)
return result
}
Event. Create Event
8. func removeEvent(event: EKEvent, store: EKEventStore, calendar: EKCalendar) -> Bool{
var result = false
var error:NSError?
/* remove the event from the calendar */
if store.removeEvent(event,
span: EKSpanThisEvent,
commit: true,
error: &error) {
result = true
} else if let theError = error {
println("Failed to remove (event) with error = (theError)")
}
return result
}
Event. Remove Event
9. func addAlarmToCalendarWithStore(title: String, startDate: NSDate, endDate: NSDate, store: EKEventStore, calendar: EKCalendar) {
/* Assign the required properties, especially the target calendar */
let eventWithAlarm = EKEvent(eventStore: store)
eventWithAlarm.title = title
eventWithAlarm.calendar = calendar
eventWithAlarm.startDate = startDate
eventWithAlarm.endDate = endDate
/* The alarm goes off 2 seconds before the event happens */
let alarm = EKAlarm(relativeOffset: -2.0)
eventWithAlarm.addAlarm(alarm)
var error:NSError?
if store.saveEvent(eventWithAlarm, span: EKSpanThisEvent, error: &error) {
println("Saved an event that fires 60 seconds from now.")
} else if let theError = error {
println("Failed to save the event. Error = (theError)")
}
}
Event. Add Alarm
10. func addRecurringRuleToEvent(event: EKEvent) {
/* The end date of the recurring rule is one year from now */
let oneYear:NSTimeInterval = 365 * 24 * 60 * 60;
let oneYearFromNow = startDate.dateByAddingTimeInterval(oneYear)
/* Create an Event Kit date from this date */
let recurringEnd = EKRecurrenceEnd.recurrenceEndWithEndDate(oneYearFromNow) as EKRecurrenceEnd
/* And the recurring rule. This event happens every
month (EKRecurrenceFrequencyMonthly), once a month (interval:1)
and the recurring rule ends a year from now (end:RecurringEnd) */
let recurringRule = EKRecurrenceRule(
recurrenceWithFrequency: EKRecurrenceFrequencyMonthly,
interval: 1,
end: recurringEnd)
/* Set the recurring rule for the event */
event.recurrenceRules = [recurringRule]
}
Event. Add Recurring Rule
11. func fetchAllCallendars() {
Reminder. Fetch All Calendars
let calendars = eventStore.calendarsForEntityType(EKEntityTypeReminder) as [EKCalendar]
for calendar in calendars {
println("Calendar: title = (calendar.title)" +
" type = (calendar.type.value)" +
" allows modifications = (calendar.allowsContentModifications)")
}
}
/* Log
Calendar: title = Reminders type = 1 allows modifications = true
*/
12. Reminder. Fetch Reminders Using Predicates
func fetchReminders(calendar: EKCalendar) -> NSMutableArray {
/* The event starts from today, right now */
let startDate = NSDate()
/* The end date will 7day from now */
let endDate = startDate.dateByAddingTimeInterval(24 * 60 * 60 * 7)
/* Create the predicate that we can later pass to the event store in order to fetch the events */
let searchPredicate = eventStore.predicateForIncompleteRemindersWithDueDateStarting(startDate, ending: endDate, calendars: nil)
/* Fetch all the reminder that fall between the starting and the ending dates */
eventStore.fetchRemindersMatchingPredicate(searchPredicate, completion: {
(reminders) -> Void in
for reminder in reminders {
println("Event: title = (reminder.title)")
}
})
}
/* Log
Reminder: title = My Reminder 1
Reminder: title = My Reminder 2
*/
13. func createReminderWithTitle(title: String, inCalendar: EKCalendar, inEventStore: EKEventStore, notes: String) -> Bool {
/* Create an reminder */
var reminder = EKReminder(eventStore: inEventStore)
reminder.calendar = inCalendar
/* Set the properties of the event such as its title, notes. */
reminder.title = title
reminder.notes = notes
/* Finally, save the reminder into the calendar */
var error:NSError?
let result = inEventStore.saveReminder(reminder,
commit: true,
error: &error)
if result == false {
if let theError = error{
println("An error occurred (theError)")
}
}
return result
}
Reminder. Create Reminder
14. func removeReminder(reminder: EKReminder, store: EKEventStore, calendar: EKCalendar) -> Bool{
var result = false
var error:NSError?
/* remove the reminder from the calendar */
if store.removeReminder(reminder,
commit: true,
error: &error) {
result = true
} else if let theError = error{
println("Failed to remove (reminder) with error = (theError)")
}
return result
}
Reminder. Remove Reminder
15. /* Add observer */
NSNotificationCenter.defaultCenter().addObserver(
self,
selector: "eventStoreDidChanged:",
name: EKEventStoreChangedNotification,
object: nil)
func eventStoreDidChanged(notification:NSNotification) {
// TODO
}
Observing External Changes
to the Calendar Database
16. Add delegate EKEventViewDelegate to current ViewController
func displayExistingEvent(event : EKEvent, store : EKEventStore) {
let controller:EKEventViewController = EKEventViewController()
controller.event = event;
controller.allowsEditing = true;
self.presentViewController(UINavigationController(rootViewController: controller), animated: true, completion: nil)
}
// MARK: - EKEventViewDelegate
func eventViewController(controller: EKEventViewController!, didCompleteWithAction action: EKEventViewAction) {
self.dismissViewControllerAnimated(true, completion: {
() -> Void in
// TODO
})
}
Interfaces for Events. Displaying Event Data
17. Add delegate EKEventEditViewDelegate to current ViewController
func editExistingEvent(event : EKEvent, store : EKEventStore) {
let controller:EKEventEditViewController = EKEventEditViewController()
controller.event = event
controller.eventStore = store
controller.editViewDelegate = self
self.presentViewController(controller, animated: true, completion: nil)
}
// MARK: - EKEventEditViewDelegate
func eventEditViewController(controller: EKEventEditViewController!, didCompleteWithAction action: EKEventEditViewAction) {
self.dismissViewControllerAnimated(true, completion: {
() -> Void in
// TODO
})
}
func eventEditViewControllerDefaultCalendarForNewEvents(controller: EKEventEditViewController!) -> EKCalendar! {
return defaultCalendar
}
Interfaces for Events. Modifying Event Data
18. End
Calendar and Reminders Programming Guide:
https://developer.apple.com/library/ios/documentation/DataManagement/Conceptual/EventKitProgGuide/Introduction/Introduction.html
Apple Sample Project “SimpleEKDemo”:
https://developer.apple.com/library/ios/samplecode/SimpleEKDemo/Introduction/Intro.html#//apple_ref/doc/uid/DTS40010160