This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Setting translucent to YES on the navigation bar does the trick, due to a behavior discussed in the UINavigationBar documentation. I'll report here the relevant fragment: | |
If you set this property to YES on a navigation bar with an opaque custom background image, the navigation bar will apply a system opacity less than 1.0 to the image. | |
*/ | |
// Transparent UINavigationBar | |
[self.navigationBar setBackgroundImage:[UIImage new] forBarMetrics:UIBarMetricsDefault]; | |
self.navigationBar.shadowImage = [UIImage new]; | |
self.navigationBar.translucent = YES; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import "SDImageCache.h" | |
@interface SDImageCache (PrivateMethods) | |
- (NSString *)defaultCachePathForKey:(NSString *)key; | |
- (NSString *)cachedFileNameForKey:(NSString *)key; | |
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// CGSizeZero !!! | |
CGSize contentSize = [self.webView sizeThatFits:CGSizeZero]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mySwitch.tintColor = [UIColor blackColor]; | |
mySwitch.backgroundColor = [UIColor redColor]; | |
mySwitch.layer.cornerRadius = 16.0; // you must import QuartzCore to do this. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// UIDeviceHardware.h | |
// | |
// Used to determine EXACT version of device software is running on. | |
#import <Foundation/Foundation.h> | |
@interface UIDeviceHardware : NSObject | |
- (NSString *) platform; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Using CoreLocation on Mac OS X with command-line | |
// $ clang CoreLocationTest.m -framework cocoa -framework CoreLocation | |
// $ ./a.out | |
// location service enabled | |
// 2011-12-01 21:03:01.839 a.out[10214:903] latitude,logitude : 35.606647, 140.695538 | |
// 2011-12-01 21:03:01.842 a.out[10214:903] timestamp : 2011-12-01 21:01:36 +0900 | |
// tmiz moo@tmiz.net | |
// | |
#import <cocoa/cocoa.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <Foundation/Foundation.h> | |
@interface NSBundle (Language) | |
+(void)setLanguage:(NSString*)language; | |
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSURL *bluetoothURLOS8 = [NSURL URLWithString:@"prefs:root=General&path=Bluetooth"]; | |
NSURL *bluetoothURLOS9 = [NSURL URLWithString:@"prefs:root=Bluetooth"]; | |
NSURL *bluetoothURLOS10 = [NSURL URLWithString:@"Prefs:root=Bluetooth"]; | |
if ([[[UIDevice currentDevice] systemVersion] intValue] >= 10) { | |
Class<NSObject> workSpaceClass = NSClassFromString(@"LSApplicationWorkspace"); | |
if (workSpaceClass) { | |
#pragma clang diagnostic push | |
#pragma clang diagnostic ignored "-Warc-performSelector-leaks" | |
id workSpaceInstance = [workSpaceClass performSelector:NSSelectorFromString(@"defaultWorkspace")]; | |
SEL selector = NSSelectorFromString(@"openSensitiveURL:withOptions:"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#To Get List of Hardware | |
sudo networksetup -listallhardwareports | |
#To Disable IPv6 on Wifi Adapter | |
sudo networksetup -setv6off wi-fi | |
#To Disable IPv6 on Built-in Ethernet Adapter | |
sudo networksetup -setv6off Ethernet |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* The official example for CoreWLAN is now obsolete, | |
so here's a small command-line example that works with Xcode 6 and Yosemite. | |
It only demonstrates how to get basic wi-fi connection properties and scan. | |
Enjoy! | |
pavel_a@fastmail.fm 01-Mar-2015 | |
*/ | |
#import <Foundation/Foundation.h> | |
#import <CoreWLAN/CoreWLAN.h> | |
#include <stdio.h> |
OlderNewer