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 | |
import GoogleMobileAds | |
class ViewController: UIViewController { | |
@IBOutlet weak var bannerView: GADBannerView! | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
// Do any additional setup after loading the view, typically from a nib. |
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
// Between import and class | |
struct Constants { | |
static var stringVar = "foo" | |
static var intVar = 34 | |
} | |
// Call it like: | |
Constants.stringVar = "bar" |
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 alert = UIAlertController(title: "Error", message: "Please, fill the Form", preferredStyle: .alert) | |
alert.addAction(UIAlertAction(title: "Ok", style: .default)) | |
self.present(alert, animated: true, completion: nil) |
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 stringOriginal = "http://www.google.de/json?origin with space" | |
let stringUrlEnc = stringOriginal.addingPercentEncoding(withAllowedCharacters: .urlHostAllowed) |
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
dismiss(animated: true, completion: nil) |
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
// inside the Class outside function | |
let userSettings = UserDefaults.standard | |
// Setter | |
userSettings.set("foo", forKey: "foobar") | |
// Getter | |
let foo = userSettings.string(forKey: "foobar") |
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 { Alert } from 'react-native'; | |
Alert.alert( | |
'Route', | |
'clicked!', | |
[{ text: 'OK', onPress: () => console.log('OK Pressed') }], | |
{ cancelable: false } | |
); |
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
watchman watch-del-all && yarn upgrade && yarn cache clean && npm start --reset-cache |
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
apm install atom-beautify autoclose-html highlight-selected language-babel linter linter-eslint minimap minimap-highlight-selected pigments seti-ui monokai-seti | |
Atom-beautify: Ctrl+Alt+B | |
Minimap: Absolute Mode: True | |
Seti UI: Compact Mode: 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
let urlStore = 'iTunes Link'; | |
if (Platform.OS === 'android') { | |
urlStore = 'Google Play Link'; | |
} | |
Alert.alert( | |
'Appstore / Google Play', | |
'Linking to Store', | |
[{ | |
text: 'OK', | |
onPress: () => Linking |