转自:http://www.cocoachina.com/bbs/read.php?tid-20993.html
+ (void)alert:(NSString *)msg
{
UIAlertView *alertView = [[[UIAlertView alloc] initWithTitle:msg message:@"" delegate:self cancelButtonTitle:@"OK"
otherButtonTitles:nil, nil] autorelease];
[alertView showWithBackground];
}
+ (NSString*) cleanPhoneNumber:(NSString*)phoneNumber
{
NSString* number = [NSString stringWithString:phoneNumber];
NSString* number1 = [[[number stringByReplacingOccurrencesOfString:@" " withString:@""]
//stringByReplacingOccurrencesOfString:@"-" withString:@""]
stringByReplacingOccurrencesOfString:@"(" withString:@""]
stringByReplacingOccurrencesOfString:@")" withString:@""];
return number1;
}
+ (void) makeCall:(NSString *)phoneNumber
{
if ([DeviceDetection isIPodTouch]){
[UIUtils alert:kCallNotSupportOnIPod];
return;
}
NSString* numberAfterClear = [UIUtils cleanPhoneNumber:phoneNumber];
NSURL *phoneNumberURL = [NSURL URLWithString:[NSString stringWithFormat:@"tel:%@", numberAfterClear]];
NSLog(@"make call, URL=%@", phoneNumberURL);
[[UIApplication sharedApplication] openURL:phoneNumberURL];
}
+ (void) sendSms:(NSString *)phoneNumber
{
if ([DeviceDetection isIPodTouch]){
[UIUtils alert:kSmsNotSupportOnIPod];
return;
}
NSString* numberAfterClear = [UIUtils cleanPhoneNumber:phoneNumber];
NSURL *phoneNumberURL = [NSURL URLWithString:[NSString stringWithFormat:@"sms:%@", numberAfterClear]];
NSLog(@"send sms, URL=%@", phoneNumberURL);
[[UIApplication sharedApplication] openURL:phoneNumberURL];
}
+ (void) sendEmail:(NSString *)phoneNumber
{
NSURL *phoneNumberURL = [NSURL URLWithString:[NSString stringWithFormat:@"mailto:%@", phoneNumber]];
NSLog(@"send sms, URL=%@", phoneNumberURL);
[[UIApplication sharedApplication] openURL:phoneNumberURL];
}
+ (void) sendEmail:(NSString *)to cc:(NSString*)cc subject:(NSString*)subject body:(NSString*)body
{
NSString* str = [NSString stringWithFormat:@"mailto:%@?cc=%@&subject=%@&body=%@",
to, cc, subject, body];
str = [str stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:str]];
}
分享到:
相关推荐
网易airtest for mac必备agent, iOS-Tagent 其实就是 WebDriverAgent 仔细看,会发现iOS-Tagent会比WebDriverAgent简略得多。 iOS-Tagent其实就是WDA的优化版本。 git clone ...
蓝牙mesh技术,Nordic公司所开发的iOS-nRF-Mesh-Library工具包,可自行在github上搜索
IOS打电话、发短信、发邮件的封装类,使用非常方便
通过URL 调用第三方地图进行导航 只显示安装的地图, github地址: https://github.com/zh-ios/URLNavi.git
iOS DFU库 安装 对于可可足类: 使用以下内容创建/更新您的Podfile target 'YourAppTargetName' do use_frameworks! pod 'iOSDFULibrary' end 安装依赖项 pod install 打开新创建的.xcworkspace 通过使用import...
ios原生User-agent数据,8万量级。数据来源于https://user-agents.net/random
传智播客iOS6免费公开课程-调用打电话发短信发邮件打开浏览器
1、在ios目录下新建bundle目录。后面编译打包离线资源,也会生成bundle目录,提前建,是为了防止某些情况下报错。 2、进行编译,离线打包资源。命令如下: react-native bundle --entry-file index.js //entry-...
Cisco IOS 15 全套资料,从其官网下载,便于学习配置路由设备的方法。 下载于:...
2. Copy "mtouch.exe" to "C:\Program Files (x86)\MSBuild\Xamarin\iOS" (or "C:\Program Files\MSBuild\Xamarin\iOS" if you are on a 32-bit operating system) PREREQUISITES & NOTES - This patch only ...
压缩包内包括c3640/c3745/c7200三中型号的设备镜像,可在GNS3上使用,其他型号可以到如下链接下载 https://ccie.lol/blog/2016/07/03/cisco-ios-image-download/
小程序 富文本转换 (修改版 - 已解决组件本身 IOS系统 文本不可选中的问题) 由 mp-html 官方下载后使用时发现问题后调整
iOS组件化(上篇)- 拆分基础组件 http://www.jianshu.com/p/760d6cd46719 iOS组件化(中篇)-拆分业务组件 http://www.jianshu.com/p/e6e84688f0b8 iOS组件化(下篇)-加载XIB、图片资源 ...
在一个窗口打开系统中的APP
基于开源框架ijkplayer framework打包的类库,模拟器和真机合二为一,可以做为framework直接引用。
2. Copy "mtouch.exe" to "C:\Program Files (x86)\MSBuild\Xamarin\iOS" (or "C:\Program Files\MSBuild\Xamarin\iOS" if you are on a 32-bit operating system) PREREQUISITES & NOTES - This patch only ...
NULL 博文链接:https://poolo.iteye.com/blog/2098839
webrtc源码的下载-对应ios-android-linux-mac-window等平台的编译文档 举例mac端 //直接连外网代理,如何有连外面vpn就不需要,下面的连接是例子不能直接连改自己IP和端口 export ...
iOS开发------Widget(Today Extension)插件化开发1
demo使用MessageUI.framework里面自带的Controller实现发送短信的功能,你只需要修改自己需要的TelPhone即可