Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 14    Views: 284

OrchardApps
Code is Art
Profile
Posts: 115
Reg: Jan 11, 2012
Brisbane austra...
5,850
08/30/12 05:15 AM (13 years ago)

Swipe gesture UIGestureRecognizer HTML To Previous Screen THIS IS A HOW TO ios

Firstly I would like to say that I don't take any credit for this. I have ripped of various tutorials and used this excellent post (link below) as a starting point. I have put everything here in the hope that I can help other people that are less techie like myself. The information covers how to implement a swipe view, but also how to make that swipe view actually move to the previous screen as a back button would. My initial starting point was here : http://www.buzztouch.com/forum/thread.php?tid=879FFB838AA6ABC00C901D2&command=isSearching&currentPage=1&topicTitle=swipe%20gesture&createdBy=&repliedBy=&minViews=-1&maxViews=-1&minReplies=-1&maxReplies=-1&forumCategory= Using the web view example. I had created a html document called milks.html and copied it into the xcode project BT_Docs folder. After creating my custom plugin as described in the above Buzztouch forum link I then add my html document name to the json file : ,"localFileName":"milks.html" to contain my milks.html file. All good so far. I then wanted to add a swipe gesture so that it went back to the previous screen. In the .m file I added : Under the [super viewDidLoad]; UISwipeGestureRecognizer *right = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(swipeRight)]; [right setDelegate:self]; [right setDirection:UISwipeGestureRecognizerDirectionRight]; [self.view addGestureRecognizer:right]; [right release]; Then I added -(void)swipeRight { [self.navigationController popViewControllerAnimated: YES]; } In the .h file you need to have UIGestureRecognizerDelegate, Full code here : @interface CF_custom_controller : BT_viewController <BT_downloadFileDelegate, UIWebViewDelegate, UIGestureRecognizerDelegate, UIActionSheetDelegate>{ UIWebView *webView; UIToolbar *browserToolBar; NSString *externalURL; NSString *localFileName; NSString *dataURL; BT_downloader *downloader; int didInit; int downloadInProgress; } Works like a charm. My resources for this were : http://www.youtube.com/watch?v=JVAyOO1D6S0 http://developer.apple.com/library/ios/#documentation/uikit/reference/UISwipeGestureRecognizer_Class/Reference/Reference.html
 
mysps
Code is Art
Profile
Posts: 2082
Reg: May 14, 2011
Palma
33,320
like
08/30/12 05:58 AM (13 years ago)
Very good for you!! Excellent :) when I have a chance I'll look at it all. Nice contribution.
 
Ashy_Ravaliya
Aspiring developer
Profile
Posts: 51
Reg: Apr 21, 2012
London, United ...
3,310
like
08/30/12 06:26 AM (13 years ago)
Great Post!
 
MadRod
Aspiring developer
Profile
Posts: 1853
Reg: Apr 12, 2012
Lisbon
27,930
like
08/30/12 06:47 AM (13 years ago)
Hey, great post but still a bit hard for me :-) When you say you created a screen as a custom plugin on the control panel, I am self hosted and do not have that option, there is no custom plugin. What am I missing? Thanks
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
08/30/12 08:58 AM (13 years ago)
Wow, that's some good stuff! Thanks!
 
coderx
Veteran developer
Profile
Posts: 433
Reg: Oct 29, 2011
Ontario, Canada
8,680
like
08/30/12 10:23 AM (13 years ago)
Excellent job!! Keep on coding and thanks for sharing.
 
Fred@mySkylla com
Android Fan
Profile
Posts: 5259
Reg: Oct 03, 2011
location unknow...
62,560
like
08/30/12 10:45 AM (13 years ago)
@MadRod, you do have that option. @Wigglepot, excellent post and excellent link to previous post. Fred
 
MadRod
Aspiring developer
Profile
Posts: 1853
Reg: Apr 12, 2012
Lisbon
27,930
like
08/30/12 04:26 PM (13 years ago)
Thanks Fred, but the only thins named custom on my control panel screens is Custom URL and Custom HTML/TEXT. Thanks
 
Fred@mySkylla com
Android Fan
Profile
Posts: 5259
Reg: Oct 03, 2011
location unknow...
62,560
like
08/30/12 09:45 PM (13 years ago)
@MadRod, you do have that option. @Wigglepot, excellent post and excellent link to previous post. Fred
 
OrchardApps
Code is Art
Profile
Posts: 115
Reg: Jan 11, 2012
Brisbane austra...
5,850
like
08/31/12 03:03 AM (13 years ago)
@MadRod, You're looking for "Load Custom Plug-in" That's how it is in 1.5. I can't afford self hosted yet so I can't help you any further than that I'm sorry. @Fred Can you be more specific for MadRod and tell him how the menu option appears exactly? That might help. Thanks for the positive feedback - I just collated though from work other people did. Christine
 
OrchardApps
Code is Art
Profile
Posts: 115
Reg: Jan 11, 2012
Brisbane austra...
5,850
like
09/02/12 03:57 PM (13 years ago)
OK - so this isn't quite there yet. It works for sure, but I need help hiding the nav bar in xcode. By default it is showing and I'm not sure how to get it to hide. Any help would be appreciated. Thanks Christine.
 
OrchardApps
Code is Art
Profile
Posts: 115
Reg: Jan 11, 2012
Brisbane austra...
5,850
like
09/02/12 07:09 PM (13 years ago)
I'm so dim sometimes. Simple hid the nav bar in your theme settings or add "navBarStyle":"hidden" to your json file or Just add: To hide the nav bar change the following : Change line of code : //hide nav bar [self.navigationController setNavigationBarHidden:FALSE animated:TRUE]; to //hide nav bar [self.navigationController setNavigationBarHidden:TRUE animated:TRUE]; in the custom .h file. Cheers
 
Fred@mySkylla com
Android Fan
Profile
Posts: 5259
Reg: Oct 03, 2011
location unknow...
62,560
like
09/02/12 09:19 PM (13 years ago)
You may be dim sometimes, but as someone once said, "One small step for BTv1.5, one giant leap for Buzztouch." Thanks for the info. Fred
 
Cyrus_8888
I hate code!
Profile
Posts: 151
Reg: Dec 24, 2011
Sydney
1,610
like
09/03/12 08:45 PM (13 years ago)
Hi Wrigglepot Thanks for sharing, but I'm having some difficulty to implement your custom plugin into my project. I wanna to create a double tap gesture recognizer from a html document to link with my other xcode BT screens. Somehow xcode just can't recognise UITapGestureRecognizer in both .h and .m file, I tried to change the itemType, itemNickname, and classFileName in JSON, but the display I got is "screen not found?" Obviously something is not link up. After I download the new custom plugin from BT, besides ViewController.m & ViewController.h, is there any other files I need to drag to xcode? Thanks in advance!!!
 
DryFrog
Lost but trying
Profile
Posts: 42
Reg: Jun 26, 2012
São Paulo
4,620
like
07/04/13 04:28 PM (12 years ago)
Hi everyone, Is it possible to enable this gesture in PDF Plugin? Tried and it didn't work... Thanks in advance for all the help! Cheers, dryFrog
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.