I am a newbie trying to learn how to set collection view programatically
let layout = UICollectionViewFlowLayout()
window?.rootViewController = UINavigationController(rootViewController : HomeController(collectionViewLayout:layout))
I am trying to get above swift code in Objective C. What I have done so far is listed below results in error. What are the changes i have to make in objc code to achieve above.
ViewController *controller = [[ViewController alloc] init]; // @interface ViewController : UICollectionViewController
UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init];
self.window.rootViewController = [[UINavigationController alloc] initWithRootViewController:[controller collectionViewLayout:layout]] ; // ERROR How to set Collection View?