小编mar*_*ioa的帖子

如何使用swift在集合视图中创建页眉和页脚

如何在swift中的集合视图中创建页眉和页脚?

我正在尝试将页眉和页脚组合在一起,但它一直在崩溃,我找不到快速的教程来理解它.

我不知道如何只返回一个补充视图.

我在故事板上设置它们(类+标识符)

 override func numberOfSectionsInCollectionView(collectionView: UICollectionView) -> Int {
    //#warning Incomplete method implementation -- Return the number of sections
    return 2
}


override func collectionView(collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
    //#warning Incomplete method implementation -- Return the number of items in the section
    return 10
}




override func collectionView(collectionView: UICollectionView, viewForSupplementaryElementOfKind kind: String, atIndexPath indexPath: NSIndexPath) -> UICollectionReusableView {
    var header: headerCell!
    var footer: footerCell!



    if kind == UICollectionElementKindSectionHeader {
        header =
            collectionView.dequeueReusableSupplementaryViewOfKind(kind,
                withReuseIdentifier: "header", forIndexPath: …
Run Code Online (Sandbox Code Playgroud)

ios uicollectionview swift

43
推荐指数
6
解决办法
6万
查看次数

Swift:下拉以解除`UITableViewController`

我想拉下来解雇UITableViewController所以我用了scrollViewDidScroll方法,但它不起作用!

    class CommentViewController: PFQueryTableViewController {

        private let tableHeaderHeight: CGFloat = 350.0



extension CommentViewController
{
    override func scrollViewDidScroll(scrollView: UIScrollView)
    {



            // Pull down to dismiss TVC 
            let offsetY = scrollView.contentOffset.y
            let adjustment: CGFloat = 130.0

            // for later use
            if (-offsetY) > (tableHeaderHeight+adjustment) {
                self.dismissViewControllerAnimated(true, completion: nil)
                }
 }
    }
Run Code Online (Sandbox Code Playgroud)

xcode uitableview uiscrollview ios swift

7
推荐指数
2
解决办法
6098
查看次数

在Storyboard中实现视频视图

我想构建一个简单的视频应用程序,可以查看用户添加的视频表单.我没有找到"VideoView"我的意思是如果图像视图是图像什么是视频的UIView.

storyboard uiimageview ios swift

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

Swift:Viewcontroller与协议UIGestureRecognizerDelegate的冗余一致性

我想添加两个框架SWRevealViewController,SLKTextViewController但我得到了这个奇怪的错误.

我读到了这个错误,但似乎令人困惑.

Viewcontroller与协议UIGestureRecognizerDelegate的冗余一致性

class Viewcontroller: SLKTextViewController,SWRevealViewControllerDelegate,UIGestureRecognizerDelegate {

    // a lot of functions and code

}
Run Code Online (Sandbox Code Playgroud)

iphone ios swrevealviewcontroller swift

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