天天看點

swift 中UIColleCtion簡單使用

公司項目要求,使用swift語言開發,之前從未接觸過swift,自己一路摸索過來的,紀錄一下過程,供大家查閱

效果圖

swift 中UIColleCtion簡單使用

1:建立swift項目

2:删除自動生成的viewController.swift檔案和manStoryBoard

3:建立UIColleCtionView和storyBoard檔案

4:在storyBoard中關聯swift檔案

5:設定section數和cell個數(跟oc差不多)

swift 中UIColleCtion簡單使用

好了,收功。