This is a step-by-step guide to create React Native app.
You will get an application which has;
- TypeScript
- Linting
- Formatting
- Testing
| package com.imagepicker; | |
| import android.Manifest; | |
| import android.app.Activity; | |
| import android.content.ClipData; | |
| import android.content.ContentResolver; | |
| import android.content.ContentValues; | |
| import android.content.Context; | |
| import android.content.Intent; | |
| import android.content.pm.PackageManager; |
| <?xml version="1.0" encoding="UTF-8"?> | |
| <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
| <plist version="1.0"> | |
| <dict> | |
| <key>downloadables</key> | |
| <array> | |
| <dict> | |
| <key>fileSize</key> | |
| <integer>1171440164</integer> | |
| <key>identifier</key> |
| import Foundation | |
| func dispatch_async_batch(tasks: [() -> ()], limit: Int, completion: (() -> ())?) { | |
| if tasks.count > 0 || completion != nil { | |
| let q = dispatch_queue_create("dispatch_async_batch", DISPATCH_QUEUE_CONCURRENT); | |
| let sema = dispatch_semaphore_create(limit); | |
| dispatch_async(q, { | |
| for task in tasks { | |
| dispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER) |
| import Foundation | |
| func fatalError<T>(@autoclosure message: () -> String = "", file: StaticString = #file, line: UInt = #line) -> T { | |
| fatalError(message(), file: file, line: line) | |
| } | |
| // Demo | |
| protocol ResultType { |
| class API { | |
| let uri = "https://api.com/endpoint" // replace your api endpoint (json) | |
| func getData(completionHandler: ((NSArray!, NSError!) -> Void)!) -> Void { | |
| let url: NSURL = NSURL(string: uri)! | |
| let ses = NSURLSession.sharedSession() | |
| let task = ses.dataTaskWithURL(url, completionHandler: {data, response, error -> Void in | |
| // Use Parse.Cloud.define to define as many cloud functions as you want. | |
| // For example: | |
| Parse.Cloud.define("hello", function (request, response) { | |
| response.success("Hello world!"); | |
| }); | |
| Parse.Cloud.define("userWithEmailExists", function (request, response) { | |
| var email = request.params.email; | |
| if (email != null && email !== "") { | |
| email = email.trim(); |
| class Brew { | |
| var temp: Float = 0.0 | |
| } | |
| class BrewViewModel : NSObject { | |
| var brew = Brew() | |
| dynamic var temp: Float = 0.0 { | |
| didSet { | |
| self.brew.temp = temp | |
| } |
| # | |
| # python drive.py "origin" ["waypoint" ... ] "destination" | |
| # | |
| # i.e. python drive.py "Union Square, San Francisco" "Ferry Building, San Francisco" 'Bay Bridge' SFO | |
| import sys, json, urllib2, md5, os.path, pprint | |
| from math import radians, sin, cos, atan2, pow, sqrt | |
| from urllib import quote_plus | |
| from xml.sax.saxutils import escape | |
| from optparse import OptionParser |
| // | |
| // FallingStuffAnimationVC.m | |
| // UIGravityBehavior | |
| // | |
| // Created by Mark Parth Dabhi on 06/07/2016. | |
| // Copyright (c) 2014 Parth Dabhi. All rights reserved. | |
| // | |
| #import "FallingStuffAnimationVC.h" |