- 博客(13)
- 收藏
- 关注
原创 UIAlertController
UIAlertController- (void)viewDidLoad { [super viewDidLoad]; [self performSelector:@selector(show) withObject:nil afterDelay:3];}- (void)show { NSString *title = NSLocalizedString(@"提示", nil
2016-07-29 17:31:42 264
原创 国际化
创建好你的项目 按照图片一步一步走就可以 然后就开始写代码了 当手机语言是英文时//这是英文里的"test1" = "test"; 当你的手机语言中文的时候//这是中文的"test1" = "测试";实际使用的时候是lab.text = NSLocalizedString(@"test1", @"这里是写注释的,不想写的时候直接 nil就可以");
2016-07-29 17:07:06 214
原创 进入后台加模糊
最后一些金融类的应用都在添加进入后台之后整个变成模糊效果,于是我也自己写了一个。 下面给大家分享:代码如下://AppDelegate 中定义一个effView@interface AppDelegate () { UIVisualEffectView *effView;}- (void)applicationDidEnterBackground:(UIApplication *)ap
2016-07-28 16:55:12 2942
原创 设置中打开自己app
//在设置中打开自己的应用本身[[UIApplication sharedApplication] openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString]];
2016-07-22 09:41:23 536
原创 获取文本内容高度和宽度
extension NSString { func stringWidthFont(viewLab: UILabel) -> CGSize { if self.length < 1 { return CGSizeMake(10, 10) } let size = self.boundingRectWithSize(CGSize
2016-07-21 13:01:44 4504
原创 添加手势 swift
tableviewcell 上的图片添加单击手势cell.iconImageView.addGestureRecognizer(UITapGestureRecognizer(target: self ,action: #selector(iconClick(_:))))// 注意这个 点击没有反应的话把这个打开iconImageView.userInteractionEnabled = true
2016-07-19 16:18:39 501
原创 获取当前段和行
swift tableview 获取当前段和当前行func iconClick(gestureRecognizer: UITapGestureRecognizer) { var getIndexPath = NSIndexPath() getIndexPath = tableView.indexPathForRowAtPoint(gestureRecognizer.l和
2016-07-19 16:14:07 380
原创 swift-tabBar
import UIKitclass MainViewController: UITabBarController { override func viewDidLoad() { super.viewDidLoad() self.add() } func add() { let root1 = RootViewController()
2016-07-18 16:25:01 235
原创 截取两个字符串中间字符
NSString *middleStr; //获取中间的字符串NSString *frontStr = @"id"; //从该字符开始NSString *behindStr = @"?"; //到该字符结束NSRange range;range.location = [string rangeOfString:frontStr].location + frontStr
2016-07-13 13:52:20 3064
原创 自定义数字键盘
自定义数据键盘* .h 文件@protocol SLNumericKeyboardDelegate <NSObject>- (void) numberKeyboardInput:(NSInteger) number;- (void) numberKeyboardBackspaceTag:(NSInteger)tag;- (void) changeKeyboardType;@end@interf
2016-07-08 17:26:58 317
原创 常用的正则表达式
//// HelperUtil.m// SQLite(购物)//// Created by Yock Deng on 15/8/22.// Copyright (c) 2015年 蓝桥. All rights reserved.//#import "HelperUtil.h"@implementation HelperUtil+ (NSString *) nullDefultSt
2016-07-05 15:55:22 2039
原创 判断定位状态 locationServicesEnabled
判断定位状态 locationServicesEnabledCLAuthorizationStatus status = [CLLocationManager authorizationStatus]; if (kCLAuthorizationStatusDenied == status || kCLAuthorizationStatusRestricted == status) {
2016-07-04 15:37:55 2140
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人