尝试包含目标依赖项时,我收到错误: The manifest describes a target that cannot be found in your source tree: parser
这是我的Package.swift文件:
import PackageDescription
let package = Package(
name: "Phoenix",
targets: [
Target(
name: "Phoenix",
dependencies: [.Target(name: "parser")]),
Target(
name: "parser")
]
)
Run Code Online (Sandbox Code Playgroud)
我遵循这里描述的格式:https://github.com/apple/swift-package-manager/blob/master/Documentation/Package.swift.md
我正在尝试使用Google Maps API,但无法获取用户的位置.由于从未调用observeValueForKeyPath,因此观察到的值似乎永远不会改变.
注意:我正在运行Xcode6-Beta 5和iOS8 beta(代码在Swift中)
override func viewDidLoad() {
super.viewDidLoad()
var camera:GMSCameraPosition? = nil
mapView_ = GMSMapView.mapWithFrame(CGRectZero, camera:camera);
mapView_!.addObserver(self, forKeyPath: "myLocation", options: NSKeyValueObservingOptions.fromRaw(0x01)!, context: nil);
camera = GMSCameraPosition.cameraWithTarget(mapView_!.myLocation.coordinate, zoom: 6);
mapView_!.camera = camera;
self.view = mapView_;
dispatch_async(dispatch_get_main_queue(), {
mapView_!.myLocationEnabled = true;
});
}
override func observeValueForKeyPath(keyPath: String!, ofObject object: AnyObject!, change: [NSObject : AnyObject]!, context: UnsafeMutablePointer<()>) {
if (keyPath == "myLocation" && object.isKindOfClass(GMSMapView)) {
mapView_!.animateToCameraPosition(GMSCameraPosition.cameraWithTarget(mapView_!.myLocation.coordinate, zoom: 6));
}
}
Run Code Online (Sandbox Code Playgroud)