GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - DeveloperLx/LxGridView-swift: Imitation iOS system desktop icon arrangement and interaction by UICollectionView!

BranchesTags
Open more actions menu

Latest commit

 

History

5 Commits
5 Commits

Folders and files

NameName
Last commit message
Last commit date
LxGridView
LxGridView
 
 
LxGridViewDemo
LxGridViewDemo
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
demo.gif
demo.gif
 
 

Repository files navigation

LxGridView-swift

Imitate Apple iOS system Desktop icons arrangement and interaction by inheriting UICollectionView!

  • demo

Installation

You only need drag directory LxGridView to your project.

Support

Minimum support iOS version: iOS 6.0

Usage

You can use LxGridView as convenient as UICollectionView.

let _gridViewFlowLayout = LxGridViewFlowLayout()
//	... config _gridViewFlowLayout

_gridView = LxGridView(frame: GRIDVIEW_FRAME, collectionViewLayout: _gridViewFlowLayout)
//	...	congif _gridView

_gridView.registerClass(LxGridViewCell.classForCoder(), forCellWithReuseIdentifier: GRIDVIEW_CELL_REUSE_IDENTIFIER)

//	implement delegate method
func collectionView(collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {

    return dataArray.count
}

func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -> UICollectionViewCell {

    let cell = collectionView.dequeueReusableCellWithReuseIdentifier(LxGridViewCellReuseIdentifier, forIndexPath: indexPath) as! LxGridViewCell
    
    cell.delegate = self
    cell.editing = _gridView.editing
    
    //	...	config cell
    
    return cell
}

func collectionView(collectionView: LxGridView, itemAtIndexPath sourceIndexPath: NSIndexPath, willMoveToIndexPath destinationIndexPath: NSIndexPath) {
    
    let dataDict = dataArray[sourceIndexPath.item]
    dataArray.removeAtIndex(sourceIndexPath.item)
    dataArray.insert(dataDict, atIndex: destinationIndexPath.item)
}

func deleteButtonClickedInGridViewCell(gridViewCell: LxGridViewCell) {

    if let gridViewCellIndexPath = _gridView!.indexPathForCell(gridViewCell) {
    
        dataArray.removeAtIndex(gridViewCellIndexPath.item)
        _gridView.performBatchUpdates({ [unowned self] () -> Void in
            self._gridView.deleteItemsAtIndexPaths([gridViewCellIndexPath])
        }, completion: nil)
    }
}

License

LxGridView is available under the Apache License 2.0. See the LICENSE file for more info.

About

Imitation iOS system desktop icon arrangement and interaction by UICollectionView!

Resources

Readme
Apache-2.0 license
Activity

Stars

163 stars

Watchers

7 watching

Forks

15 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.