scrollview的模式切换;退出原来的模式使用新模式。

2018-04-18 18:16:41.208113+0800 CEMonitor[5014:410604] kCFRunLoopDefaultMode

2018-04-18 18:16:41.208395+0800 CEMonitor[5014:410604] kCFRunLoopDefaultMode

2018-04-18 18:16:41.208638+0800 CEMonitor[5014:410604] kCFRunLoopDefaultMode

2018-04-18 18:16:41.209857+0800 CEMonitor[5014:410604] run loop exit

2018-04-18 18:16:41.209986+0800 CEMonitor[5014:410604] kCFRunLoopDefaultMode

2018-04-18 18:16:41.210249+0800 CEMonitor[5014:410604] run loop entry

2018-04-18 18:16:41.210629+0800 CEMonitor[5014:410604] UITrackingRunLoopMode

2018-04-18 18:16:41.210832+0800 CEMonitor[5014:410604] UITrackingRunLoopMode

 

Run Loop Modes

run loop mode is a collection of input sources and timers to be monitored and a collection of run loop observers to be notified. Each time you run your run loop, you specify (either explicitly or implicitly) a particular “mode” in which to run. During that pass of the run loop, only sources associated with that mode are monitored and allowed to deliver their events. (Similarly, only observers associated with that mode are notified of the run loop’s progress.) Sources associated with other modes hold on to any new events until subsequent passes through the loop in the appropriate mode.

In your code, you identify modes by name. Both Cocoa and Core Foundation define a default mode and several commonly used modes, along with strings for specifying those modes in your code. You can define custom modes by simply specifying a custom string for the mode name. Although the names you assign to custom modes are arbitrary, the contents of those modes are not. You must be sure to add one or more input sources, timers, or run-loop observers to any modes you create for them to be useful.

You use modes to filter out events from unwanted sources during a particular pass through your run loop. Most of the time, you will want to run your run loop in the system-defined “default” mode. A modal panel, however, might run in the “modal” mode. While in this mode, only sources relevant to the modal panel would deliver events to the thread. For secondary threads, you might use custom modes to prevent low-priority sources from delivering events during time-critical operations. 

Note: Modes discriminate based on the source of the event, not the type of the event. For example, you would not use modes to match only mouse-down events or only keyboard events. You could use modes to listen to a different set of ports, suspend timers temporarily, or otherwise change the sources and run loop observers currently being monitored. 

------------------越是喧嚣的世界,越需要宁静的思考------------------ 合抱之木,生于毫末;九层之台,起于垒土;千里之行,始于足下。 积土成山,风雨兴焉;积水成渊,蛟龙生焉;积善成德,而神明自得,圣心备焉。故不积跬步,无以至千里;不积小流,无以成江海。骐骥一跃,不能十步;驽马十驾,功在不舍。锲而舍之,朽木不折;锲而不舍,金石可镂。蚓无爪牙之利,筋骨之强,上食埃土,下饮黄泉,用心一也。蟹六跪而二螯,非蛇鳝之穴无可寄托者,用心躁也。