小编Jec*_*cky的帖子

如何按升序顺序对数组进行排序2.3

[{
msg = "Hi This is Jecky";
name = Susheel;
sender = 77;
timestamp = 1464241769520;
username = susheel;
}, {
msg = Dubai;
name = Jecky;
sender = 78;
timestamp = 1464246547147;
username = Jecky;
}, {
msg = "How are you ?";
name = Susheel;
sender = 77;
timestamp = 1464243480381;
username = susheel;
}, {
msg = "Aje dekhai nai";
name = Jecky;
sender = 78;
timestamp = 1464244974198;
username = Jecky;
}]
Run Code Online (Sandbox Code Playgroud)
  • 我有这样的数组.我想在swift 2.3或最新版本的swift中使用时间戳对这个数组进行排序.任何人都可以帮助我吗?

arrays sorting iphone ios swift

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

CollectionView Flowlayout 自定义

在此处输入图片说明

我正在制作个人资料图片集合视图,例如 Tinder 编辑个人资料图片。我想要第一个单元格比其他单元格大,除了第一个单元格之外还有 2、3 个单元格,其他单元格应该像 3、4、5。有什么建议吗?

extension ViewController: UICollectionViewDelegate, UICollectionViewDataSource, UICollectionViewDelegateFlowLayout {

    func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
        if indexPath.item == 0 {
        return CGSize(width: 213.34, height: 213.34)
        } else {
            return CGSize(width: 101.66, height:101.66 )
        }

    }


    func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
        return 6
    }

    func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
        let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "cell", for: indexPath)
        let lbl = cell.viewWithTag(1) as! …
Run Code Online (Sandbox Code Playgroud)

ios uicollectionview uicollectionviewlayout swift

2
推荐指数
1
解决办法
7373
查看次数