zoukankan      html  css  js  c++  java
  • SWIFT 版 新闻客户端

      SWIFT 写了一个项目,感觉跟objective-c 相比确实流畅很多。

        override func viewDidLoad() {
            super.viewDidLoad()
            // Do any additional setup after loading the view, typically from a nib.
            
            let refreshControl = UIRefreshControl()
            refreshControl.attributedTitle = NSAttributedString(string: "下拉刷新")
            refreshControl.addTarget(self, action: "loadDataSource", forControlEvents: UIControlEvents.ValueChanged)
            self.refreshControl = refreshControl
        }
        
        override func viewDidAppear(animated: Bool) {
            super.viewDidAppear(animated)
            loadDataSource();
        }

    跟原来的OBJ-C 代码其实差不多,只不过加了写起来快罢了。

    项目地址:

    https://github.com/xhzengAIB/XHNewsParsingSwift

  • 相关阅读:
    封装图片处理类(缩略图)
    封装表单验证类
    魔术方法
    封装自己的smartyBC类
    快捷键
    unicode
    基本数据类型课上练习
    数制总结
    12.29.作业
    12.28作业
  • 原文地址:https://www.cnblogs.com/rubick/p/3771054.html
Copyright © 2011-2022 走看看