Dragon007
Lost but trying
Profile
Posts: 1509
Reg: Dec 17, 2011
London
20,590
05/16/13 04:19 AM (12 years ago)

Scringo - Problems Stopping Swipe in Carousel Plugin!

I have tried for a few days now to stop the swipe motion for Scringo in the Carousel Plugin. I have tried following the Kittsy guide, but I am having issues with this piece of code: -(void)viewDidAppear:(BOOL)animated{ [ScringoAgent pauseSwipe]; } -(void)viewDidDisappear:(BOOL)animated{ [ScringoAgent resumeSwipe]; } It states that I should place this code out side any of the curly brackets, but I have tried a few places, but this seems to disable the navigation for the Tab Bar and the Image Menu Plugin. Where do I place this piece of code as so far it appears to not matter where I add it, it will stop the app functioning correctly. HELP!
 
trouty
I hate code!
Profile
Posts: 338
Reg: Mar 26, 2013
London Outskirt...
4,830
like
05/16/13 04:43 AM (12 years ago)
Hi dude, d/load my app UK Ractrack Finder and go into my gallery, if that's what you want to achieve then ill send you the code straight out of my Xcode
 
Dragon007
Lost but trying
Profile
Posts: 1509
Reg: Dec 17, 2011
London
20,590
like
05/16/13 05:09 AM (12 years ago)
Hi Trouty all I would like to do is add the Scringo top right button, which I have done, but also to stop the swipe function in the Carousel Plugin. It's stopping the swipe function that is my problem.
 
ianJamesPiano
Code is Art
Profile
Posts: 2661
Reg: Feb 13, 2011
Palm Springs, C...
37,010
like
05/16/13 08:52 AM (12 years ago)
Hi @touty, Nice raceway app! The carousel menu seems to work fine with the Scringo top right Button controlling the swipe action. I am wondering if it's when an app is using a Tabbed Layout with the Carousel plunin that Scringo is acting funky. @Dragon007, is your app Tabbed or NON-Tabbed layout? I am making a note of this. Keep you posted guys. ian
 
Pancho
Code is Art
Profile
Posts: 221
Reg: Mar 06, 2012
Lima
11,610
like
05/16/13 09:14 AM (12 years ago)
Hi Dragon, The following was posted by Kittsy a few weeks ago for his carousel plugin. I have followed his instructions and they work great. So, here it goes as originally posted: ------------------------------------- #import <Scringo/ScringoAgent.h> add this line in the view will appear method self.navigationItem.rightBarButtonItem = [ScringoAgent scringoActivationBarItem]; add these lines outside of any other curly braces, this stops the swipe -(void)viewDidAppear:(BOOL)animated{ [ScringoAgent pauseSwipe]; } then add this outside any other curly braces, This makes sure the swipe will re eanable the swipe when past the acrousel menu -(void)viewDidDisappear:(BOOL)animated{ [ScringoAgent resumeSwipe]; } ---------------------------------- Also, Scringo can wreak havoc with other plugins due to its swipe feature. I have chosen to get rid of the manual swipe and just use the navbar right button by using the above code in all the plugins I use in my app. It works OK. Best Regards, Pancho.
 
Dragon007
Lost but trying
Profile
Posts: 1509
Reg: Dec 17, 2011
London
20,590
like
05/16/13 09:15 AM (12 years ago)
Hi Ian my app has a tab menu. Still having issues, don't have the code knowledge to fix.
 
ianJamesPiano
Code is Art
Profile
Posts: 2661
Reg: Feb 13, 2011
Palm Springs, C...
37,010
like
05/16/13 09:16 AM (12 years ago)
@Dragon007, Did you try the code above that @Pancho shared? Do you need help understanding where the code goes? let me know ian
 
Dragon007
Lost but trying
Profile
Posts: 1509
Reg: Dec 17, 2011
London
20,590
like
05/16/13 09:17 AM (12 years ago)
Hi Pancho this was the guide I was following, but having issues when I add the final bit of code: -(void)viewDidAppear:(BOOL)animated{ [ScringoAgent pauseSwipe]; } then add this outside any other curly braces, This makes sure the swipe will re eanable the swipe when past the acrousel menu -(void)viewDidDisappear:(BOOL)animated{ [ScringoAgent resumeSwipe]; } hits piece of code seems to make my tab bar menu non responsive and navigation won't work.
 
Dragon007
Lost but trying
Profile
Posts: 1509
Reg: Dec 17, 2011
London
20,590
like
05/16/13 09:21 AM (12 years ago)
Hi Ian a tip on where to add the final code would help.
 
trouty
I hate code!
Profile
Posts: 338
Reg: Mar 26, 2013
London Outskirt...
4,830
like
05/16/13 09:25 AM (12 years ago)
Yeah a few had this problem, come away from that screen and navigation becomes unresponsive... Swipe scringo then navigation starts working again. I updated my scringo SDK to 2.1.5 or whatever the latest one is, instead of the one packaged in BT, and it's been fine since
 
Pancho
Code is Art
Profile
Posts: 221
Reg: Mar 06, 2012
Lima
11,610
like
05/16/13 09:27 AM (12 years ago)
Hi Dragon, So, let´s walk step by step: 1) First, set up your Nav Bar: (I use it on the right side of my Nav Bar) In BT_Layout, in BT _viewUtilities, include #import <Scringo/ScringoAgent.h> In the same file, lines 276-277 include after the comments section UIBarButtonItem *rightBarButton = [ScringoAgent scringoActivationBarItem]; theViewController.navigationItem.rightBarButtonItem = rightBarButton;
 
Dragon007
Lost but trying
Profile
Posts: 1509
Reg: Dec 17, 2011
London
20,590
like
05/16/13 09:27 AM (12 years ago)
I am currently using the latest Scringo SDK.
 
Dragon007
Lost but trying
Profile
Posts: 1509
Reg: Dec 17, 2011
London
20,590
like
05/16/13 09:31 AM (12 years ago)
I currently have the right nav button already added and works fine. Its just stopping the swipe feature in the Carousel Plugin.
 
Dragon007
Lost but trying
Profile
Posts: 1509
Reg: Dec 17, 2011
London
20,590
like
05/16/13 09:38 AM (12 years ago)
OK, confused, I thought I was suppose to add the code to the plugin I wanted to add the Scringo button too. Is that wrong? Should I be adding code to the BT_viewutilities.m file? Should I take out the code I added to the Carousel Plugin? Confused!
 
Pancho
Code is Art
Profile
Posts: 221
Reg: Mar 06, 2012
Lima
11,610
like
05/16/13 09:39 AM (12 years ago)
Hi Dragon (sorry my previous text went away with an uncomplete answer...), So, let´s walk step by step: 1) First, set up your Nav Bar: (I use it on the right side of my Nav Bar) In BT_Layout, in BT _viewUtilities, include #import <Scringo/ScringoAgent.h> In the same file, lines 276-277 include after the comments section UIBarButtonItem *rightBarButton = [ScringoAgent scringoActivationBarItem]; theViewController.navigationItem.rightBarButtonItem = rightBarButton; 2) In BT_Config, in BT_nameOfYourApp_appDelegate.m include #import <Scringo/ScringoAgent.h> Then, in the same file, approx in lines 537-538 include your key [ScringoAgent startSession:@"your key" locationManager:nil]; [ScringoAgent scringoActivationBarItem]; 3) Finally, go to BT_carousel.m include #import <Scringo/ScringoAgent.h> In the same file, approx. line 104-106 outside curly brackets: -(void)viewDidAppear:(BOOL)animated{ [ScringoAgent pauseSwipe]; } -(void)viewDidDisappear:(BOOL)animated{ [ScringoAgent resumeSwipe]; } Include as the last line of method ViewWillAppear in the same file (before the last right curly brackets), self.navigationItem.rightBarButtonItem = [ScringoAgent scringoActivationBarItem]; With this everything will be cool. Hope it helps. Best regards, Pancho.
 
Dragon007
Lost but trying
Profile
Posts: 1509
Reg: Dec 17, 2011
London
20,590
like
05/16/13 09:52 AM (12 years ago)
How do I get line numbers next to the code? not sure what line is 100 or 200, not to clear where to add the code.
 
Pancho
Code is Art
Profile
Posts: 221
Reg: Mar 06, 2012
Lima
11,610
like
05/16/13 09:57 AM (12 years ago)
In your Xcode dev. environment, go to 1) Xcode --> Preferences 2) In Preference, go to "Text Editing", (4th Tab) 3) In "Text Editing" tab, check on "Line Numbers" 4) Down. Good hunting! Pancho
 
Dragon007
Lost but trying
Profile
Posts: 1509
Reg: Dec 17, 2011
London
20,590
like
05/16/13 10:00 AM (12 years ago)
OK that helps, now on to adding the code again.
 
Dragon007
Lost but trying
Profile
Posts: 1509
Reg: Dec 17, 2011
London
20,590
like
05/16/13 10:07 AM (12 years ago)
OK, I get red errors when I add this code on the specified lines: In the same file, approx. line 104-106 outside curly brackets: -(void)viewDidAppear:(BOOL)animated{ [ScringoAgent pauseSwipe]; } -(void)viewDidDisappear:(BOOL)animated{ [ScringoAgent resumeSwipe]; }
 
Pancho
Code is Art
Profile
Posts: 221
Reg: Mar 06, 2012
Lima
11,610
like
05/16/13 10:12 AM (12 years ago)
OK, let´s see Did you remember to add: #import <Scringo/ScringoAgent.h> You didn´t copy the word "include", didn´t you?? Don´t. That may have mislead you.
 
Dragon007
Lost but trying
Profile
Posts: 1509
Reg: Dec 17, 2011
London
20,590
like
05/16/13 10:13 AM (12 years ago)
Yes and Yes
 
Pancho
Code is Art
Profile
Posts: 221
Reg: Mar 06, 2012
Lima
11,610
like
05/16/13 10:14 AM (12 years ago)
OK, let´s see Did you remember to add: #import <Scringo/ScringoAgent.h> You didn´t copy the word "include", didn´t you?? Don´t. That may have mislead you.
 
Pancho
Code is Art
Profile
Posts: 221
Reg: Mar 06, 2012
Lima
11,610
like
05/16/13 10:17 AM (12 years ago)
Yes, you remember to add the import clause. And, yes you wrote the "include" word? If you did, take it out Just copy: #import <Scringo/ScringoAgent.h> in every instance.
 
Dragon007
Lost but trying
Profile
Posts: 1509
Reg: Dec 17, 2011
London
20,590
like
05/16/13 10:17 AM (12 years ago)
Do you have a screen shot of the code added for the final part? Yes and Yes was I have done everything right but still get the error.
 
Pancho
Code is Art
Profile
Posts: 221
Reg: Mar 06, 2012
Lima
11,610
like
05/16/13 10:22 AM (12 years ago)
I´m copying all the method below: (From lines 113 to 171 in BT_carousel.m) ------------------------------------ //viewWillAppear... -(void)viewWillAppear:(BOOL)animated{ [super viewWillAppear:animated]; [BT_debugger showIt:self theMessage:@"viewWillAppear"]; //flag this as the current screen KipuPeruVideos_appDelegate *appDelegate = (KipuPeruVideos_appDelegate *)[[UIApplication sharedApplication] delegate]; appDelegate.rootApp.currentScreenData = self.screenData; //setup navigation bar and background [BT_viewUtilities configureBackgroundAndNavBar:self theScreenData:[self screenData]]; //if we have not yet inited data.. if(self.didInit == 0){ [self performSelector:(@selector(loadData)) withObject:nil afterDelay:0.1]; [self setDidInit:1]; } //show or hide the label label.hidden = [[BT_strings getJsonPropertyValue:screenData.jsonVars nameOfProperty:@"AKShowLabel" defaultValue:@"0"]boolValue]; //will caurosel data infinetely scroll wrap = [[BT_strings getJsonPropertyValue:screenData.jsonVars nameOfProperty:@"AKWrap" defaultValue:@"0"]boolValue]; if (wrap == 0){ [self stopScrolling]; } else { [self startScrolling]; } // 3D effects does not work with time machine or vertical orientation if (aCarousel.vertical == 1 | aCarousel.type == iCarouselTypeTimeMachine | aCarousel.type == iCarouselTypeInvertedTimeMachine) { CGSize offset1 = CGSizeMake(0.0f,0.0f); aCarousel.viewpointOffset = offset1; CGSize offset2 = CGSizeMake(0.0f, 0.0f); aCarousel.contentOffset = offset2; }else{ CGSize offset1 = CGSizeMake(0.0f,[[BT_strings getJsonPropertyValue:screenData.jsonVars nameOfProperty:@"AKViewPoint" defaultValue:@"0"]floatValue]); aCarousel.viewpointOffset = offset1; CGSize offset2 = CGSizeMake(0.0f, [[BT_strings getJsonPropertyValue:screenData.jsonVars nameOfProperty:@"AKOffset" defaultValue:@"0"]floatValue]); aCarousel.contentOffset = offset2; } self.navigationItem.rightBarButtonItem = [ScringoAgent scringoActivationBarItem]; } -----------------------------------------------------------------------
 
Dragon007
Lost but trying
Profile
Posts: 1509
Reg: Dec 17, 2011
London
20,590
like
05/16/13 10:25 AM (12 years ago)
Pancho I do not see the code, you mentioned: In the same file, approx. line 104-106 outside curly brackets: -(void)viewDidAppear:(BOOL)animated{ [ScringoAgent pauseSwipe]; } -(void)viewDidDisappear:(BOOL)animated{ [ScringoAgent resumeSwipe]; } Where is this code added, don't see in your code.
 
Pancho
Code is Art
Profile
Posts: 221
Reg: Mar 06, 2012
Lima
11,610
like
05/16/13 10:33 AM (12 years ago)
The previous code is for method View will appear, lines 113 to 171 The following code is for method ViewWill Load, lines 69-102. After that code, you´ll find the code you mentioned. I chose to put it there, because as long as you put the mentioned outside any method (curly brackets pairs) is really the same. The following is for illustration purposes as to how I did it. ---------------------------------------------------- //viewDidLoad... -(void)viewDidLoad{ [BT_debugger showIt:self theMessage:@"viewDidLoad"]; [super viewDidLoad]; //set the carousel effect... NSString *effect = [BT_strings getJsonPropertyValue:screenData.jsonVars nameOfProperty:@"iCarouselEffect" defaultValue:@"iCarouselTypeCylinder"]; if([effect isEqualToString:@"iCarouselTypeCoverFlow"]) [aCarousel setType:iCarouselTypeCoverFlow]; if([effect isEqualToString:@"iCarouselTypeCoverFlow2"]) [aCarousel setType:iCarouselTypeCoverFlow2]; if([effect isEqualToString:@"iCarouselTypeWheel"]) [aCarousel setType:iCarouselTypeWheel]; if([effect isEqualToString:@"iCarouselTypeInvertedWheel"]) [aCarousel setType:iCarouselTypeInvertedWheel]; if([effect isEqualToString:@"iCarouselTypeTimeMachine"]) [aCarousel setType:iCarouselTypeTimeMachine]; if([effect isEqualToString:@"iCarouselTypeInvertedTimeMachine"]) [aCarousel setType:iCarouselTypeInvertedTimeMachine]; if([effect isEqualToString:@"iCarouselTypeCylinder"]) [aCarousel setType:iCarouselTypeCylinder]; if([effect isEqualToString:@"iCarouselTypeInvertedCylinder"]) [aCarousel setType:iCarouselTypeInvertedCylinder]; if([effect isEqualToString:@"iCarouselTypeRotary"]) [aCarousel setType:iCarouselTypeRotary]; if([effect isEqualToString:@"iCarouselTypeInvertedRotary"]) [aCarousel setType:iCarouselTypeInvertedRotary]; if([effect isEqualToString:@"iCarouselTypeLinear"]) [aCarousel setType:iCarouselTypeLinear]; if([effect isEqualToString:@"iCarouselTypeCustom"]) [aCarousel setType:iCarouselTypeCustom]; label.textColor = [UIColor whiteColor]; [label setFont:[UIFont fontWithName:@"Verdana" size:22]]; // set wether carousel is horisontal or vertical aCarousel.vertical = [[BT_strings getJsonPropertyValue:screenData.jsonVars nameOfProperty:@"AKOrientation" defaultValue:@"0"]boolValue]; if (wrap == 0){ [self stopScrolling]; } else { [self startScrolling]; } } ----------------------------------- // end of method......ViewWillLoad -(void)viewDidAppear:(BOOL)animated{ // This the code you are interested in including [ScringoAgent pauseSwipe]; } -(void)viewDidDisappear:(BOOL)animated{ [ScringoAgent resumeSwipe]; } ---------------------------------
 
Dragon007
Lost but trying
Profile
Posts: 1509
Reg: Dec 17, 2011
London
20,590
like
05/16/13 10:42 AM (12 years ago)
Yes, tried to add again but I either get red errors or it disables my tab bar, which becomes non responsive. I don't know where the best place to add this final piece of code.
 
Pancho
Code is Art
Profile
Posts: 221
Reg: Mar 06, 2012
Lima
11,610
like
05/16/13 10:47 AM (12 years ago)
Hmmmm..... Well, that´s what i did and all works OK. Sorry Dragon, that´s all I got. Let me review my instructions and come back later. Best, Pancho.
 
Dragon007
Lost but trying
Profile
Posts: 1509
Reg: Dec 17, 2011
London
20,590
like
05/16/13 10:50 AM (12 years ago)
No problem, thanks for helping.
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
05/16/13 10:50 AM (12 years ago)
Yo dude sorry to join the party late how did I miss this lol and your email reply let me take a look Hold the line
 
Dragon007
Lost but trying
Profile
Posts: 1509
Reg: Dec 17, 2011
London
20,590
like
05/16/13 10:54 AM (12 years ago)
You missed this, because you are probably creating some plugin that allows us to find aliens. lol!
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
05/16/13 11:01 AM (12 years ago)
I'm doing font stuff with MrDavid god damn procrastination lol
 

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.