Commit f6673910 authored by Adam Procter's avatar Adam Procter Committed by Adam Procter

updated

parent e316a4ac
......@@ -302,6 +302,7 @@
F0DE45FD1E79E59B00385800 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
......
......@@ -42,7 +42,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
func applicationWillTerminate(_ application: UIApplication) {
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}
}
......@@ -21,30 +21,44 @@
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" fixedFrame="YES" scrollEnabled="NO" textAlignment="center" translatesAutoresizingMaskIntoConstraints="NO" id="5oo-TQ-2cm">
<rect key="frame" x="16" y="119" width="343" height="373"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<fontDescription key="fontDescription" type="system" pointSize="42"/>
<textInputTraits key="textInputTraits" autocapitalizationType="sentences"/>
</textView>
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Efi-fm-5QU">
<rect key="frame" x="141" y="374" width="93" height="30"/>
<rect key="frame" x="103" y="37" width="169" height="30"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<state key="normal" title="Set Reminder"/>
<fontDescription key="fontDescription" type="system" pointSize="22"/>
<state key="normal" title="Save Thought"/>
<connections>
<action selector="setReminder:" destination="BYZ-38-t0r" eventType="touchUpInside" id="eYJ-7c-Zv6"/>
<action selector="buttonTap:" destination="BYZ-38-t0r" eventType="touchUpInside" id="fz6-uX-isR"/>
</connections>
</button>
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="qh7-tX-ffx">
<rect key="frame" x="139" y="318" width="97" height="30"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<nil key="textColor"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<textInputTraits key="textInputTraits"/>
</textField>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</view>
<connections>
<outlet property="reminderText" destination="qh7-tX-ffx" id="nnm-QE-dSY"/>
<outlet property="reminderText" destination="5oo-TQ-2cm" id="gcV-jo-OZx"/>
<outlet property="toolbar" destination="sZN-cC-Hlp" id="QFZ-OD-o9s"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
<toolbar opaque="NO" clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="xVN-ZI-E6g">
<rect key="frame" x="0.0" y="0.0" width="375" height="44"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
<items>
<barButtonItem systemItem="done" id="sZN-cC-Hlp">
<connections>
<action selector="DoneTap:" destination="BYZ-38-t0r" id="kjG-v8-YM5"/>
</connections>
</barButtonItem>
</items>
</toolbar>
</objects>
<point key="canvasLocation" x="125.59999999999999" y="38.23088455772114"/>
</scene>
</scenes>
</document>
......@@ -2,10 +2,10 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>NSRemindersUsageDescription</key>
<string>SaveIT uses your iCloud default reminders so we need your permission please</string>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleDisplayName</key>
<string>SaveIT</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
......@@ -22,6 +22,8 @@
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSRemindersUsageDescription</key>
<string>SaveIT uses your iCloud default reminders so we need your permission please</string>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
......@@ -33,8 +35,6 @@
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
......
......@@ -15,13 +15,28 @@ class ViewController: UIViewController {
var eventStore = EKEventStore()
var calendars:Array<EKCalendar> = []
@IBOutlet weak var reminderText: UITextView!
@IBOutlet weak var toolbar: UIBarButtonItem!
// reminderText.maximumNumberOfLines = 5;
// the input field
@IBOutlet weak var reminderText: UITextField!
// the button
@IBAction func setReminder(_ sender: Any) {
@IBAction func DoneTap(_ sender: Any) {
view.endEditing(true)
}
//button
@IBAction func buttonTap(_ sender: Any) {
setReminder()
}
// storing the data into the store
func setReminder(){
// storing the data into the store
let reminder = EKReminder(eventStore: self.eventStore)
reminder.title = reminderText.text!
......@@ -30,6 +45,8 @@ class ViewController: UIViewController {
do {
try eventStore.save(reminder,
commit: true)
reminderText.text = "";
} catch let error {
print("Reminder failed with error \(error.localizedDescription)")
}
......@@ -38,6 +55,7 @@ class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
......@@ -53,16 +71,21 @@ class ViewController: UIViewController {
// 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)")
// }
//
//
}
func textViewShouldBeginEditing(_ textView: UITextView){
// textView.inputAccessoryView = toolbar
}
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