博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Swift - 点击事件奇偶次判断
阅读量:4305 次
发布时间:2019-06-06

本文共 456 字,大约阅读时间需要 1 分钟。

 

// 按钮点击事件

    func onTouchUpInside() {

        struct touchUpInside {

            static var count: Int = 0

        }

        touchUpInside.count += 1

        print(touchUpInside.count)

        if touchUpInside.count % 2 == 0 {

            newsView.frame = CGRectMake(10, 22, UIScreen.mainScreen().bounds.size.width - 50, 40)

        } else {

            newsView.frame = CGRectMake(10, 22, UIScreen.mainScreen().bounds.size.width - 50, UIScreen.mainScreen().bounds.size.height - 20)

        }

    }

转载于:https://www.cnblogs.com/gongyuhonglou/p/6210841.html

你可能感兴趣的文章
不吹不黑 | 聊聊为什么要用99%精度的数据回测
查看>>
对于模拟交易所引发的思考
查看>>
高频交易的几种策略
查看>>
量化策略回测TRIXKDJ
查看>>
量化策略回测唐安奇通道
查看>>
CTA策略如何过滤部分震荡行情?
查看>>
量化策略回测DualThrust
查看>>
量化策略回测BoolC
查看>>
量化策略回测DCCV2
查看>>
mongodb查询优化
查看>>
五步git操作搞定Github中fork的项目与原作者同步
查看>>
git 删除远程分支
查看>>
删远端分支报错remote refs do not exist或git: refusing to delete the current branch解决方法
查看>>
python multiprocessing遇到Can’t pickle instancemethod问题
查看>>
APP真机测试及发布
查看>>
通知机制 (Notifications)
查看>>
10 Things You Need To Know About Cocoa Auto Layout
查看>>
一个异步网络请求的坑:关于NSURLConnection和NSRunLoopCommonModes
查看>>
iOS 如何放大按钮点击热区
查看>>
ios设备唯一标识获取策略
查看>>