Commit 6de8640d authored by Adam Procter's avatar Adam Procter

added alert if you deny or change your privacy settings and fixed saving to...

added alert if you deny or change your privacy settings and fixed saving to reminders not saving on first launch as permission was missing. Now grabs calendars is her permission to on submit. Added icons for Store
parent 8877ee65
{
"images" : [
{
"idiom" : "iphone",
"size" : "20x20",
"idiom" : "iphone",
"filename" : "Icon-Spotlight-40.png",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "20x20",
"idiom" : "iphone",
"filename" : "Icon-60.png",
"scale" : "3x"
},
{
"idiom" : "iphone",
"size" : "29x29",
"idiom" : "iphone",
"filename" : "Icon-Small@2x.png",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "29x29",
"idiom" : "iphone",
"filename" : "Icon-Small@3x.png",
"scale" : "3x"
},
{
"idiom" : "iphone",
"size" : "40x40",
"idiom" : "iphone",
"filename" : "Icon-Spotlight-40@2x.png",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "40x40",
"idiom" : "iphone",
"filename" : "Icon-Spotlight-40@3x.png",
"scale" : "3x"
},
{
"idiom" : "iphone",
"size" : "60x60",
"idiom" : "iphone",
"filename" : "Icon-60@2x.png",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "60x60",
"idiom" : "iphone",
"filename" : "Icon-60@3x.png",
"scale" : "3x"
},
{
......@@ -46,8 +54,9 @@
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "20x20",
"idiom" : "ipad",
"filename" : "Icon-Spotlight-41.png",
"scale" : "2x"
},
{
......@@ -56,8 +65,9 @@
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "29x29",
"idiom" : "ipad",
"filename" : "Icon-Small@2x-1.png",
"scale" : "2x"
},
{
......@@ -66,23 +76,27 @@
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "40x40",
"idiom" : "ipad",
"filename" : "Icon-Spotlight-40@2x-1.png",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "76x76",
"idiom" : "ipad",
"filename" : "Icon-76.png",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "76x76",
"idiom" : "ipad",
"filename" : "Icon-76@2x.png",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "83.5x83.5",
"idiom" : "ipad",
"filename" : "Icon-iPadPro@2x.png",
"scale" : "2x"
}
],
......
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
......@@ -19,7 +19,7 @@
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
<string>3</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSRemindersUsageDescription</key>
......
......@@ -22,7 +22,19 @@ class ViewController: UIViewController {
func setReminder(){
// now we need to get the calendars and pop them into the array
calendars = eventStore.calendars(for: EKEntityType.reminder)
// for calendar in calendars as [EKCalendar] {
// /// loop them to print
// print("Calendar = \(calendar.title)")
// }
// storing the data into the store
let reminder = EKReminder(eventStore: self.eventStore)
reminder.title = reminderText.text!
......@@ -35,6 +47,7 @@ class ViewController: UIViewController {
reminderText.text = "";
} catch let error {
print("Reminder failed with error \(error.localizedDescription)")
showAlert()
}
}
......@@ -45,25 +58,21 @@ class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
// here we grant access to the store (pop over thing appears)
// here we request access to the store (pop over thing appears)
// dont forget to add the plist entry for access as well
eventStore.requestAccess(to: EKEntityType.reminder, completion:
{(granted, error) in
if !granted {
print("Access to store not granted")
}
})
// now we need to get the calendars and pop them into the array we set to begin with
calendars = eventStore.calendars(for: EKEntityType.reminder)
reminderText.becomeFirstResponder()
//
// for calendar in calendars as [EKCalendar] {
// /// loop them to print
// print("Calendar = \(calendar.title)")
// }
//
//init toolbar
let toolbar:UIToolbar = UIToolbar(frame: CGRect(x: 0, y: 0, width: self.view.frame.size.width, height: 30))
......@@ -84,18 +93,22 @@ class ViewController: UIViewController {
//setting toolbar as inputAccessoryView
self.reminderText.inputAccessoryView = toolbar
}
func textViewShouldBeginEditing(_ textView: UITextView){
func showAlert() {
let alertController = UIAlertController(title: "Failed to Access Reminders App", message: "Please check you have enabled SaveIT under Settings > Privacy > Reminders", preferredStyle: .actionSheet)
let defaultAction = UIAlertAction(title: "OK", style: .default)
// textView.inputAccessoryView = toolbar
alertController.addAction(defaultAction)
present(alertController, animated: true, completion: nil)
}
override func viewWillAppear(_ animated: Bool) {
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment