Queue implementation in swift

public struct Queue<T>{     private var array:[T]     public init(){         array = []     }     //MARK: isEmpty     public var isEmpty:Bool{         return array.count == 0     }     //MARK: count     public var count:Int{        ... Continue Reading →


Common method in Swift

1. Check for any field empty in NSDictionary class func checkforEmptyValueinDictioanty(dic:NSDictionary)-> Bool{ for (keyVal, dataVal) in dic {   if (dataVal.length()==0){                 println("\(keyVal): \(dataVal.length())")                 return false             }                 ... Continue Reading →

MultiThreading in iOS

Blocks are important in iOS programming because they are used to implement multithreading with GCD (Grand Central Dispatch).  A block is a chunk of code contained in {}.  To indicate the beginning of a block use a caret (^). Here is a block that prints a string. ^{ NSString *name = "Batman"; NSLog(@"My name is %@", name);... Continue Reading →

Blog at WordPress.com.

Up ↑

%d bloggers like this: