Skip to content
Snippets Groups Projects
Commit efaf9afb authored by Dima4ka's avatar Dima4ka
Browse files

Automated keyboard appearance added

parent ea5d03bf
Branches
No related tags found
No related merge requests found
...@@ -424,6 +424,7 @@ ...@@ -424,6 +424,7 @@
<outlet property="notesCell" destination="w5F-k8-fu6" id="hjd-mU-7kO"/> <outlet property="notesCell" destination="w5F-k8-fu6" id="hjd-mU-7kO"/>
<outlet property="notesCellSubtitleLabel" destination="jnc-UL-L4a" id="3s8-J8-ktN"/> <outlet property="notesCellSubtitleLabel" destination="jnc-UL-L4a" id="3s8-J8-ktN"/>
<outlet property="segmentedCell" destination="hKt-ue-2Ex" id="xRh-7A-851"/> <outlet property="segmentedCell" destination="hKt-ue-2Ex" id="xRh-7A-851"/>
<outlet property="segmentedControll" destination="dh2-zX-vdz" id="USm-lD-uz4"/>
<segue destination="ZH9-7k-a96" kind="push" identifier="TypeToFriendSegue" id="ON9-Of-yNd"/> <segue destination="ZH9-7k-a96" kind="push" identifier="TypeToFriendSegue" id="ON9-Of-yNd"/>
<segue destination="WCo-rf-QLU" kind="push" identifier="TypeToCustomSegue" id="BNU-uE-JBB"/> <segue destination="WCo-rf-QLU" kind="push" identifier="TypeToCustomSegue" id="BNU-uE-JBB"/>
<segue destination="izA-I5-AI8" kind="push" identifier="TypeToProfessorSegue" id="SuI-1w-32F"/> <segue destination="izA-I5-AI8" kind="push" identifier="TypeToProfessorSegue" id="SuI-1w-32F"/>
...@@ -722,7 +723,7 @@ ...@@ -722,7 +723,7 @@
<action selector="writeEmail:" destination="fzL-WR-GQj" eventType="touchUpInside" id="rGf-Yu-ufH"/> <action selector="writeEmail:" destination="fzL-WR-GQj" eventType="touchUpInside" id="rGf-Yu-ufH"/>
</connections> </connections>
</button> </button>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="Write email to developer about professor building" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" preferredMaxLayoutWidth="280" translatesAutoresizingMaskIntoConstraints="NO" id="Ivl-W4-T18"> <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="Write email to developer about missing professor" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" preferredMaxLayoutWidth="280" translatesAutoresizingMaskIntoConstraints="NO" id="Ivl-W4-T18">
<rect key="frame" x="20" y="214" width="280" height="47"/> <rect key="frame" x="20" y="214" width="280" height="47"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/> <fontDescription key="fontDescription" type="system" pointSize="17"/>
...@@ -1023,7 +1024,7 @@ ...@@ -1023,7 +1024,7 @@
<color key="backgroundColor" red="0.0" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/> <color key="backgroundColor" red="0.0" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
<color key="textColor" red="1" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/> <color key="textColor" red="1" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/> <fontDescription key="fontDescription" type="system" pointSize="14"/>
<textInputTraits key="textInputTraits" enablesReturnKeyAutomatically="YES"/> <textInputTraits key="textInputTraits" autocapitalizationType="allCharacters" enablesReturnKeyAutomatically="YES"/>
<connections> <connections>
<outlet property="delegate" destination="EuZ-uN-7jh" id="YEV-pP-pWO"/> <outlet property="delegate" destination="EuZ-uN-7jh" id="YEV-pP-pWO"/>
</connections> </connections>
...@@ -2017,7 +2018,7 @@ AQABAAEAAQAB//+dkAEA//+PgAAE//+dkAEI//+dkAEMUERUAFBTVABQV1QAUFBUAAAAAAEAAAABA ...@@ -2017,7 +2018,7 @@ AQABAAEAAQAB//+dkAEA//+PgAAE//+dkAEI//+dkAEMUERUAFBTVABQV1QAUFBUAAAAAAEAAAABA
<simulatedScreenMetrics key="destination" type="retina4"/> <simulatedScreenMetrics key="destination" type="retina4"/>
</simulatedMetricsContainer> </simulatedMetricsContainer>
<inferredMetricsTieBreakers> <inferredMetricsTieBreakers>
<segue reference="axh-4G-zRI"/>
<segue reference="a1q-7a-6BE"/> <segue reference="a1q-7a-6BE"/>
<segue reference="h2T-3x-Eyw"/>
</inferredMetricsTieBreakers> </inferredMetricsTieBreakers>
</document> </document>
...@@ -29,6 +29,15 @@ ...@@ -29,6 +29,15 @@
{ {
[super viewDidLoad]; [super viewDidLoad];
// Do any additional setup after loading the view. // Do any additional setup after loading the view.
}
-(void)viewDidAppear:(BOOL)animated {
if ([(NSNumber*)[[WPIModel sharedDataModel].data valueForKey:@"Type"] integerValue] == 1) {
[self.textField becomeFirstResponder];
} else {
[self.textView becomeFirstResponder];
}
} }
-(void) viewWillDisappear:(BOOL)animated { -(void) viewWillDisappear:(BOOL)animated {
... ...
......
...@@ -32,10 +32,15 @@ ...@@ -32,10 +32,15 @@
[model.data setObject:[NSNumber numberWithBool:YES] forKey:@"Use Custom Building"]; [model.data setObject:[NSNumber numberWithBool:YES] forKey:@"Use Custom Building"];
} }
-(void)viewDidAppear:(BOOL)animated {
[self.buildingName becomeFirstResponder];
}
- (void)viewDidLoad - (void)viewDidLoad
{ {
[super viewDidLoad]; [super viewDidLoad];
// Do any additional setup after loading the view. // Do any additional setup after loading the view.
} }
- (void)didReceiveMemoryWarning - (void)didReceiveMemoryWarning
... ...
......
...@@ -31,6 +31,12 @@ ...@@ -31,6 +31,12 @@
{ {
[super viewDidLoad]; [super viewDidLoad];
// Do any additional setup after loading the view. // Do any additional setup after loading the view.
}
-(void)viewDidAppear:(BOOL)animated {
[self.textField becomeFirstResponder];
} }
-(void) viewWillDisappear:(BOOL)animated { -(void) viewWillDisappear:(BOOL)animated {
... ...
......
...@@ -308,7 +308,7 @@ static WPIModel *sharedDataModel = nil; ...@@ -308,7 +308,7 @@ static WPIModel *sharedDataModel = nil;
NSError* error; NSError* error;
[self.eventStore saveEvent:event span:EKSpanThisEvent error:&error]; //[self.eventStore saveEvent:event span:EKSpanThisEvent error:&error];
...@@ -318,8 +318,8 @@ static WPIModel *sharedDataModel = nil; ...@@ -318,8 +318,8 @@ static WPIModel *sharedDataModel = nil;
[self configureData]; [self configureData];
} else { } else {
if ([(NSNumber*)[self.data valueForKey:@"Use Custom Professor"] boolValue]) { if ([(NSNumber*)[self.data valueForKey:@"Use Custom Professor"] boolValue]) {
alert = [[UIAlertView alloc] initWithTitle:@"Your event" message:@"Your event is successfully added to your default calendar." delegate:nil cancelButtonTitle:@"Ok" otherButtonTitles: nil]; alert = [[UIAlertView alloc] initWithTitle:@"Your event" message:@"Your event is successfully added to your default calendar. Would you like to send out an email with this event?" delegate:self cancelButtonTitle:@"No" otherButtonTitles: @"Yes", nil];
[self configureData]; //[self configureData];
} else { } else {
NSDictionary *prof = (NSDictionary*)[self.professors objectAtIndex:[(NSNumber*)[self.data valueForKey:@"Professor's Index"] integerValue]]; NSDictionary *prof = (NSDictionary*)[self.professors objectAtIndex:[(NSNumber*)[self.data valueForKey:@"Professor's Index"] integerValue]];
NSString *message = [NSString stringWithFormat:@"Your event is successfully added to your default calendar. Would you like to send an email to professor %@ with a reminder? You will confirm it.", [prof objectForKey:@"Name"]]; NSString *message = [NSString stringWithFormat:@"Your event is successfully added to your default calendar. Would you like to send an email to professor %@ with a reminder? You will confirm it.", [prof objectForKey:@"Name"]];
...@@ -359,12 +359,22 @@ static WPIModel *sharedDataModel = nil; ...@@ -359,12 +359,22 @@ static WPIModel *sharedDataModel = nil;
MFMailComposeViewController *mailViewController = [[MFMailComposeViewController alloc] init]; MFMailComposeViewController *mailViewController = [[MFMailComposeViewController alloc] init];
mailViewController.mailComposeDelegate = self.mainTable; mailViewController.mailComposeDelegate = self.mainTable;
NSString *message = @"";
if (![(NSNumber*)[self.data valueForKey:@"Use Custom Professor"] boolValue]) {
NSDictionary *prof = (NSDictionary*)[self.professors objectAtIndex:[(NSNumber*)[self.data valueForKey:@"Professor's Index"] integerValue]]; NSDictionary *prof = (NSDictionary*)[self.professors objectAtIndex:[(NSNumber*)[self.data valueForKey:@"Professor's Index"] integerValue]];
NSString *email = [prof valueForKey:@"Email"]; NSString *email = [prof valueForKey:@"Email"];
[mailViewController setToRecipients:@[email]]; [mailViewController setToRecipients:@[email]];
[mailViewController setSubject:@"Appointment reminder"]; [mailViewController setSubject:@"Appointment reminder"];
NSString *message = [NSString stringWithFormat:@"Dear Professor %@:\n\n I am just writing you a reminder about an appointment we set on %@. \n\n Thank you!\n\n(This is an automated email from WPI Calendar Events Creator app)\n", [prof valueForKey:@"Name"], [self getDateForPurpose:4]]; message = [NSString stringWithFormat:@"Dear Professor %@:\n\n I am just writing you a reminder about an appointment we set on %@. \n\n Thank you!", [prof valueForKey:@"Name"], [self getDateForPurpose:4]];
} else {
[mailViewController setSubject:[self getTitleForPurpose:1]];
}
message = [message stringByAppendingString:[NSString stringWithFormat:@"\n\nAttached is an event file. You may add this event to your calendar.\n\n(This is an automated email from WPI Calendar Events Creator app)\n"]];
[mailViewController setMessageBody:message isHTML:NO]; [mailViewController setMessageBody:message isHTML:NO];
... ...
......
...@@ -36,6 +36,11 @@ ...@@ -36,6 +36,11 @@
{ {
[super viewDidLoad]; [super viewDidLoad];
// Do any additional setup after loading the view. // Do any additional setup after loading the view.
}
-(void)viewDidAppear:(BOOL)animated {
[self.notesTextField becomeFirstResponder];
} }
- (void)didReceiveMemoryWarning - (void)didReceiveMemoryWarning
... ...
......
...@@ -41,11 +41,17 @@ ...@@ -41,11 +41,17 @@
[model.data setValue:self.specificPlaceTextField.text forKey:@"Specific Place"]; [model.data setValue:self.specificPlaceTextField.text forKey:@"Specific Place"];
} }
-(void)viewDidAppear:(BOOL)animated {
[self.roomNumberTextField becomeFirstResponder];
}
- (void)viewDidLoad - (void)viewDidLoad
{ {
[super viewDidLoad]; [super viewDidLoad];
// Do any additional setup after loading the view. // Do any additional setup after loading the view.
UIToolbar* numberToolbar = [[UIToolbar alloc]initWithFrame:CGRectMake(0, 0, 320, 50)]; UIToolbar* numberToolbar = [[UIToolbar alloc]initWithFrame:CGRectMake(0, 0, 320, 50)];
numberToolbar.barStyle = UIBarStyleDefault; numberToolbar.barStyle = UIBarStyleDefault;
numberToolbar.items = [NSArray arrayWithObjects: numberToolbar.items = [NSArray arrayWithObjects:
... ...
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
@property (weak, nonatomic) IBOutlet UILabel *buildingCellSubtitleLabel; @property (weak, nonatomic) IBOutlet UILabel *buildingCellSubtitleLabel;
@property (weak, nonatomic) IBOutlet UILabel *alertCellSubtitleLabel; @property (weak, nonatomic) IBOutlet UILabel *alertCellSubtitleLabel;
@property (weak, nonatomic) IBOutlet UILabel *notesCellSubtitleLabel; @property (weak, nonatomic) IBOutlet UILabel *notesCellSubtitleLabel;
@property (weak, nonatomic) IBOutlet UISegmentedControl *segmentedControll;
@property (weak, nonatomic) IBOutlet UILabel *dateCellConflictLabel; @property (weak, nonatomic) IBOutlet UILabel *dateCellConflictLabel;
- (IBAction)favoritesButtonPressed:(id)sender; - (IBAction)favoritesButtonPressed:(id)sender;
...@@ -131,6 +132,7 @@ ...@@ -131,6 +132,7 @@
-(void)configureDetailsCell { -(void)configureDetailsCell {
WPIModel *model = [WPIModel sharedDataModel]; WPIModel *model = [WPIModel sharedDataModel];
[self.segmentedControll setSelectedSegmentIndex:[(NSNumber*)[model.data valueForKey:@"Type"] integerValue]];
switch ([(NSNumber*)[model.data valueForKey:@"Type"] integerValue]) { switch ([(NSNumber*)[model.data valueForKey:@"Type"] integerValue]) {
case 0: case 0:
self.detailsCellMainLabel.text = @"Professor..."; self.detailsCellMainLabel.text = @"Professor...";
... ...
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment