Skip to content

Instantly share code, notes, and snippets.

@larryaasen
Created April 17, 2013 12:48
Show Gist options
  • Save larryaasen/5403964 to your computer and use it in GitHub Desktop.
Save larryaasen/5403964 to your computer and use it in GitHub Desktop.
UIDevice+LAExtras - vibrate the device and get the OS name and version.
//
// UIDevice+LAExtras.h
// Konugo
//
// Created by Larry Aasen on 3/26/13.
//
//
#import <UIKit/UIKit.h>
@interface UIDevice (LAExtras)
@property(nonatomic, readonly, retain) NSString *systemNameVersion; // "iOS 6.0.1"
+ (void)vibrate;
@end
//
// UIDevice+LAExtras.m
// Konugo
//
// Created by Larry Aasen on 3/26/13.
//
//
#import "UIDevice+LAExtras.h"
#import "AudioToolbox/AudioServices.h"
@implementation UIDevice (LAExtras)
- (NSString *)systemNameVersion
{
return [NSString stringWithFormat:@"%@ %@", self.systemName, self.systemVersion];
}
+ (void)vibrate
{
AudioServicesPlaySystemSound (kSystemSoundID_Vibrate);
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment