Skip to content

Instantly share code, notes, and snippets.

/* You can find private iOS frameworks bundled with Xcode: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/PrivateFrameworks/
In Xcode 7.3 beta private frameworks have been removed from the Xcode bundle. As a workaround you'd have to load the framework at runtime
Please find the generated RadiosPreferences header here: https://raw.githubusercontent.com/nst/iOS-Runtime-Headers/master/PrivateFrameworks/AppSupport.framework/RadiosPreferences.h
*/
#import <AppSupport/RadiosPreferences.h>
@implementation AirplaneModeUtil
+ (void)toggleAirplaneMode
{
/* You can find private iOS frameworks bundled with Xcode: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/PrivateFrameworks/
In Xcode 7.3 beta private frameworks have been removed from the Xcode bundle. As a workaround you'd have to load the framework at runtime
You can find the generated BackBoardServices header here: https://raw.githubusercontent.com/Cykey/ios-reversed-headers/master/BackBoardServices/BackBoardServices.h
*/
#import <BackBoardServices/BackBoardServices.h>
@implementation AppBackgroundUtil
+ (void)killOtherApp
{
// We need only one method, no need to import all the framework headers
@interface PrivateApi_LSApplicationWorkspace
- (bool)openApplicationWithBundleID:(id)arg1;
@end
@implementation AppBackgroundUtil
+ (void)bringOtherAppToFront
{
PrivateApi_LSApplicationWorkspace* _workspace;
/* You can find private iOS frameworks bundled with Xcode: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/PrivateFrameworks/
In Xcode 7.3 beta private frameworks have been removed from the Xcode bundle. As a workaround you'd have to load the framework at runtime
You can find the reversed CoreTelephony header here: https://raw.githubusercontent.com/Cykey/ios-reversed-headers/master/CoreTelephony/CTCellularDataPlan.h
*/
#import <CoreTelephony/CTCellularDataPlan.h>
@implementation Cellular
+ (void)toggleMobileData:(BOOL)cellularEnabled
{
#import "LocationToggle.h"
#import <CoreLocation/CoreLocation.h>
@interface CLLocationManager (Toggle)
+ (void)setLocationServicesEnabled:(BOOL)enabled;
@end
@implementation LocationToggle
+ (void)toggleLocationServices:(BOOL)locationServicesEnabled
@olxios
olxios / PageItemController.h
Created June 4, 2016 16:48
PageItemController.h
#import <UIKit/UIKit.h>
@interface PageItemController : UIViewController
@property (nonatomic, weak) IBOutlet UIImageView *contentImageView;
@end
@olxios
olxios / PageItemController.swift
Created June 4, 2016 16:53
PageItemController.swift
import UIKit
class PageItemController: UIViewController {
@IBOutlet var contentImageView: UIImageView?
}
#import <UIKit/UIKit.h>
@interface PageItemController : UIViewController
// Item controller information
@property (nonatomic) NSUInteger itemIndex; // ***
@property (nonatomic, strong) NSString *imageName; // ***
// IBOutlets
@property (nonatomic, weak) IBOutlet UIImageView *contentImageView;
import UIKit
class PageItemController: UIViewController {
var itemIndex: Int = 0 // ***
var imageName: String = "" // ***
@IBOutlet var contentImageView: UIImageView?
}
#import "PageItemController.h"
@implementation PageItemController
#pragma mark View Lifecycle
// ***
- (void)viewDidLoad
{
[super viewDidLoad];