Skip to content
프로젝트

소개

상호작용 가능한 닫기 애니메이션을 제공하는 아름다운 사진 브라우저입니다. 작지만 아름다운 이미지 브라우저입니다.

디자인 및 미디어

이 수치를 측정하는 방법

What you can do

  • 4 different interactive dismissal animations (Rotation, Scale, Slide)
  • 3 different background styles (Blur Photo, Blur, Black)
  • 2 different loading styles (Determinate, Indeterminate)
  • 2 different pager styles (Dot, Text)

측정된 스타 증가

in 24h
0
in 7 days
0
in 15 days
-3
in 1 month
기록 수집 중

서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.

README.md

Original

KSPhotoBrowser

License MIT  CocoaPods  CocoaPods  Support 

A beautiful photo browser with interactive dismissal animation.

Rotation~ Blur~ Scale~ Corner~ Orientation~ Index~

Features

  • 4 different interactive dismissal animations (Rotation, Scale, Slide)
  • 3 different background styles (Blur Photo, Blur, Black)
  • 2 different loading styles (Determinate, Indeterminate)
  • 2 different pager styles (Dot, Text)
  • Support bounce animation
  • Optimized for image which has a very large height
  • Can display one or more images by providing either image urls or UIImage objects
  • Custom image downloader library support
  • Smooth animation with corner radius
  • Support both portrait and landscape device orientation
  • Support video browse

Usage

Display images from urls

NSArray *urls = @[@"https://ww4.sinaimg.cn/bmiddle/a15bd3a5jw1f12r9ku6wjj20u00mhn22.jpg",
                  @"https://ww2.sinaimg.cn/bmiddle/a15bd3a5jw1f01hkxyjhej20u00jzacj.jpg"];
NSMutableArray *items = @[].mutableCopy;
for (int i = 0; i < urls.count; i++) {
    // Get the large image url
    NSString *url = [urls[i] stringByReplacingOccurrencesOfString:@"bmiddle" withString:@"large"];
    UIImageView *imageView = _imageViews[i];
    KSPhotoItem *item = [KSPhotoItem itemWithSourceView:imageView imageUrl:[NSURL URLWithString:url]];
    [items addObject:item];
}
KSPhotoBrowser *browser = [KSPhotoBrowser browserWithPhotoItems:items selectedIndex:0];
[browser showFromViewController:self];

Display images from UIImage objects

NSArray *names = @[@"a.jpg", @"b.jpg"];
NSMutableArray *items = @[].mutableCopy;
for (int i = 0; i < names.count; i++) {
    UIImageView *imageView = _imageViews[i];
    KSPhotoItem *item = [KSPhotoItem itemWithSourceView:imageView image:[UIImage imageNamed:names[i]]];
    [items addObject:item];
}
KSPhotoBrowser *browser = [KSPhotoBrowser browserWithPhotoItems:items selectedIndex:0];
[browser showFromViewController:self];

Installation

Cocoapods

  1. Update cocoapods to the latest version.
  2. Add pod 'KSPhotoBrowser' to your Podfile.
  3. Run pod install or pod update.
  4. Import KSPhotoBrowser.h.

Manually

  1. Download all the files of KSPhotoBrowser and add source files to your project.
  2. Manually install SDWebImage to your project.
  3. Import KSPhotoBrowser.h.

Custom Image Downloader

It use SDWebImage as default image downloader, you can also use your custom image downloader like YYWebImage, Kingfisher and so on.

To use a custom image downloader, you need to create a class and make it conforms to KSImageManagerProtocol and implement those methods inside that protocol.

For convenience, I have already created KSYYImageManager to support YYWebImage as an example in the demo, you can also use it directly.

Finally, just use the code below to set your class to KSPhotoBrowser before you use the browser to show images.

[KSPhotoBrowser setImageManagerClass:KSYYImageManager.class]

Requirements

This library requires iOS 8.0+ and Xcode 8.0+.

License

KSPhotoBrowser is provided under the MIT license. See LICENSE file for details.

관련 프로젝트 살펴보기

불러오는 중…