<span id="Label3"></p><p><p><span style="font-size: 18px;">Uiappliacation class</span></p></p><p><p><span style="font-size: 18px;">Each application has only one instance object of the UIApplication class</span></p></p><p><p><span style="font-size: 18px;">A running application is a uiapplication object.</span></p></p><p><p></p></p><p><p><span style="font-size: 18px;">Uiapplicationmain</span></p></p><p><p><span style="font-size: 18px;">Create a singleton object for the UIApplication object (singleton)</span></p></p><p><p></p></p><p class="p1"><p class="p1"><span class="s1" style="font-size: 18px;">The role of your app ' s application object</span></p></p><p class="p1"><p class="p1"><span class="s1" style="font-size: 18px;"><span class="s2">. <span class="s1">handle the initial routing of incoming user events</span> </span></span></p></p><p class="p2"><p class="p2"><span class="s1" style="font-size: 18px;"><span class="Apple-tab-span">A loop that handles user behavior</span></span></p></p><p class="p1"><p class="p1"><span class="s3" style="font-size: 18px;"><span class="s2">. <span class="s1">dispatches action messages forwarded to it by control objects (instances of the <span class="s4">Uicontrol</span> Class) to Appropria Te Target Objects.</span> </span></span></p></p><p class="p2"><p class="p2"><span class="s1" style="font-size: 18px;"><span class="Apple-tab-span">Assigning specific behaviors to specific target objects (passing different events to different UI Controls)</span></span></p></p><p class="p2"><p class="p2"></p></p><p class="p2"><p class="p2"><span style="font-size: 18px;">Tasks</span></p></p><p class="p1"><p class="p1"><span class="s1" style="font-size: 18px;">Getting the App Instance: get singleton objects</span></p></p><p class="p1"><p class="p1"><span class="s1" style="font-size: 18px;">Getting the app Delegate: get application proxy (the State of the capture Program)</span></p></p><p class="p1"><p class="p1"><span class="s1" style="font-size: 18px;">Getting App windows: Get window</span></p></p><p class="p1"><p class="p1"><span class="s1" style="font-size: 18px;">Controlling and handling Events: handling event</span></p></p><p class="p1"><p class="p1"><span class="s1" style="font-size: 18px;">Opening a URL Resource: open external app resource (Safari)</span></p></p><p class="p1"><p class="p1"><span class="s1" style="font-size: 18px;">Configuring the user Notification Setting: configuring notifications for users</span></p></p><p class="p1"><p class="p1"><span class="s1" style="font-size: 18px;">Registering for remote notifications: remotely notify (QQ message, update Notification)</span></p></p><p class="p1"><p class="p1"><span class="s1" style="font-size: 18px;">Registering for local notifications: native notification (alarm)</span></p></p><p class="p1"><p class="p1"><span class="s1" style="font-size: 18px;">Managing Background Execution: managing the execution of the background</span></p></p><p class="p1"><p class="p1"><span class="s1" style="font-size: 18px;">Managing Home Screen Quick Actions for 3D Touch: shortcuts</span></p></p><p class="p1"><p class="p1"><span class="s1" style="font-size: 18px;">Controlling App appearance: The appearance of the hypervisor (status bar, network indication, Direction)</span></p></p><p class="p1"><p class="p1"></p></p><p class="p1"><p class="p1"><span class="s1" style="font-size: 18px;">Nsstringfronclass converts a class into a string form</span></p></p><p class="p1"><p class="p1"><span class="s1" style="font-size: 18px;">Nsstringfronclass ([appdelegate Class])</span></p></p><p class="p1"><p class="p1"></p></p><p class="p1"><p class="p1"><span class="s1" style="font-size: 18px;">Some important events that occur during the operation of the Uiapplicationdelegate responder (program startup, entering the background, activating, memory tight). )</span></p></p><p class="p1"><p class="p1"></p></p><p class="p1"><p class="p1"><span class="s1" style="font-size: 18px;">Application proxies and apps work together to ensure the interaction between the program and the system or other programs</span></p></p><p class="p1"><p class="p1"></p></p><p class="p1"><p class="p1"><span class="s1" style="font-size: 18px;">Application proxy is the root object of the program and is always present throughout the Program.</span></p></p><p class="p1"><p class="p1"></p></p><p class="p1"><p class="p1"><span style="font-size: 18px;">The methods inside the APP delegate should be implemented</span></p></p><p class="p2"><p class="p2"><span class="s1" style="font-size: 18px;">The app delegate performs several crucial roles:</span></p></p> <ul class="ul1"> <ul class="ul1"> <li class="li2"><span class="s2" style="font-size: 18px;">. <span class="s1">It contains your app ' s startup Code.</span></span></li> <li class="li3"><span class="s3" style="font-size: 18px;">Can be set in the agent using code</span></li> </ul> </ul><p class="p3"><p class="p3"><span class="Apple-tab-span" style="font-size: 18px;"><span class="Apple-tab-span">A. The first method that the program loads to invoke (configuration, Register server information, read data, configure Interface)</span></span></p></p><p class="p4"><p class="p4"><span class="s4" style="font-size: 18px;"><span class="Apple-tab-span"><span class="Apple-tab-span"> <span class="s5">//not Yet running into memory</span> </span></span></span></p></p> <ul class="ul1"> <li class="li5"><li class="li5"><span class="s4" style="font-size: 18px;"><span class="s1">-(BOOL) application: (uiapplication *) application willfinishlaunchingwithoptions: (nullable nsdictionary *) Launchoptions Ns_available_ios (6_0);</span></span></li></li> <li class="li6"><li class="li6"></li></li> <li class="li4"><li class="li4"><span class="s5" style="font-size: 18px;">Load well, need to configure the displayed interface</span></li></li> <li class="li5"><li class="li5"><span class="s1" style="font-size: 18px;">-(BOOL) application: (uiapplication *) application didfinishlaunchingwithoptions: (nullable nsdictionary *) Launchoptions Ns_available_ios (3_0);</span></li></li> <li class="li7"><li class="li7"></li></li> <li class="li2"><li class="li2"><span class="s1" style="font-size: 18px;">It responds to key changes in the your app. specifically, it responds to both temporary interruptions and to Chan Ges in the execution state of your apps, such as when your apps transitions from the foreground to the Background.</span></li></li> <li class="li8"><li class="li8"><span class="s6" style="font-size: 18px;">Temporary interruption, State Change</span></li></li> <li class="li9"><li class="li9"></li></li> <li class="li7"><li class="li7"></li></li> <li class="li2"><li class="li2"><span class="s1" style="font-size: 18px;">It responds to notifications originating from outside the app, such as remote notifications (also known as push Notificati ons), low-memory warnings, Download completion notifications, and More.</span></li></li> <li class="li3"><li class="li3"><span class="s3" style="font-size: 18px;">External notifications (message push, insufficient memory, background download Complete)</span></li></li> <li class="li5"><li class="li5"><span class="s7" style="font-size: 18px;"><span class="s1">Registerforremotenotificationtypes:</span></span></li></li> <li class="li7"><li class="li7"></li></li> <li class="li2"><li class="li2"><span class="s1" style="font-size: 18px;">IT determines whether state preservation and restoration should occur and assists in the preservation and restoration proc ESS as Needed.</span></li></li> <li class="li8"><li class="li8"><span class="s6" style="font-size: 18px;"><span class="s1">Determine if the state (data) of the program should be saved or restored</span></span></li></li> <li class="li7"><li class="li7"></li></li> <li class="li2"><li class="li2"><span class="s1" style="font-size: 18px;">It responds to events that target the app itself and is not specific to your app's views or view Controllers.</span></li></li> <li class="li8"><li class="li8"><span class="s6" style="font-size: 18px;">Events responding to the application itself</span></li></li> <li class="li5"><li class="li5"><span class="s8" style="font-size: 18px;"><span class="s1">Application:openURL:options:</span></span></li></li> <li class="li7"><li class="li7"></li></li> <li class="li2"><li class="li2"><span class="s1" style="font-size: 18px;">You can use the it to store your App's central data objects or any content this does not has an owning view controller.</span></li></li> <li class="li8"><li class="li8"><span class="s6" style="font-size: 18px;">Save the current core data of the program or other data that is not viewcontroller saved</span></li></li> </ul><p class="p10"><p class="p10"><span style="font-size: 18px;"></span></p></p><p class="p11"><p class="p11"><span class="s9" style="font-size: 18px;">Uiresponder</span></p></p><p class="p2"><p class="p2"><span class="s1" style="font-size: 18px;">The <span class="s10">Uiresponder<span class="s1"> class defines a interface for objects, respond to and handle Events.</span> </span></span></p></p><p class="p12"><p class="p12"><span style="font-size: 18px;">Interfaces that define object responses and handle events</span></p></p><p class="p12"><p class="p12"><span style="font-size: 18px;">All UI controls capable of handling events are directly or indirectly inherited from Uiresponder</span></p></p><p class="p10"><p class="p10"><span style="font-size: 18px;"></span></p></p><p class="p1"><p class="p1"><span style="font-size: 18px;">Two main Event Behaviors: touch events and motion events</span></p></p><p class="p2"><p class="p2"><span class="s1" style="font-size: 18px;">There is both general kinds of Events:touch events and motion Events.</span></p></p><p class="p2"><p class="p2"><span class="s1" style="font-size: 18px;">Uievent</span></p></p><p class="p5"><p class="p5"><span class="s1" style="font-size: 18px;">Touchesbegan:withevent:<span class="s11">,</span></span></p></p><p class="p5"><p class="p5"><span class="s1" style="font-size: 18px;">Touchesmoved:withevent:<span class="s11">,</span></span></p></p><p class="p5"><p class="p5"><span class="s1" style="font-size: 18px;">Touchesended:withevent:<span class="s11">,</span></span></p></p><p class="p5"><p class="p5"><span class="s1" style="font-size: 18px;">Touchescancelled:withevent:<span class="s11">.</span></span></p></p><p class="p9"><p class="p9"><span class="s1" style="font-size: 18px;"></span></p></p><p class="p5"><p class="p5"><span class="s1" style="font-size: 18px;">Motionbegan:withevent:<span class="s11">,</span></span></p></p><p class="p5"><p class="p5"><span class="s1" style="font-size: 18px;">Motionended:withevent:<span class="s11">,</span></span></p></p><p class="p5"><p class="p5"><span class="s11" style="font-size: 18px;"><span class="s1">motioncancelled:withevent:<span class="s11">.</span> </span></span></p></p><p class="p5"><p class="p5"><span class="s11" style="font-size: 18px;">iOS3.0 <span class="s1">canperformaction:withsender:</span></span></p></p><p class="p2"><p class="p2"><span class="s1" style="font-size: 18px;">IOS 4.0, <span class="s10">Uiresponder<span class="s1"> added the <span class="s12">remotecontrolreceivedwithevent:<span class="s1"> method for handling Remote-control events .</span></span></span></span></span></p></p><p class="p9"><p class="p9"><span class="s1" style="font-size: 18px;"></span></p></p><p class="p1"><p class="p1"><span style="font-size: 18px;">Responder Chain Responder Chain</span></p></p><p class="p12"><p class="p12"><span style="font-size: 18px;">The view has a hierarchical relationship, and the added view overrides the previous view when an event Occurs. The first view will receive this event, and if the view does not respond, then continue to pass the event to the next level until uiwindow, if it does not respond, then the event will be discarded, and in the process, as long as there is a response, then the event stops Passing.</span></p></p><p class="p10"><p class="p10"><span style="font-size: 18px;"></span></p></p><p class="p13"><p class="p13"><span style="font-size: 18px;"></span></p></p><p class="p10"><p class="p10"><span style="font-size: 18px;"></span></p></p><p class="p8"><p class="p8"><span class="s1" style="font-size: 18px;">Why to use a proxy</span></p></p><p class="p12"><p class="p12"><span style="font-size: 18px;">To simplify the code logic (apple itself designs the look and feel of the system, leaving the manufacturing, materials, and sales agents out to focus on the core modules)</span></p></p><p class="p12"><p class="p12"><span style="font-size: 18px;">Inheritance can accomplish the function of the agent (if the use of inheritance, the equivalent of Apple itself has its own manufacturing subsidiaries, materials subsidiaries, sales subsidiaries, to their own management increased difficulty, and can not focus on core Competitiveness)</span></p></p><p class="p14"><p class="p14"><span style="font-size: 18px;"></span></p></p><p class="p12"><p class="p12"><span style="font-size: 18px;">The entire application has only one proxy (the default system gives us the Appdelegate Class)</span></p></p><p class="p14"><p class="p14"><span style="font-size: 18px;"></span></p></p><p class="p14"><p class="p14"><span style="font-size: 18px;"></span></p></p><p class="p15"><p class="p15"><span class="s1" style="font-size: 18px;">UIWindow</span></p></p><p class="p2"><p class="p2"><span class="s1" style="font-size: 18px;">Manages and coordinates the "an" app displays on a device screen</span></p></p><p class="p12"><p class="p12"><span style="font-size: 18px;">Manage and coordinate the view shown above the device screen</span></p></p><p class="p12"><p class="p12"><span style="font-size: 18px;">An application typically has only one window</span></p></p><p class="p14"><p class="p14"><span style="font-size: 18px;"></span></p></p><p class="p12"><p class="p12"><span style="font-size: 18px;">Features of the UIWindow</span></p></p><p class="p2"><p class="p2"><span class="s13" style="font-size: 18px;"><span class="Apple-tab-span">. <span class="s1">provide</span> an area for displaying it views</span></span></p></p><p class="p12"><p class="p12"><span class="Apple-tab-span" style="font-size: 18px;">Provides an area to display the view</span></p></p><p class="p2"><p class="p2"><span class="s1" style="font-size: 18px;"><span class="Apple-tab-span">. Distribute events to the Views.</span></span></p></p><p class="p12"><p class="p12"><span class="Apple-tab-span" style="font-size: 18px;">Distributing events to a view</span></p></p><p class="p8"><p class="p8"><span class="s14" style="font-size: 18px;"><span class="Apple-tab-span">. <span class="s1">a UIWindow object must be set to a main interface</span></span></span></p></p><p class="p12"><p class="p12"><span class="Apple-tab-span" style="font-size: 18px;">Setting the Rootviewcontroller property of a window</span></p></p><p class="p8"><p class="p8"><span class="s15" style="font-size: 18px;"><span class="s14">. <span class="s1">Display window</span> </span></span></p></p><p class="p12"><p class="p12"><span class="Apple-tab-span" style="font-size: 18px;">Calling the Makekeyandvisible property</span></p></p><p class="p16"><p class="p16"><span class="s9" style="font-size: 18px;"></span></p></p><p class="p1"><p class="p1"><span style="font-size: 18px;">UIScreen</span></p></p><p class="p2"><p class="p2"><span class="s1" style="font-size: 18px;"><span class="Apple-tab-span">A <span class="s10">UIScreen<span class="s1"> object defines the properties associated with a hardware-based display</span> </span></span></span></p></p><p class="p17"><p class="p17"><span class="s1" style="font-size: 18px;"><span class="Apple-tab-span">Define some properties with hardware-based display</span></span></p></p><p class="p18"><p class="p18"><span class="s1" style="font-size: 18px;"></span></p></p><p class="p1"><p class="p1"><span class="Apple-tab-span" style="font-size: 18px;">How to get the home screen of a device</span></p></p><p class="p12"><p class="p12"><span class="Apple-tab-span" style="font-size: 18px;">[uiscreen mainscreen]</span></p></p><p class="p14"><p class="p14"><span style="font-size: 18px;"></span></p></p><p class="p12"><p class="p12"><span class="Apple-tab-span" style="font-size: 18px;">How to get the rectangle coordinates of a view</span></p></p><p class="p12"><p class="p12"><span class="Apple-tab-span" style="font-size: 18px;">Bounds Property</span></p></p><p class="p10"><p class="p10"><span style="font-size: 18px;"></span></p></p><p class="p1"><p class="p1"><span style="font-size: 18px;">Sizes for various sets:</span></p></p><p class="p19"><p class="p19"><span class="s16" style="font-size: 18px;"><span class="s17">4 (* 480)</span></span></p></p><p class="p19"><p class="p19"><span class="Apple-tab-span" style="font-size: 18px;">5 (320 * 568)</span></p></p><p class="p19"><p class="p19"><span class="Apple-tab-span" style="font-size: 18px;">6 (<span class="s9">375 * 667)</span></span></p></p><p class="p19"><p class="p19"><span class="Apple-tab-span" style="font-size: 18px;">6+ (<span class="s9">414 * 736)</span></span></p></p><p class="p2"><p class="p2"></p></p><p class="p2"><p class="p2"></p></p><p class="p2"><p class="p2"></p></p><p class="p2"><p class="p2"></p></p><p class="p2"><p class="p2"></p></p><p class="p2"><p class="p2"></p></p><p class="p2"><p class="p2"></p></p><p class="p2"><p class="p2"></p></p><p class="p2"><p class="p2"></p></p><p class="p2"><p class="p2"></p></p><p class="p2"><p class="p2"></p></p><p><p>iOS Readiness Program</p></p></span>
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service