iOS Development Basics-Fragmentation 32

Source: Internet
Author: User

1: Animation Properties uiviewanimationoptions Description

A: General animation property settings (multiple settings can be selected at the same time)

Uiviewanimationoptionlayoutsubviews: Ensure that the child view follows the motion during the animation.

Uiviewanimationoptionallowuserinteraction: Allows user interaction during animation.

Uiviewanimationoptionbeginfromcurrentstate: All views start running from the current state.

Uiviewanimationoptionrepeat: Run the animation repeatedly.

Uiviewanimationoptionautoreverse: The animation is still animated back to the initial point after it runs to the end point.

Uiviewanimationoptionoverrideinheritedduration: Ignores nested animation time settings.

Uiviewanimationoptionoverrideinheritedcurve: Ignores nested animation speed settings.

Uiviewanimationoptionallowanimatedcontent: Redraw The View during animation (note only for transition animations).

Uiviewanimationoptionshowhidetransitionviews: Hide the old view directly, display the new view when the view toggles, instead of removing the old view from the parent view (only for transition animations)
Uiviewanimationoptionoverrideinheritedoptions: Does not inherit parent animation settings or animation types.

B. Animation speed control (from which a setting can be selected)

Uiviewanimationoptioncurveeaseinout: The animation is slow, then gradually accelerates.

Uiviewanimationoptioncurveeasein: Animation gradually slows down.

Uiviewanimationoptioncurveeaseout: Animation gradually accelerates.

Uiviewanimationoptioncurvelinear: The animation is executed at a constant speed, default value.

C. Transition type (applies only to transition animation settings, from which you can choose one to set, basic animations, keyframe animations do not need to be set)

Uiviewanimationoptiontransitionnone: No transition animation effect.

Uiviewanimationoptiontransitionflipfromleft: Flips the effect from the left.

Uiviewanimationoptiontransitionflipfromright: Flips the effect from the right.

Uiviewanimationoptiontransitioncurlup: Animated transition effect that pages back.

Uiviewanimationoptiontransitioncurldown: Animated transition effect that pages forward.

Uiviewanimationoptiontransitioncrossdissolve: The old view dissolve disappears to show the effect of the next new view.

Uiviewanimationoptiontransitionflipfromtop: Flips the effect from above.

Uiviewanimationoptiontransitionflipfrombottom: Flips the effect from the bottom.

2: Complex Uitablecellview, removing reuse

