Giter Site home page Giter Site logo

chrisxu / cxphotobrowser Goto Github PK

View Code? Open in Web Editor NEW
280.0 280.0 65.0 445 KB

Photo browser for iOS, Inspiring by @MWPhotoBrowser. Supporting with high level customization, including Navigationbar, Toolbar, Loading process placeholder and Loading failure placeholder.

License: MIT License

Ruby 1.16% Objective-C 98.84%

cxphotobrowser's Introduction

Hi there ๐Ÿ‘‹

I'm a software engineer who has been building beautiful iOS apps since 2011. I am also passionate about helping other engineers and shaping a healthier engineering culture.

  • ๐Ÿง‘โ€๐Ÿ’ป I code in Swift by day, Python by night, and JS on weekend.
  • ๐Ÿ“š I like reading books. Here is my booklist.
  • ๐Ÿ“ Occasionally, I write my thoughts on Write The Func.
  • โญ๏ธ Fun fact: The only novel I have is The Hitchhiker's Guide to the Galaxy

ChrisXu's GitHub stats

cxphotobrowser's People

Contributors

bitdeli-chef avatar bryant1410 avatar chrisxu avatar paulmars avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cxphotobrowser's Issues

browserNavigationBarViewOfPhotoBrowser not called

i followed the usage and implemented datasource methods, both required and optional,especially the browserNavigationBarViewOfPhotoBrowser method.

the result is the image is shown correctly, but the nav bar not showed.

edit: i've tryed to change the way browser shown from pushViewController to presentViewController, and it works.

it's a issue or a feature?

Pull request

Did you consider trying to submit your changes back upstream as a pull request?

wifi connection

I want to allow users to download photos from internet only when wifi is connected. How to do it?

CXPhotoLoading need to change init param

In CXPhotoLoading.h, you init with param CXPhoto. So that, if user need to implement their CXPhoto (with CXProtocol), then they get a warning. I think it should better if you change your init like this (in both .h and .m)

- (id)initWithPhoto:(id<CXPhotoProtocol>)photo;

P/S: Your libs is the best flexible Photo Browser I researched in CocoaControl (IDMPhotoBrowser, MWPhotoBrowser...). Thank you for your hard work in this project! :)

Suggestion for delegate

Isn't it CXPhotoBrowserDelegate a better place for these 2 methods?

  • (CXBrowserNavBarView *)browserNavigationBarViewOfOfPhotoBrowser:(CXPhotoBrowser *)photoBrowser withSize:(CGSize)size;
  • (CXBrowserToolBarView *)browserToolBarViewOfPhotoBrowser:(CXPhotoBrowser *)photoBrowser withSize:(CGSize)size;

kinwah

some problem when using "setInitialPageIndex"

CXPhotoBrowser really help me a lot,but when I using "setInitialPageIndex",there has a problem,the browser just show up the hint"sorry! unable to load image",it looks like the browser didn't load the pic on initial index ever.

init by Storyboard

I decide to use your CXPhotoBrowser in storyboard but can't handle it. The reason is you don't implement method [initWithCoder:]. I changed your implement file like this. Hope you can consider it.

- (id)init
{
    self = [super init];
    if (self)
    {
        [self setupDefault];
    }
    return self;
}

- (id)initWithCoder:(NSCoder *)aDecoder
{
    self = [super initWithCoder:aDecoder];
    if (self)
    {
        [self setupDefault];
    }
    return self;
}

- (void)setupDefault
{
    self.wantsFullScreenLayout = YES;
    self.hidesBottomBarWhenPushed = YES;
    _performingLayout = NO; // Reset on view did appear
    _rotating = NO;
    _viewIsActive = NO;
    _scrolling = NO;
    _didSavePreviousStateOfNavBar = NO;
    _shouldUseDefaultUINavigationBar = NO;
    _supportReload = YES;
    _photoCount = NSNotFound;
    _currentPageIndex = 0;
    _visiblePages = [[NSMutableSet alloc] init];
    _recycledPages = [[NSMutableSet alloc] init];
    _photos = [[NSMutableArray alloc] init];

    [[NSNotificationCenter defaultCenter] addObserver:self
                                             selector:@selector(handleCXPhotoImageDidStartLoad:)
                                                 name:NFCXPhotoImageDidStartLoad
                                               object:nil];

    [[NSNotificationCenter defaultCenter] addObserver:self
                                             selector:@selector(handleCXPhotoImageDidFinishLoad:)
                                                 name:NFCXPhotoImageDidFinishLoad
                                               object:nil];

    [[NSNotificationCenter defaultCenter] addObserver:self
                                             selector:@selector(handleCXPhotoImageDidFailLoadWithError:)
                                                 name:NFCXPhotoImageDidFailLoadWithError
                                               object:nil];

    [[NSNotificationCenter defaultCenter] addObserver:self
                                             selector:@selector(handleCXPhotoImageDidStartReload:)
                                                 name:NFCXPhotoImageDidStartReload
                                               object:nil];
}

library not found for -lPods

When i run you are demo project i received following error

ld: library not found for -lPods
clang: error: linker command failed with exit code 1 (use -v to see invocation)

get photo with index

Some 3rd lib (like iCarousel) give user some method to work item (current item, selected item...). I see that you have some methods in CXPhotoBrowser.m but they're private methods.

// Data
- (id<CXPhotoProtocol>)photoAtIndex:(NSUInteger)index;
- (NSUInteger)indexOfPhoto:(id<CXPhotoProtocol>)photo;

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.