combing1のブログ -12ページ目

combing1のブログ

ブログの説明を入力します。

In iOS Air Max 2012 Black Navy Blue White 5.0 before, the view controller vessel belongs to all Apple systems, Apple does not recommend that you customize the view controller container. In fact, in view of the Controller Programming Guide for this chapter explicitly told us not to use it. Apple's former controller for an overall view of a container described as 'a management of the entire screen content view controller', but now described as 'unit contains its own view of the contents of the Air Jordan Outlet collection.' Why Apple does not want us 579756 403 Purple White Nike Black Mamba 24 Kobe Sale to custom view controller container such as tab bar controllers and navigation controllers do? More precisely, the following statement will bring any problems: [viewControllerA.view addsubView: viewControllerB.view] UIWindow as the root 597806-400 Nike LeBron X EXT QS Denim-Pink Outlet view of the application, is responsible for monitoring and distributing screen rotation and view layout and other news. In the figure above, ViewController of view which is inserted into the root view controller of a view as its child view, this view will not receive UIWindow on the news, like viewWillAppear: Nike Free Run 3 This method will not be called ʱ?? A reference in ios5.0 before our custom view controller container, will hold a subclass of view controller, and an event message that we need to manually transfer the parent view controller subclass to call the view controller accurately complete the work too hard! Detailed examples: When a child you play on the beach, your parents ever tell you: If you have been with your little Nike Free Run Nike Dunk Heels 3 Women shovel to dig, has been digging, and eventually you can go to China dug across the globe (author in the United States). My parents had told me this, I made a call Tunnel application to test it this view. You can attach on GitHub Repo and run the program, so you can better help you understand this instance. If you want to get the current position relative to the surface of the location (opposite of the Earth), a mobile holding a shovel that villain, the map will tell you the exact location of the outlet. Touch the radar button, the map will flip and show the exact names. On the current screen, there are two maps view controllers, each of which need to be addressed drag, label position, as well as update the map these events. It will show two opposite locations map view controller after flipping pages. All of these view controllers are present in a parent view controller containers, these view controllers hold their view, to ensure that the layout and flip view can be correct. Root view controller has two view of the container, adding the purpose of the two is more convenient to view each child container layout, animation and other operations to perform, let's explain. - (Void) viewDidLoad {[super viewDidLoad]; // Setup controllers _startMapViewController = [RGMapViewController new]; [_startMapViewController setAnnotationImagePath: @ \u0026 quot; man \u0026 quot;]; [self addChildViewController: _startMapViewController]; // 1 [topContainer addSubview: _startMapViewController.view ]; // 2 [_startMapViewController didMoveToParentViewController: self]; // 3 [_startMapViewController addObserver: self forKeyPath: @ \u0026 quot; currentLocation \u0026 quot; options: NSKeyValueObservingOptionNew context: NULL]; _startGeoViewController = [RGGeoInfoViewController new]; // 4} _startMapViewController to display starting position, the first instance and initializes with marked picture. 1._startMapViewController as a child of the root view controller is added thereto, subclasses willMoveToParentViewController: method will be automatically executed. 2. The above sub-class view as the first view of the container of subviews view to add to it. 3. subview receives a notification, it now has a parent view. 4. Make the geographical Nike Air Max encoded sub-view controller is initialized, but not now be inserted into any view or controller structure. Layout root view controller defined two views determines the size of the container Nike Lebron 11 Elite were their child view controller. Subclass of view controller does not know which view would be added to the container, so their size size must be variable. - (Void) loadView {mapView = [MKMapView new]; mapView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; [mapView setDelegate: self]; [mapView setMapType: MKMapTypeHybrid]; self.view = mapView;} Now they will view the parent class bounds to the layout, thus increasing the reusability subclass view, if we push it into the navigation controller stack, they will still be correct layout. Apple provides transition effects view controller container API is so detailed that we can almost in any way we can think of to initialize the container or perform a variety of animations. Apple also provides a convenient method to use to block the exchange of two views on the current screen. transitionFromViewController: toViewController: above this method we reveal many details - (void) flipFromViewController: (UIViewController *) Air Max 2011 Womens Grey Green fromController toViewController: (UIViewController *) toController withDirection: (UIViewAnimationOptions) direction {toController.view.frame = fromController.view.bounds; // 1 [self addChildViewController: toController]; // [fromController willMoveToParentViewController: nil]; // [self transitionFromViewController: fromController toViewController: toController duration: 0.2 options: direction | UIViewAnimationOptionCurveEaseIn animations: nil completion: ^ (BOOL finished) {[toController didMoveToParentViewController: self]; // 2 [fromController removeFromParentViewController]; // 3}];} 1 toViewController execution before Nike Jordan Melo B Mo we add animation, fromViewController will receive a notification will be removed, if fromViewController is a container view class view. , then the time controller viewWillDisappear: method will be called. 2.toViewController receives a message from the parent view, the corresponding method is called. 3.fromViewController be removed. Above this method, you can automatically convert the old view and replaced with the new view. If you want to implement your own conversion method, and you want every moment can only show one view, you must call the old view removeFromSuperview method, a new view calls addSubview: method. Order to invoke a method if an error will result UIViewControllerHierarchyInconsistency warning. For example, before you add a view to call the view didMoveToParentViewController: error will occur. To be Nike Free Run 3 able to use UIViewAnimationOptionTransitionFlipFromTop move sequence, we must handle the 585388-083 Anti-Nerf Nike KD V Elite Outlet class view controller is added to the view of the container, rather than adding to the root view controller, otherwise, implement animation will cause the entire root view flip. Communication view controller should be able to reuse the current view contains an entity subclasses view should also follow this rule of thumb. To comply with this law, the parent view controller should only 2015 Nike Free 5.0 be responsible for two tasks: root view controller subclass layout view through API interface to communicate with the child class view controller itself exposed should not directly modify the subclass views tree structure and status. In Tunnel application example, the parent view controller will keep listening currentLocation among property map view controllers. [_startMapViewController AddObserver: self forKeyPath: @ \u0026 quot; currentLocation \u0026 quot; options: NSKeyValueObservingOptionNew context: NULL]; when you move a little boy holding a shovel next to the map, the corresponding property will change, then the parent view controller to new location relative (Earth opposite) transfer to another location map. Similarly, when you click on the radar button, parent view controller set corresponding Nike Dunk Heels to the position of the previous location in the new sub-class view controller. [_startGeoViewController SetLocation: _startMapViewController.currentLocation]; [_ targetGeoViewController setLocation: _targetMapViewController.currentLocation]; try to choose an independent way to complete the communication sub-class view and parent view (KVO, Notification Center, proxy mode), which is mentioned above Communications law is consistent, that is a subclass of view controllers should be independent, and has reusability. In our routine, we can put a view controller pushed onto the navigation controller stack, but the communication interface still choose the same API.objc series PRESIDENT (1.4): Detailed view controller container