Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create the view programmatically #3

Open
madcommit opened this issue Apr 29, 2015 · 1 comment
Open

Create the view programmatically #3

madcommit opened this issue Apr 29, 2015 · 1 comment

Comments

@madcommit
Copy link

Hi, I am using your code and ran into the following issues. Any help is much appreciated.

  1. I want to create the view programmatically. Instead of creating the view in outlet.
  2. Is there any way I can start the view at the final position.

I am pretty much trying to create your todo, where I navigate to a different scene, I want the view in the final position and when they tap back I want it at the start position.

can you please provide some guidance on to go about this.

Thanks for your code.

@tfrank64
Copy link
Owner

tfrank64 commented May 5, 2015

Sure, thanks for your interest.

1: The view itself is really simple to make since it is a UIView subclass. You should just put something like this in the viewDidLoad:

programmaticSwipeView = TFSwipeShrinkView(frame: CGRectMake(0, 64, 414, 233))
programmaticSwipeView.hidden = true
self.view.addSubview(programmaticSwipeView)

Everything else should be the same, just using your programmatic view. Note, I did have to add the gesture set up in the init with frame method to make this work. That said, it doesn't look perfect in transition, I'll open an issue.

2: No, there is way currently to swap out the starting and final positions. Feel free to look into it and pull request if you end up creating a way to do that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants