Skip to content

Commit

Permalink
新增collectionView
Browse files Browse the repository at this point in the history
  • Loading branch information
BigShow1949 committed Sep 22, 2016
1 parent 1456d7e commit 8bbf3b3
Show file tree
Hide file tree
Showing 41 changed files with 1,327 additions and 7 deletions.
Binary file modified .DS_Store
Binary file not shown.
Binary file modified .svn/wc.db
Binary file not shown.
138 changes: 138 additions & 0 deletions BigShow1949.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,15 @@
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.ExceptionBreakpoint">
<BreakpointContent
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
scope = "0"
stopOnStyle = "0">
</BreakpointContent>
</BreakpointProxy>
</Breakpoints>
</Bucket>
Binary file modified BigShow1949/Classes/.DS_Store
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="9531" systemVersion="15A2301" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="10117" systemVersion="15G31" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9529"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
Expand Down Expand Up @@ -33,7 +33,7 @@
<connections>
<outlet property="label" destination="Ym3-z2-11m" id="kJ8-RC-JQW"/>
</connections>
<point key="canvasLocation" x="685" y="451"/>
<point key="canvasLocation" x="394" y="401"/>
</collectionViewCell>
</objects>
</document>
Binary file modified BigShow1949/Classes/10 - UIKit/.DS_Store
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
//
// RACollectionViewCell.h
// RACollectionViewTripletLayout-Demo
//
// Created by Ryo Aoyama on 5/27/14.
// Copyright (c) 2014 Ryo Aoyama. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface RACollectionViewCell : UICollectionViewCell

@property (nonatomic, strong) UIImageView *imageView;

@end
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
//
// RACollectionViewCell.m
// RACollectionViewTripletLayout-Demo
//
// Created by Ryo Aoyama on 5/27/14.
// Copyright (c) 2014 Ryo Aoyama. All rights reserved.
//

#import "RACollectionViewCell.h"

@implementation RACollectionViewCell

- (instancetype)initWithCoder:(NSCoder *)coder
{
self = [super initWithCoder:coder];
if (self) {
_imageView = [[UIImageView alloc] init];
_imageView.contentMode = UIViewContentModeScaleAspectFill;
}
return self;
}

- (void)setBounds:(CGRect)bounds
{
[super setBounds:bounds];
self.imageView.frame = bounds;
}

- (void)setHighlighted:(BOOL)highlighted
{
[super setHighlighted:highlighted];
if (highlighted) {
_imageView.alpha = .7f;
}else {
_imageView.alpha = 1.f;
}
}

@end
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
//
// RACollectionViewReorderableTripletLayout.h
// RACollectionViewTripletLayout-Demo
//
// Created by Ryo Aoyama on 5/27/14.
// Copyright (c) 2014 Ryo Aoyama. All rights reserved.
//

#import "RACollectionViewTripletLayout.h"

@protocol RACollectionViewReorderableTripletLayoutDataSource <RACollectionViewTripletLayoutDatasource>

@optional

- (void)collectionView:(UICollectionView *)collectionView itemAtIndexPath:(NSIndexPath *)fromIndexPath willMoveToIndexPath:(NSIndexPath *)toIndexPath;
- (void)collectionView:(UICollectionView *)collectionView itemAtIndexPath:(NSIndexPath *)fromIndexPath didMoveToIndexPath:(NSIndexPath *)toIndexPath;

- (BOOL)collectionView:(UICollectionView *)collectionView canMoveItemAtIndexPath:(NSIndexPath *)indexPath;
- (BOOL)collectionView:(UICollectionView *)collectionView itemAtIndexPath:(NSIndexPath *)fromIndexPath canMoveToIndexPath:(NSIndexPath *)toIndexPath;

@end

@protocol RACollectionViewDelegateReorderableTripletLayout <RACollectionViewDelegateTripletLayout>

@optional

- (CGFloat)reorderingItemAlpha:(UICollectionView * )collectionview; //Default 0.
- (UIEdgeInsets)autoScrollTrigerEdgeInsets:(UICollectionView *)collectionView; //Sorry, has not supported horizontal scroll.
- (UIEdgeInsets)autoScrollTrigerPadding:(UICollectionView *)collectionView;

- (void)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout willBeginDraggingItemAtIndexPath:(NSIndexPath *)indexPath;
- (void)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout didBeginDraggingItemAtIndexPath:(NSIndexPath *)indexPath;
- (void)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout willEndDraggingItemAtIndexPath:(NSIndexPath *)indexPath;
- (void)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout didEndDraggingItemAtIndexPath:(NSIndexPath *)indexPath;

@end



@interface RACollectionViewReorderableTripletLayout : RACollectionViewTripletLayout <UIGestureRecognizerDelegate>

@property (nonatomic, weak) id<RACollectionViewDelegateReorderableTripletLayout> delegate;
@property (nonatomic, weak) id<RACollectionViewReorderableTripletLayoutDataSource> datasource;
@property (nonatomic, strong, readonly) UILongPressGestureRecognizer *longPressGesture;
@property (nonatomic, strong, readonly) UIPanGestureRecognizer *panGesture;

@end
Loading

0 comments on commit 8bbf3b3

Please sign in to comment.