The application behavior should be The user enters values into the name and city
ID: 3887256 • Letter: T
Question
The application behavior should be The user enters values into the name and city fields . The user touches the Return key on the keyboard or anywhere that isn't a view and the keyboard is dismissed The user touches the Save button and the message-label Ul element is modified with the string " ". The and values come from the related elements in the user interface . If either the name or city fields are empty when the user touches the Save button the message "You must enter a value for *both* name and city!!" should be displayed in the message label area 1. Create a Single View application project named -hw2 2. Open the storyboard a. Set the storyboard device size to be iPhone 7. b. Modify the empty view controller to match the screen shot below This user interface contains the following Ul elements . A label for "Enter your name and City:" .A label for "Name" . A label for "City:" .A text field to enter the name value . A text field to enter the city value . A label for "When ready click save". . A button with the title "Save . A label that will be modified programmatically for messages, but can be initially set toExplanation / Answer
Step 1: Create your xcode project named <last-name><first-name>hw2
Select Application (in iOS) and then select "Single View Application" , then click on "Next". Under Product name, enter your project name as “<last-name><first-name>hw2”
Step 2: Now Drag from Object Library- “Vertical Stack View Object”
Step 3: Seek for the element “UILabel” from Library pane and drag it to your view. This will be found in right hand side.
Step 4: Next, search for the other element “UITextField” from lower part of right hand side and drag it into your view.
Step 5: Now, search “UIButton” from lower part of right hand side and drag it into your view.
Step 6: For changing the text of UIButton and UILabel, we need a method called “viewDidLoad”.
Add the code as follows:
(void)viewDidLoad
{//Additional setups can be done after loading of view from nib
[super viewDidLoad];
self. <last-name><first-name>hw2.text = @"name";
self. <last-name><first-name>hw2.text = @"city";
[self.saveButton setTitle:@"Save" forState:UIControlStateNormal];
}
Step 7: Add a method named “btnSaveClicked” under “handleButtonClick”.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.