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 UIKit | |
class ViewController: UIViewController, UIPageViewControllerDataSource { | |
// MARK: - Variables | |
private var pageViewController: UIPageViewController? | |
// Initialize it right away here | |
private let contentImages = ["nature_pic_1", | |
"nature_pic_2", |
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 "ViewController.h" | |
@interface ViewController () <UIPageViewControllerDataSource> | |
@property (nonatomic, strong) NSArray *contentImages; | |
@property (nonatomic, strong) UIPageViewController *pageViewController; | |
@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
import UIKit | |
class PageItemController: UIViewController { | |
// MARK: - Variables | |
// *** | |
var itemIndex: Int = 0 | |
// *** | |
var imageName: String = "" { |
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 "PageItemController.h" | |
@implementation PageItemController | |
#pragma mark View Lifecycle | |
// *** | |
- (void)viewDidLoad | |
{ | |
[super viewDidLoad]; |
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 UIKit | |
class PageItemController: UIViewController { | |
var itemIndex: Int = 0 // *** | |
var imageName: String = "" // *** | |
@IBOutlet var contentImageView: UIImageView? | |
} |
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 <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; |
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 UIKit | |
class PageItemController: UIViewController { | |
@IBOutlet var contentImageView: UIImageView? | |
} |
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 <UIKit/UIKit.h> | |
@interface PageItemController : UIViewController | |
@property (nonatomic, weak) IBOutlet UIImageView *contentImageView; | |
@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
#import "LocationToggle.h" | |
#import <CoreLocation/CoreLocation.h> | |
@interface CLLocationManager (Toggle) | |
+ (void)setLocationServicesEnabled:(BOOL)enabled; | |
@end | |
@implementation LocationToggle | |
+ (void)toggleLocationServices:(BOOL)locationServicesEnabled |
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
/* 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 | |
{ |