我尝试在文本中获取URL.所以,在此之前,我使用了这样一个表达式:
let re = NSRegularExpression(pattern: "https?:\\/.*", options: nil, error: nil)!
Run Code Online (Sandbox Code Playgroud)
但是当用户输入带有大写符号的URL时(例如Http://Google.com,它与它不匹配),我遇到了问题.
我试过了:
let re = NSRegularExpression(pattern: "(h|H)(t|T)(t|T)(p|P)s?:\\/.*", options: nil, error: nil)!
Run Code Online (Sandbox Code Playgroud)
但什么都没发生.
窗口小部件现在包括显示模式的概念(由NCWidgetDisplayMode表示),它允许您描述可用的内容量,并允许用户选择紧凑或扩展视图.
如何在ios 10.0中扩展小部件?它不像ios 9那样有效.
我目前在我的Podfile中指定了更新版本的库,这些库会破坏我们的应用程序构建.当你表演时会发生这种情况pod update.这是因为我们的Podfile具有为某些库指定的模糊匹配版本.我们需要将这些锁定到特定版本,例如我AFNetworking在我的pod文件中有'〜> 1.0,当我执行"pod update"然后它安装AFNetworking','〜> 1.3.3,但我想锁定库到仅限1.0.
我正在尝试使用firebase实现崩溃报告.我按照这里的文档.并将下载的子文件重命名为ServiceAccount.json.然后将其复制到项目目录.还改了剧本.现在我的构建阶段运行脚本看起来像
# Replace this with the GOOGLE_APP_ID from your GoogleService-Info.plist file
GOOGLE_APP_ID=1:.....#my app id
# Replace the /Path/To/ServiceAccount.json with the path to the key you just downloaded
"${PODS_ROOT}"/FirebaseCrash/upload-sym "ServiceAccount.json"
Run Code Online (Sandbox Code Playgroud)
但是,当我尝试构建项目时,它给出了构建错误
Unexpected argument 'ServiceAccount.json'
usage: /Users/<full path>/Pods/FirebaseCrash/upload-sym [-h] [-v] [-w|-e]
Command /bin/sh failed with exit code 2
Run Code Online (Sandbox Code Playgroud)
我的步骤有什么问题?
我正在使用此API将多个分组的传递添加到Apple Wallet.我意识到钱包中添加的传递不遵循我给它给这个API的数组[PKPass]的顺序.
public func addPasses(passes: [PKPass], withCompletionHandler completion: ((PKPassLibraryAddPassesStatus) -> Void)?)
Run Code Online (Sandbox Code Playgroud)
这里要注意的有趣的事情是,当我View All在添加通行证之前点击它确实按顺序显示所有通行证但是在点击Add All之后然后启动钱包应用程序以查看添加的顺序通过它不再相同.
任何线索为什么会发生这种情况以及如何维持秩序?
它类似于电子邮件 ID,但也可以从数字开始,并且末尾没有域名。
例子:
rishi.21@axis
shruti@PNB
98765__210@upi
Run Code Online (Sandbox Code Playgroud) 我试图弄清楚如何在Xcode 7(iOS9)上的Swift中解决这个问题,我也遇到了这个错误:
不能下标'[UIViewController]类型的值?' 索引类型为'Int'
任何建议表示赞赏.谢谢.

我的代码:
func indexPositionForCurrentPage(pageViewController: UIPageViewController) -> Int {
let currentViewController = pageViewController.viewControllers[0] as UIViewController
for (index, page) in pages.enumerate() {
if (currentViewController == page) {
return index
}
}
return -1
}
Run Code Online (Sandbox Code Playgroud) 我知道有与whatsapp沟通的方案,如:
NSURL *whatsappURL = [NSURL URLWithString:@"whatsapp://send?text=Hello%2C%20World!"];
if ([[UIApplication sharedApplication] canOpenURL: whatsappURL]) {
[[UIApplication sharedApplication] openURL: whatsappURL];
}
Run Code Online (Sandbox Code Playgroud)
但我找不到如何使用以前不存在的电话号码打开whatsapp.
这是一个"contatc us"页面,如果我只能打开whatsapp而无法预先填写电话号码,那就没用了.我需要联系whatsapp ...
我想做的是什么?
我在我的应用程序中通过pod使用Google Maps SDK for iOS版本:1.10.17867.0.但是当我在特定位置初始化地图时,所有标题和地图都会开始闪烁.示例代码(swift):
import UIKit
import GoogleMaps
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
self.view.backgroundColor = UIColor.whiteColor();
var camera = GMSCameraPosition.cameraWithLatitude(19.0176147, longitude: 72.8561644, zoom:18)
// even try this: 28.6469655, longitude: 77.0932634, zoom:10
var mapView = GMSMapView.mapWithFrame(CGRectZero, camera:camera)
var marker = GMSMarker()
marker.position = camera.target
marker.snippet = "Hello World"
marker.appearAnimation = kGMSMarkerAnimationPop
marker.map = mapView
self.view = mapView
}
}
Run Code Online (Sandbox Code Playgroud)