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: Imitation iOS system desktop icon arrangement and interaction by UICollectionView!

BranchesTags
Open more actions menu

Latest commit

 

History

11 Commits
11 Commits

Folders and files

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

Repository files navigation

LxGridView

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

Installation

You only need drag directory LxGridView to your project.

Podfile

pod 'LxGridView', '~> 1.0.1'

Support

Minimum support iOS version: iOS 6.0

Usage

You can use LxGridView as convenient as UICollectionView.

	_gridViewFlowLayout = [[LxGridViewFlowLayout alloc]init];
	//	... config _gridViewFlowLayout
	
	_gridView = [[LxGridView alloc]initWithFrame:GRIDVIEW_FRAME collectionViewLayout:_gridViewFlowLayout];
	//	... config _gridView
	
	[_gridView registerClass:[LxGridViewCell class] forCellWithReuseIdentifier:GRIDVIEW_CELL_REUSE_IDENTIFIER];

	//	implement delegate method
	- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section
	{
	    return self.dataArray.count;
	}
	
	- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
	{
	    LxGridViewCell * cell = [collectionView dequeueReusableCellWithReuseIdentifier:LxGridViewCellReuseIdentifier forIndexPath:indexPath];
	    
	    cell.delegate = self;
	    cell.editing = _gridView.editing;
	    
	    //	...	config cell
	    
	    return cell;
	}
	
	- (void)collectionView:(UICollectionView *)collectionView itemAtIndexPath:(NSIndexPath *)sourceIndexPath willMoveToIndexPath:(NSIndexPath *)destinationIndexPath
	{
	    NSDictionary * dataDict = self.dataArray[sourceIndexPath.item];
	    [self.dataArray removeObjectAtIndex:sourceIndexPath.item];
	    [self.dataArray insertObject:dataDict atIndex:destinationIndexPath.item];
	}
	
	- (void)deleteButtonClickedInGridViewCell:(LxGridViewCell *)gridViewCell
	{
	    NSIndexPath * gridViewCellIndexPath = [_gridView indexPathForCell:gridViewCell];
	    
	    if (gridViewCellIndexPath) {
	        [self.dataArray removeObjectAtIndex:gridViewCellIndexPath.item];
	        [_gridView performBatchUpdates:^{
	            [_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

961 stars

Watchers

30 watching

Forks

129 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.