Skip to content
This repository has been archived by the owner on Apr 6, 2020. It is now read-only.

Expose checkmark color for customisation. #169

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions QBImagePicker/QBAssetCell.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@
@property (weak, nonatomic) IBOutlet QBVideoIndicatorView *videoIndicatorView;

@property (nonatomic, assign) BOOL showsOverlayViewWhenSelected;
@property (nonatomic) UIColor* checkmarkColor;

@end
8 changes: 8 additions & 0 deletions QBImagePicker/QBAssetCell.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@
//

#import "QBAssetCell.h"
#import "QBCheckmarkView.h"

@interface QBAssetCell ()

@property (weak, nonatomic) IBOutlet UIView *overlayView;
@property (weak, nonatomic) IBOutlet QBCheckmarkView *checkmarkView;

@end

Expand All @@ -24,4 +26,10 @@ - (void)setSelected:(BOOL)selected
self.overlayView.hidden = !(selected && self.showsOverlayViewWhenSelected);
}

-(void)setCheckmarkColor:(UIColor *)checkmarkColor
{
_checkmarkColor = checkmarkColor;
self.checkmarkView.bodyColor = checkmarkColor;
}

@end
1 change: 1 addition & 0 deletions QBImagePicker/QBAssetsViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,7 @@ - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cell
QBAssetCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"AssetCell" forIndexPath:indexPath];
cell.tag = indexPath.item;
cell.showsOverlayViewWhenSelected = self.imagePickerController.allowsMultipleSelection;
cell.checkmarkColor = self.imagePickerController.checkmarkColor;

// Image
PHAsset *asset = self.fetchResult[indexPath.item];
Expand Down
6 changes: 4 additions & 2 deletions QBImagePicker/QBImagePicker.storyboard
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="7702" systemVersion="14D136" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10116" systemVersion="15B42" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7701"/>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
<capability name="Constraints to layout margins" minToolsVersion="6.0"/>
</dependencies>
<scenes>
Expand Down Expand Up @@ -226,6 +227,7 @@
</mask>
</variation>
<connections>
<outlet property="checkmarkView" destination="m99-yj-HSc" id="Dbh-Gd-gVA"/>
<outlet property="imageView" destination="0aq-fn-r9R" id="smK-ma-TWL"/>
<outlet property="overlayView" destination="uyS-Tg-Iyl" id="N6m-w2-m4M"/>
<outlet property="videoIndicatorView" destination="BwJ-KE-LWZ" id="HkB-Dc-nzF"/>
Expand Down
2 changes: 2 additions & 0 deletions QBImagePicker/QBImagePickerController.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ typedef NS_ENUM(NSUInteger, QBImagePickerMediaType) {
@property (nonatomic, copy) NSString *prompt;
@property (nonatomic, assign) BOOL showsNumberOfSelectedAssets;

@property (nonatomic, copy) UIColor *checkmarkColor;

@property (nonatomic, assign) NSUInteger numberOfColumnsInPortrait;
@property (nonatomic, assign) NSUInteger numberOfColumnsInLandscape;

Expand Down