Coder Social home page Coder Social logo

chtstickerview's People

Contributors

chiahsien avatar hsatac avatar offfffz 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

chtstickerview's Issues

Resize without rotation

This functionality would be fully complete if user can resize the view in different directions without it being rotated. I have seen this as a trend in many apps: one corner does a resize-rotate (done) and another corner does rotate only (can be easily done by adjusting your code). But how to resize the third corner without rotation so bounds can be easily adjusted to the touch location. This means resizing occurs unproportionally while the opposite corner is locked in its position? I tried this code but it does not perfectly work.

  • (void)handleResizeGesture:(UIPanGestureRecognizer *)recognizer {
    CGPoint touchLocation = [recognizer locationInView:self.superview];
    CGPoint center = self.center;
    switch (recognizer.state) {
    case UIGestureRecognizerStateBegan: {
    initialBounds = self.bounds;
    initialLocation = touchLocation;
    [self.delegate stickerViewDidBeginRotating:self];
    break;
    }
    case UIGestureRecognizerStateChanged: {
    CGRect resizedBounds = CGRectMake(0, 0,
    initialBounds.size.width + touchLocation.x - initialLocation.x,
    initialBounds.size.height + touchLocation.y - initialLocation.y);
    self.bounds = resizedBounds;
    [self setNeedsDisplay];
    [self.delegate stickerViewDidChangeRotating:self];
    break;
    }
    case UIGestureRecognizerStateEnded:
    [self.delegate stickerViewDidEndRotating:self];
    break;
    default: break;
    }
    }

Can't remove or rotate stickerView under other stickerView

As your demo code, if stickerViewA (content with UIImageView) the corner (remove or rotate side) under and not full cover via stickerViewB (content with UILabel),
than I can't remove or rotate stickerViewA.

I suggest you can select stickerViewA and bring it to front temporary,
and select other sticker or unselect stickerViewA push to really layer.

Add New Button

is it Possible To Add new Button in Middle of CHTSticker View ? I will try but Button is not Display in Center it is Display Out of View.

handleCloseGesture problem

First: Thanks for the nice control!

There is a small problem in the handleCloseGesture routine: if you removeFromSuperview first, then the respondsToSelector returns false.

You should first call the delegate and then removeFromSuperview:

  • (void)handleCloseGesture:(UITapGestureRecognizer *)recognizer {
    if ([self.delegate respondsToSelector:@selector(stickerViewDidClose:)]) {
    [self.delegate stickerViewDidClose:self];
    }
    [self removeFromSuperview];
    }

Kind Regards
Graham

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.