Skip to content

Instantly share code, notes, and snippets.

View TechMaster's full-sized avatar

Trinh Minh Cuong TechMaster

View GitHub Profile
@TechMaster
TechMaster / viewcontroller.swift
Created July 3, 2017 08:29
UIViewController life cycle
import UIKit
class ViewController: UIViewController {
override func loadView() {
print("loadView")
}
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
@TechMaster
TechMaster / ShowAlertView.swift
Created June 30, 2017 05:20
ShowAlertView.swift
//
// ViewController.swift
// DisplayAlert
//
// Created by cuong on 6/30/17.
// Copyright © 2017 Techmaster. All rights reserved.
//
import UIKit
@TechMaster
TechMaster / swift
Created May 22, 2017 08:44
Animation.swift
import UIKit
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
self.addBar()
}
func addBar() {
@TechMaster
TechMaster / recursive_block.m
Last active May 1, 2017 12:05
Recursive Block Call
-(void) printString: (NSString*) msg
onComplete: (void (^)(void)) complete{
NSLog(@"%@", msg);
complete();
}
-(void) demoRecursiveBlock
{
__block int index = 0;
NSArray* array = @[@"ABC", @"DEF", @"MNP"];
@TechMaster
TechMaster / functiondemo.js
Last active February 8, 2017 08:26
Demo define and call function
/**
* Created by techmaster on 2/8/17.
*/
/***
* Calculate factorial of n
* @param n {Number} n must be integer and greater than zero
*/
function factorial(n) {
if (isNaN(n)) {