-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
47 changed files
with
3,615 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,3 +19,6 @@ DerivedData | |
|
||
#CocoaPods | ||
Pods | ||
Podfile.lock | ||
*.xcworkspace | ||
develop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
Classes/CLImagePicker/CLImagePicker.bundle/CLAssetCell.xib
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="4510" systemVersion="12F45" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none"> | ||
<dependencies> | ||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3742"/> | ||
</dependencies> | ||
<objects> | ||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/> | ||
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/> | ||
<collectionViewCell opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" reuseIdentifier="" id="aXN-tV-dSw" customClass="CLAssetCell"> | ||
<rect key="frame" x="0.0" y="0.0" width="50" height="50"/> | ||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> | ||
<view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center"> | ||
<rect key="frame" x="0.0" y="0.0" width="50" height="50"/> | ||
<autoresizingMask key="autoresizingMask"/> | ||
<subviews> | ||
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" id="FKa-or-buA"> | ||
<rect key="frame" x="0.0" y="0.0" width="50" height="50"/> | ||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> | ||
</imageView> | ||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="jDJ-HU-C6z"> | ||
<rect key="frame" x="18" y="0.0" width="32" height="32"/> | ||
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxY="YES"/> | ||
<fontDescription key="fontDescription" type="system" pointSize="15"/> | ||
<state key="normal" image="CLImagePicker.bundle/images/btn_selected_off"> | ||
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/> | ||
</state> | ||
<state key="selected" image="CLImagePicker.bundle/images/btn_selected_on"/> | ||
<connections> | ||
<action selector="pushedSelectBtn:" destination="aXN-tV-dSw" eventType="touchUpInside" id="Xwg-RV-VfG"/> | ||
</connections> | ||
</button> | ||
</subviews> | ||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/> | ||
</view> | ||
<connections> | ||
<outlet property="_imageView" destination="FKa-or-buA" id="gkN-Zh-HYR"/> | ||
<outlet property="_selectBtn" destination="jDJ-HU-C6z" id="MdV-qg-VGH"/> | ||
</connections> | ||
</collectionViewCell> | ||
</objects> | ||
<resources> | ||
<image name="CLImagePicker.bundle/images/btn_selected_off" width="16" height="16"/> | ||
<image name="CLImagePicker.bundle/images/btn_selected_on" width="16" height="16"/> | ||
</resources> | ||
</document> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.23 KB
Classes/CLImagePicker/CLImagePicker.bundle/images/btn_selected_off.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.63 KB
Classes/CLImagePicker/CLImagePicker.bundle/images/btn_selected_on.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 31 additions & 0 deletions
31
Classes/CLImagePicker/CLImagePickerBundle/CLImagePickerBundle.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// | ||
// CLImagePickerBundle.h | ||
// | ||
// Created by sho yakushiji on 2014/01/17. | ||
// Copyright (c) 2014年 CALACULU. All rights reserved. | ||
// | ||
|
||
#import <Foundation/Foundation.h> | ||
|
||
@class CLImageEditor; | ||
@protocol CLImagePickerBundleDelegate; | ||
|
||
@interface CLImagePickerBundle : NSObject | ||
|
||
+ (void)setDelegate:(id<CLImagePickerBundleDelegate>)delegate; | ||
+ (void)setBundleName:(NSString*)bundleName; | ||
|
||
|
||
+ (NSString*)bundleName; | ||
+ (NSBundle*)bundle; | ||
+ (UIImage*)imageNamed:(NSString*)path; | ||
+ (CLImageEditor*)imageEditor; | ||
|
||
@end | ||
|
||
|
||
@protocol CLImagePickerBundleDelegate <NSObject> | ||
@optional | ||
- (CLImageEditor*)imageEditorForImagePicker; | ||
|
||
@end |
92 changes: 92 additions & 0 deletions
92
Classes/CLImagePicker/CLImagePickerBundle/CLImagePickerBundle.m
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
// | ||
// CLImagePickerBundle.m | ||
// | ||
// Created by sho yakushiji on 2014/01/17. | ||
// Copyright (c) 2014年 CALACULU. All rights reserved. | ||
// | ||
|
||
#import "CLImagePickerBundle.h" | ||
|
||
#import <CLImageEditor.h> | ||
|
||
@interface CLImagePickerBundle() | ||
@property (nonatomic, weak) id<CLImagePickerBundleDelegate> delegate; | ||
@property (nonatomic, strong) NSString *bundleName; | ||
@end | ||
|
||
@implementation CLImagePickerBundle | ||
|
||
#pragma mark - singleton pattern | ||
|
||
static id _sharedInstance = nil; | ||
|
||
+ (CLImagePickerBundle*)instance | ||
{ | ||
static dispatch_once_t onceToken; | ||
dispatch_once(&onceToken, ^{ | ||
_sharedInstance = [[self alloc] init]; | ||
}); | ||
return _sharedInstance; | ||
} | ||
|
||
+ (id)allocWithZone:(NSZone *)zone | ||
{ | ||
@synchronized(self) { | ||
if (_sharedInstance == nil) { | ||
_sharedInstance = [super allocWithZone:zone]; | ||
return _sharedInstance; | ||
} | ||
} | ||
return nil; | ||
} | ||
|
||
- (id)copyWithZone:(NSZone *)zone | ||
{ | ||
return self; | ||
} | ||
|
||
- (id)init | ||
{ | ||
self = [super init]; | ||
if (self) { | ||
self.bundleName = @"CLImagePicker"; | ||
} | ||
return self; | ||
} | ||
|
||
#pragma mark- claas methods | ||
|
||
+ (void)setDelegate:(id<CLImagePickerBundleDelegate>)delegate | ||
{ | ||
self.instance.delegate = delegate; | ||
} | ||
|
||
+ (void)setBundleName:(NSString*)bundleName | ||
{ | ||
self.instance.bundleName = bundleName; | ||
} | ||
|
||
+ (NSString*)bundleName | ||
{ | ||
return self.instance.bundleName; | ||
} | ||
|
||
+ (NSBundle*)bundle | ||
{ | ||
return [NSBundle bundleWithPath:[[NSBundle mainBundle] pathForResource:self.bundleName ofType:@"bundle"]]; | ||
} | ||
|
||
+ (UIImage*)imageNamed:(NSString*)path | ||
{ | ||
return [UIImage imageNamed:[NSString stringWithFormat:@"%@.bundle/%@", self.bundleName, path]]; | ||
} | ||
|
||
+ (CLImageEditor*)imageEditor | ||
{ | ||
if([self.instance.delegate respondsToSelector:@selector(imageEditorForImagePicker)]){ | ||
return [self.instance.delegate imageEditorForImagePicker]; | ||
} | ||
return [CLImageEditor new]; | ||
} | ||
|
||
@end |
47 changes: 47 additions & 0 deletions
47
Classes/CLImagePicker/CLImagePickerController/CLImagePickerController.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
// | ||
// CLImagePickerController.h | ||
// | ||
// Created by sho yakushiji on 2014/01/09. | ||
// Copyright (c) 2014年 CALACULU. All rights reserved. | ||
// | ||
|
||
#import <UIKit/UIKit.h> | ||
|
||
@protocol CLImagePickerControllerDelegate; | ||
|
||
|
||
@interface CLImagePickerController : UIViewController | ||
{ | ||
IBOutlet __weak UICollectionView *_collectionView; | ||
IBOutlet __weak UINavigationBar *_navigationBar; | ||
} | ||
@property (nonatomic, weak) id<CLImagePickerControllerDelegate> delegate; | ||
|
||
- (void)setSelectedURLs:(NSArray*)selectedURLs; | ||
|
||
- (IBAction)pushedDoneBtn:(id)sender; | ||
- (IBAction)pushedCancelBtn:(id)sender; | ||
|
||
@end | ||
|
||
|
||
|
||
@protocol CLImagePickerControllerDelegate <NSObject> | ||
@required | ||
|
||
- (void)imagePickerController:(CLImagePickerController *)picker didTouchOriginalImage:(UIImage*)image withAssetURL:(NSURL*)url; | ||
- (void)imagePickerController:(CLImagePickerController *)picker didEditImage:(UIImage*)image withAssetURL:(NSURL*)url; | ||
- (void)imagePickerController:(CLImagePickerController *)picker didRemoveEdittedImageWithAssetURL:(NSURL*)url; | ||
|
||
- (BOOL)imagePickerController:(CLImagePickerController *)picker isEdittedImageWithAssetURL:(NSURL*)url; | ||
|
||
|
||
- (UIImage*)imagePickerController:(CLImagePickerController *)picker thumnailImageForAssetURL:(NSURL*)url; | ||
- (UIImage*)imagePickerController:(CLImagePickerController *)picker fullScreenImageForAssetURL:(NSURL*)url; | ||
|
||
- (void)imagePickerController:(CLImagePickerController *)picker didFinishPickingMediaWithSelectedAssetURLs:(NSArray*)selectedURLs; | ||
|
||
@optional | ||
- (void)imagePickerControllerDidCancel:(CLImagePickerController *)picker; | ||
|
||
@end |
Oops, something went wrong.