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
- (IBAction)btnDirectionsPressed:(id)sender { | |
[self enableUI:NO]; // This method enables or disables all the UI elements that interact with the user | |
dispatch_semaphore_t semaphore = dispatch_semaphore_create(0); // Create the semaphore | |
__block NSMutableArray *routes = [[NSMutableArray alloc] init]; // Arrays to store MKRoute objects and MKAnnotationPoint objects, so then we can draw them on the map | |
__block NSMutableArray *annotations = [[NSMutableArray alloc] init]; | |
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0), ^{ | |
for (RouteObject *routeObject in _locations) { |
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
self.scrollView = [UIScrollView new]; | |
self.scrollView.pagingEnabled = YES; | |
self.scrollView.directionalLockEnabled = YES; | |
self.scrollView.showsHorizontalScrollIndicator = NO; | |
self.scrollView.showsVerticalScrollIndicator = NO; | |
self.contentView = [UIView new]; | |
[self.scrollView addSubview:self.contentView]; | |
[self.contentView updateConstraints:^(MASConstraintMaker *make) { | |
make.edges.equalTo(self.scrollView); |
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
// Retrieve user access token someway, get the twitter text and pass the file in req.file | |
var doPublishVideoTweet = function(access_token, text, file) { | |
var stats = fs.statSync(file.path); | |
var formData = { | |
command: 'INIT', | |
media_type: file.mimetype, | |
total_bytes: stats.size | |
}; |
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
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { | |
// Override point for customization after application launch. | |
window = UIWindow(frame: UIScreen.main.bounds) | |
window?.rootViewController = ViewController() | |
window?.makeKeyAndVisible() | |
return true | |
} |
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
enum Service { | |
case version(version: String) | |
} | |
extension Service: TargetType { | |
var baseURL: URL { return API.BaseURL } | |
var path: String { | |
switch self { | |
case .version(_): return "/version" |
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
let moyaProvider = MoyaProvider<Service>() | |
moyaProvider.request(.version(version: "2.2.0")) { result in | |
// Do whatever you want with your data | |
} |
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
struct Version: Codable { | |
let force: Bool | |
let update: Bool | |
} |
OlderNewer