Last active
August 29, 2015 14:17
-
-
Save 98chimp/d85ea2cd12324f01fe1e to your computer and use it in GitHub Desktop.
Week02 - D03 Questions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Q1. Part I = d; | |
Q1. Part 2 = a; | |
Q2. The App Delegate will: | |
- monitor the presence of a touch event; | |
- detect a touch event; | |
- record the (x, y) coordinates of the touch event; | |
- correlate the touch coordinates with the bounds of all existing views; | |
- determine the a match between the touch event's coordinates and the bounds of a specific view; | |
- identify that view as the item touched on the screen; | |
Q3. According to Apple documentation, the contentOffset property represents the point at which the origin of the content view is offset from the origin of the scroll view. | |
One can utilize this property to programmatically scroll using code similar to the following: | |
float width = scrollView.frame.size.width; | |
float height = scrollView.frame.size.height; | |
float newPosition = scrollView.contentOffset.x+width; | |
CGRect toVisible = CGRectMake(newPosition, 0, width, height); | |
[scrollView scrollRectToVisible:toVisible animated:YES]; | |
Q4. The initWithFileURL:options:documentAttributes:error method of NSAttributedString is not available in the main App Dev Documentation because this method is its pre-release phase of development. Relevant documentation regarding this method can be found @ NSAttributedString UIKit Additions Reference (http://apple.co/1O7QUdz). | |
Q5. By stepping through the followning sequence one can deactive a text-feild without having a direct reference to the active control: | |
i) make another control to -becomeFirstResponder; | |
ii) desinate the other control as -isFirstResponder; | |
By virtue of each window having only ONE firstResponder, the newly designated firstResponder will jump ahead of the text field and hence lead to it becoming inactive. | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment