Appirater doesn't work - ios

I'd like to show Appirater when I click some button.
here is my setting in appdelegate
Appirater.setAppId("...")
Appirater.setDaysUntilPrompt(0)
Appirater.setUsesUntilPrompt(0)
Appirater.setTimeBeforeReminding(30)
Appirater.setSignificantEventsUntilPrompt(10)
Appirater.userDidSignificantEvent(true))
Appirater.appLaunched(true)
and then I put below code in my view controller
Appirater.tryToShowPrompt()
I don't any idea how to call correct method in action.

You will be able to use forceShowPrompt method. However by forcing the prompt consider the side effects. By the way if you want to see the Appirater on the debug mode always, you can use Appirater.setDebug(true) method.

Related

Is this a good way to add protocols to a class I'm hooking in?

I'm trying to write a test tweak for iOS 8.3 using Theos.
This tweak will show a UIAlertView with two choices when the user taps on an application's icon.
I want to distinguish between the buttons, and to do so I need to add the UIAlertViewDelegate.
Following this example written by DHowett, I've adapted his code to run under iOS 8.3.
The code compiles and loads fine but no action is triggered when I tap on any icon.
If I simply hook into SBApplicationIcon with the correct method, action is triggered but this way I'm not able to distinguish button press.
Is this still a good way to add protocols?
You can cast the class you're hooking into to id<ProtocolName> when setting the delegate.
For instance, in your case it would be something like:
[alert setDelegate: (id<UIAlertViewDelegate>) self];

Is there a way to see which line of code was just executed in Xcode?

I'm debugging an iOS app in Xcode, and I'm wondering is there any way to see which line of code I just ran? I'm trying to figure out where the code is that is responsible for making a menu slide open when I tap the menu key.
Thanks
Set a breakpoint (tap on a line number in Xcode) and manually run the code line by line using Xcode's Debug menu. In your case you can set a breakpoint on the method that is executed when a button is pushed. If you do not know which method is called when you push the button, you could look at where the button is declared, which should have a addTarget method, or see what it is hooked up to in the Storyboard.
If you have a few places where you think the code is executed, you can use NSLog() statements and see what is being printed to the console at what time.

iOS5 Custom Window rotation issue

So I'm creating and showing a custom window in my iOS app because I'm writing a dynamic alert view that also functions like a growl/toast alert. It works AWESOMELY in ios6 (Hopefully I can open source this baby and you can all check it out)
But anyway, when I run this in ios5, the window that my alerts exist on doesn't seem to rotate with the device/simulator. No matter what, my custom window stays in portrait mode.
The UIWindow is just a UIView subclass, so there's no nice 'shouldRotate' delegate method.
I'm kinda stumped on why this is happening in ios5 but not 6. Any help would be GREATLY appreciated ^_^
My window has a rootviewcontroller, which I completely forgot about. I just needed to implement
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation{
return YES;
}
To get it to work.
:-D
It's usually not recommended two use multiple instances of UIWindow in one iOS app. The only valid reason to do so is to support external screens. You should use a UIView instead, ideally managed by a UIViewController.
I assume, (since you didn't provide any code, I can only assume) the reason why your window doesn't 'rotate' is, that it's simply not getting any notifications about device rotation. Only the keyWindow receives them by default.
I would highly recommend to redesign your app to use a properly managed UIView instead. If you desperately don't want that for some reason, you would have to register your instance of UIWindow to receive the UIDeviceOrientationDidChangeNotification and then (in the handler) evaluate what the new orientation is and change the window's frame accordingly (plus maybe other things that need to be done in response to the orientation change)

Release Event Handler?

Maybe I'm just over thinking this, but is there a way to capture when the user let's go of a button with iOS? So to pose my question better: I have a button on the screen, and when the user let's go of it, I want to call an event. Is there a way to do that?
Try to answer, I wonder the same idea too..
From Apple Document : UIControl Class
http://developer.apple.com/library/ios/#documentation/uikit/reference/UIControl_Class/Reference/Reference.html
My Idea sub-class UI Control using following Task :
– beginTrackingWithTouch:withEvent:
– continueTrackingWithTouch:withEvent:
– endTrackingWithTouch:withEvent:
– cancelTrackingWithEvent:
Put a BOOL isBegin = YES at beginTrackingWithTouch to know that it was touched..
Then when endTrackingWithTouch happen (which is the user end touching the control), do what you going to do in there then set isBegin back to NO
regards,
FHW

Black temporary alert box in iOS

I need a black temporary transparent box that must show something like "Loading...." with a spinner it. We can see such a view in twitter when "Tweeting" an update - it says "Sending tweet..." kinda thing.
Is this an inbuilt behavior in UIKit. How do I get this box to show up on screen for a few seconds and disappear.
please help.
You need to use DSActivityView. All this is handled there. Instead of doing your own thing I suggest you use this.
For what you need this is how you need to go -
#import "DSActivityView.h"
[DSActivityView activityViewForView:self.view withLabel:#"Tweeting"]; //to show spinner with label
[DSActivityView removeView]; //once its done
You can also try using MBProgressHud

Resources