How do I send notifications from one app to another app? (Example: Sogou input method to download skin after the completion of the use of skin) Note: Sogou Input method is app, and keyboard is extension
When you add app extension to your app, if you want to send a notice to extension in app maybe this article will help you.
Learn More
/Send notification-(void) Postnotificaiton {cfnotificationcenterref notification = Cfnotification
Centergetdarwinnotifycenter ();
Cfnotificationcenterpost
This article explains the iOS from the background Image color code, shared for everyone to refer to, the specific contents are as follows
Implementation code:
void *bitmapdata;
A pointer to the memory space equal to the number of bytes used by the image to use the RGB channel.
Static Cgcontextref Creatergbabitmapcontext (Cgimageref inimage) {cgcontextref context = NULL;
Cgcolorspaceref ColorSpace;
int bitmapbytecount;
int bitmapbytes
transformation, or slippery fast will appear page confusion
-(void) scrollviewdidenddecelerating: (Uiscrollview *) scrollview{
//Change the selected page ordinal number
[self changeindex];
3D Change restore original state for
(UIView * View in _viewarray) {
view.layer.transform=catransform3didentity
}
}
Yes, remember to add a very important perspective transformation function, the core is the affine matrix of the M34 property, so that will produce far smaller near
;
Set rounded corner _raindropemitterlayer.shadowradius=2;
Set offset _raindropemitterlayer.shadowoffset=cgsizemake (1, 1); Sets the color _raindropemitterlayer.shadowcolor=[uicolor Whitecolor].
Cgcolor;
Setting the layer particle _raindropemitterlayer.emittercells=@[emittercell];
_raindropemitterlayer.transform=catransform3dmakerotation (-M_PI/4, 0, 0, 1);
[Self.layer Addsublayer:_raindropemitterlayer]; }
Cherry blossom code similar to the same, please own brain repair.
This
One, Introduction as the C,controller in the MVC design pattern has been the most important role in project development, it is a bridge between view and data, through its management, the data methodically displayed on our view layer. Uiviewcontroller in iOS is one of the most basic classes in the Uikit framework. From the first UI view to the complex complete project, it is inseparable from the uiviewcontroller as the basis. Based on Uiviewcontrolle
request;There is a successor that is used to forward requests that are not currently processed to the next node to form a chain. (successor refers to the next Concretehandler reference, which is equivalent to the next pointer in the list)Because of the above programming design, the object that requests and processes the request is completely independent, because the client does not even know who handled the request, so that the entire chain structure is very flexible, you can add new nodes at a
*/-(Nsarray
5. Predicate
Verify existence-(BOOL) Validateregular: (NSString *) Regular Matchtext: (NSString *) text; {
//Regular expression format
//nsstring* regular=@ "^1[0-9]{6}$";
Create predicate
nspredicate *numberpre = [nspredicate predicatewithformat:@ "SELF matches%@", regular];
Match string, if can match return yes, otherwise return no;
BOOL ismatch = [Numberpre evaluatewithobject:text];
return IsMatch;}
The above is a small set to introduce the
In the network application, sometimes needs to the user equipment network state to carry on the real-time monitoring, has two purposes:(1) Let users understand their own network status, to prevent some misunderstandings (such as the use of strange applications incompetent)(2) According to the user's network status of intelligent processing, save user traffic, improve user experienceWiFi network: Automatically download HD images4G/3G network: Download only thumbnailsNo network: Only offline cache
header file of the referenced class, that is, to include the variables and methods in the. h file once, and only once, but not @class, so the latter is more efficient to compile.
3. In terms of compiling efficiency, if you have 100 header files that have #import the same head file, or these files are referenced in turn, such as A–>b, B–>c, c–>d such a reference relationship. When the first header file changes, all the classes that refer to it later need to be recompiled, and if you have a lot
(kbfrmwillchange:) Name: Uikeyboardwillchangeframenotificationobject:nil];
}
-(void) Kbfrmwillchange: (nsnotification *) noti{
NSLog (@ "%@", noti.userinfo);
Gets the height of the window
cgfloat windowh =[uiscreen mainscreen].bounds.size.height;
Keyboard end of frm
cgrect kbendfrm =[noti.userinfo[uikeyboardframeenduserinfokey] cgrectvalue];
Gets the Y-value of the keyboard end
cgfloat kbendy =kbendfrm.origin.y;
Self.inputViewConstraint.constant = Windowh-kbendy;
}
Text/Left h
elliptical way. Need to use CGPATHADDARC,CGPATHADDARC is often used to draw a positive circle, such as the following is a positive circle, the meaning of each parameter:
160,200 is the center of the circle, 100 is the radius (startangle,endangle) is the starting angle and the end angle, 1 is clockwise, 0 is counterclockwiseCgpathaddarc (Curvedpath, NULL, 160,200, StartAngle, Endangle, 0);
Note that because the coordinate system in iOS is the opposi
Objective
I believe every iOS developer knows that UITableView's left-sliding feature is cool, and sometimes left-sliding features are more than just deleting one, sometimes with other functions like the top, which requires a custom left-slip
Sample code
-(nsarray
Summarize
We can use Uitableviewrowaction to create objects, the following code block is clicked after the implementation of the method, created objects added to the array,
service";
ssize_t size_t = Send (Self.sock, SendData, strlen (SendData), 0);
NSLog (@ "%zd", size_t);
}
-(void) recvdata{
//acceptance data, placed in the child thread
ssize_t bytesrecv =-1;
Char recvdata[32] = "";
while (1) {
bytesrecv = recv (self.sock, RecvData, 0);
NSLog (@ "%zd%s", bytesrecv,recvdata);
if (Bytesrecv = = 0) {break
;
}}
}
All right, I'm going to use the socket for two apps on the local phone. The first time to write a blog, one is to record thei
nonnull
null_resettable function: Get: Cannot return to NULL, set can be empty
Writing methods:
@property (nonatomic, Strong, null_resettable) NSString *name;
Note that if you use null_resettable, you must override the Get method or the set method to handle the case where the passed value is null
_null_unspecified: not sure if null
This is the only
way to write a
@property (nonatomic, strong) NSString *_null_unspecified name;
Mode two
@property (nonatomic, strong) NSString
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.