-(UITableViewCell *) TableView: (UITableView *) TableView Cellforrowatindexpath: (Nsindexpath *) indexpath{    __weak typeof (self) weakself = self;    Blspayordermodel *model=self.datalist[indexpath.section];    Blsprojectmoneycompletecell *cell = [TableView dequeuereusablecellwithidentifier:nsstringfromclass ([ Blsprojectmoneycompletecell class]);    if (cell) {        Cell=[[blsprojectmoneycompletecell alloc]initwithstyle:uitableviewcellstyledefault reuseIdentifier : Nsstringfromclass ([Blsprojectmoneycompletecell class]);    }    else    {        //delete all child views of cell while        ([cell.contentView.subviews lastobject]! = nil)        {            [(uiview*) [ Cell.contentView.subviews Lastobject] removefromsuperview];        }    }    Cell.mypayordermodel=model;    return cell;}

3: Local Notification application

Enter the information you want to send, passing the value of the label through the button method call,-(ibaction) ButtonClick: (ID) Sender {//Adds a dictionary, passing the value of the label through the key value setting Nsdictionary *di CT =[[nsdictionary alloc] initwithobjectsandkeys:self.textfieldone.text,@ "Textone", self.textfieldtwo.text,@ "    Texttwo ", nil];    Create notification nsnotification *notification =[nsnotification notificationwithname:@ "Tongzhi" Object:nil userInfo:dict];    Send notifications via notification hubs [[Nsnotificationcenter Defaultcenter] postnotification:notification]; [Self.navigationcontroller Popviewcontrolleranimated:yes];    After the notification is sent, the notification listener is registered in the controller to be received, and the information sent by the notification is received-(void) viewdidload {[Super viewdidload]; Registration notice [[nsnotificationcenter defaultcenter] addobserver:self selector: @selector (Tongzhi:) name:@ "Tongzhi" object: NIL];        }-(void) Tongzhi: (nsnotification *) text{NSLog (@ "%@", text.userinfo[@ "Textone"]); NSLog (@ "--Receive notification------"); Remove notifications: Removeobserver: And RemoveObserver:name:object: Where, Removeobserver: is the delete Notification Center Save Schedule table for all portals of an observer, and Removeobserver: Name:object: is to delete a portal that matches the observer in the dispatch table saved by the notification center. This is relatively straightforward, calling the party directlyAct on the line. For example: [[Nsnotificationcenter Defaultcenter] removeobserver:observer name:nil object:self]; Note that the parameter notificationobserver is the observer to be deleted and must not be nil.

URL scheme knowledge points in 4:ios

An interesting feature in the iOS SDK is the ability to bind iOS application to a custom URL schema, and to launch the application in a browser or other application via URL scheme. This article mainly describes how to launch the application and parameter delivery by URL scheme.

1, first add a row in the *-info.plist, select the URL types, the effect as shown:

2. In the expanded item 0, fill in the URL identifier, which uniquely identifies the user-defined URL Scheme, it is recommended to use the reverse form of the domain name, such as: Com.devzeng.demo

3: Add a new row in item 0, select URL schemes

4. Expand URL Schemes and enter the name of the custom scheme in item 0. Here you only need to enter the name of a custom scheme, you do not need to add://, for example, the input is Devzeng, then the corresponding custom URL is devzeng://, where you can enter more than one.

5. The last complete example:

Use URL Scheme?

1. Use in Safari?? Start your app just by typing devzeng://in the address bar of your browser directly in Safari?

2. Use in other applications?? Use the following code where you need to call to implement the call

NSString *customurl = @ "devzeng://"; [[UIApplication sharedapplication] Openurl:[nsurl Urlwithstring:customurl]];

3, the transfer of parameters

-(void) openotherapp{    nsstring *customurl = @ "devzeng://?token=123abct®istered=1";    [[UIApplication sharedapplication] Openurl:[nsurl urlwithstring:customurl];}

The following two methods can be implemented in Appdelegate??

-(BOOL) Application: (UIApplication *) application Handleopenurl: (nsurl *) URL??

-(BOOL) Application: (UIApplication *) application OpenURL: (nsurl *) URL sourceapplication: (NSString *) sourceapplication annotation: (id) annotation??

Description:?

? (1) The above two functions are consistent only the parameters are different, the return value of the function is bool, if yes means can open, no indicates that the application can not be opened

? (2) parameters can be obtained by [URL query], such as using devzeng://?token=123abct&registered=1, then the value obtained through [URL query] is token=123abct& Registered=1, then the data can be processed accordingly.

? (3) The bundle ID of the calling application can be obtained through the sourceapplication parameter

? (4) Through [URL scheme] can get to the request URL scheme, such as is open by devzeng://the value of [URL scheme] is Devzeng. The legitimacy of the source can be judged by different parameters?

? (5) Example

-(BOOL) Application: (UIApplication *) application OpenURL: (nsurl *) URL sourceapplication: (NSString *) sourceapplication annotation: (ID) annotation{    if ([Sourceapplication isequaltostring:@ " Com.devzeng.demo.urlscheme "])    {        NSLog (@) The bundle ID of the application called is:%@", sourceapplication);        NSLog (@ "url scheme:%@", [url scheme]);        NSLog (@ "URL query:%@", [url query]);        return YES;    }    else    {        return NO;}    }

* Note that you can create multiple scheme, in addition to the plist file inside the targets can also be created inside the Info--url types

iOS Development Basics-Fragmentation 32

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.