小编Ome*_*mer的帖子

如何检查特定地点是否发生了敲击

我正在尝试检查屏幕上特定区域是否发生了点击.我已经设置了TapGestureRecognizer,这是我现在拥有的代码:

func handleTap(tap: UITapGestureRecognizer) {
    var point = tap.locationInView(self.view)
    println("tapped")

    if (tap.state == UIGestureRecognizerState.Ended)
    {
        if (CGRectContainsPoint(self.Region.frame, point)) {
            println("touch")
            var y = kbHeight - textYoutube.center.y
            youTextConst.constant += y
        }
    }
}
Run Code Online (Sandbox Code Playgroud)

该应用程序识别了水龙头,但未识别特定区域的水龙头,代码有什么问题?

UPDATE

我不知道它是否重要,但Region是TextView

ios uitapgesturerecognizer swift xcode6

8
推荐指数
1
解决办法
4466
查看次数

Facebook和Google+登录

我在我的应用中使用了Google+和Facebook.我的问题是它们都需要appDelegate中的OpenURL方法.

对于Facebook登录:

func application(application: UIApplication, openURL url: NSURL, sourceApplication: String?, annotation: AnyObject?) -> Bool {
    return FBSDKApplicationDelegate.sharedInstance().application(application, openURL: url, sourceApplication: sourceApplication, annotation: annotation)
}    
Run Code Online (Sandbox Code Playgroud)

对于Google+登录信息:

func application(application: UIApplication, openURL url: NSURL, sourceApplication: String?, annotation: AnyObject?) -> Bool {
    return GPPURLHandler.handleURL(url, sourceApplication: sourceApplication, annotation: annotation)
}
Run Code Online (Sandbox Code Playgroud)

如何在同一个应用程序中同时使用google +和facebook?

facebook-graph-api ios google-plus swift xcode6

4
推荐指数
1
解决办法
1768
查看次数