Alamofire with header.

let Auth_header = [ "Authorization" : token ]

Alamofire.Manager.sharedInstance.request(.PUT, "url", headers: Auth_header, parameters: parameters)

animation tabbar item

pod 'RAMAnimatedTabBarController'

Create a new UITabBarController in your storyboard or nib.

Set the class of the UITabBarController to RAMAnimatedTabBarController in your Storyboard or nib.

For each UITabBarItem, set the class to RAMAnimatedTabBarItem.

Add a custom image icon for each RAMAnimatedTabBarItem

Add animation for each RAMAnimatedTabBarItem :

remove pod

pod deintegrate
pod install

Manage ViewController

// Push new view controller change with Swift2.2
let vc = self.storyboard?.instantiateViewControllerWithIdentifier("ViewController2") as! ViewController2;
let app = UIApplication.sharedApplication().delegate as! AppDelegate
app.manage?.setObject(vc, forKey: "view2")

self.presentViewController(vc, animated: true, completion: nil)

WebserviceManager

class WebserviceManager: NSObject {

custom action sign in google

GIDSignIn.sharedInstance().signIn()

append new item to an array of a class

struct MyClass {
var x : String = ""
}

var MyDatabase : [MyClass] = []
var Item = MyClass()

for (var i = 0 ; i < 5 ; i++){
Item.x = "\(i)"
MyDatabase.append(Item)
print(MyDatabase.first!.x) // 0 0 0 0 0
}

tabar cover tablecell

lazy image

LazyImage.showForImageView((cell?.itemsImage)!, url:items[indexPath.row].memory!) {
() in
//Lazy loading complete. Do something..
}

check image

func imageIsNullOrNot(imageName : UIImage)-> Bool
{

let size = CGSize(width: 0, height: 0)
if (imageName.size.width == size.width)
{
return false
}
else
{
return true
}
}

if (imageIsNullOrNot(selectedImage))
{
//image is not null
}
else
{
//image is null
}

Pages

Subscribe to Trần Mạnh Hoàng RSS