This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event { | |
CABasicAnimation *baseAnimate1 = [CABasicAnimation animationWithKeyPath:@"transform.scale"]; | |
baseAnimate1.toValue = @(0.1); | |
baseAnimate1.duration = 0.5; | |
CABasicAnimation *baseAnimate2 = [CABasicAnimation animationWithKeyPath:@"position"]; | |
baseAnimate2.toValue = [NSValue valueWithCGPoint:CGPointMake(0, 0)]; | |
baseAnimate2.duration = 0.5; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// SvGridView.h | |
// SvSinglePixel | |
// | |
// Created by xiaoyong.cxy on 6/23/15. | |
// Copyright (c) 2015 smileEvday. All rights reserved. | |
// | |
#import <UIKit/UIKit.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import "UITableView+reloadDataAnimated.h" | |
@implementation UITableView (reloadDataAnimated) | |
- (void)reloadDataWithAnimated:(BOOL)animated | |
{ | |
[self reloadData]; | |
if (animated) { | |
CATransition *animation = [CATransition animation]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (NSAttributedString *)textAligenJustifiedWith:(NSString *)text lineSpace:(CGFloat)lineSpace { | |
NSMutableAttributedString *mutableAttributedString = [[NSMutableAttributedString alloc] initWithString:text]; | |
NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init]; | |
paragraphStyle.alignment = NSTextAlignmentJustified; | |
paragraphStyle.paragraphSpacing = 11.0; | |
paragraphStyle.paragraphSpacingBefore = 10.0; | |
paragraphStyle.firstLineHeadIndent = 0.0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version=`/usr/libexec/PlistBuddy -c "Print CFBundleVersion" $PRODUCT_SETTINGS_PATH` | |
version=`expr $version + 1` | |
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $version" $PRODUCT_SETTINGS_PATH | |
#/usr/libexec/PlistBuddy -c "Set :CFBundleShortVersionString $version" $PRODUCT_SETTINGS_PATH 这行代码会让version也自增,一般不需要 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <ifaddrs.h> | |
#import <arpa/inet.h> | |
#import <net/if.h> | |
#define IOS_CELLULAR @"pdp_ip0" | |
#define IOS_WIFI @"en0" | |
#define IOS_VPN @"utun0" | |
#define IP_ADDR_IPv4 @"ipv4" | |
#define IP_ADDR_IPv6 @"ipv6" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//剔除卡号里的非法字符 | |
-(NSString *)getDigitsOnly:(NSString*)s | |
{ | |
NSString *digitsOnly = @""; | |
char c; | |
for (int i = 0; i < s.length; i++) | |
{ | |
c = [s characterAtIndex:i]; | |
if (isdigit(c)) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//方法一 | |
NSString *urlString1 = @"..."; | |
NSString *urlString2 = @"..."; | |
AFHTTPSessionManager *manager = [AFHTTPSessionManager manager]; | |
NSOperationQueue *queue = [[NSOperationQueue alloc] init]; | |
queue.name = @"AFHTTPSessionManager queue"; | |
NSOperation *completionOperation = [NSBlockOperation blockOperationWithBlock:^{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function urlArags() { | |
var args = {}; | |
var query = window.location.search.substring(1); | |
var pairs = query.split("&"); | |
for (var i = 0, len = pairs.length; i < len; i++) { | |
var pos = pairs[i].indexOf('='); | |
if (pos == -1) { | |
continue; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private function genUserNumber() | |
{ | |
$chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; | |
$username = ""; | |
for ( $i = 0; $i < 6; $i++ ) | |
{ | |
$username .= $chars[mt_rand(0, strlen($chars))]; | |
} | |
return strtoupper(base_convert(time() - 1420070400, 10, 36)).$username; | |
} |