Pass data from UITableViewCell to UIViewController

http://stackoverflow.com/questions/9005052/recipes-to-pass-data-from-uitableviewcell-to-uitableviewcontroller Solution: Use custom delegate UIViewController MyViewController.h

MyViewController.m

Custom table cell and Protocol MyTableViewCell.h

MyTableViewCell.m

azure permissions

When you are in Active Directory, it will tell you what kind of Role you have: Global admin Billing admin Service admin User … … I have found that apps created by Global admin can access the GRAPH API. For example, a user from the Tenant’s Active Directory signs in, and then hits the Graph […]

VIPER Part 1 – Dependencies, Root Wireframe, AppDelegate, ViewController

demo for xCode 7.3 This tutorial shows how to hook up an AppDelegate, Dependencies object, a Root wireframe, and a standalone ViewController in a VIPER design pattern. AppDelegate.h

Standard AppDelegate with the window property. AppDelegate.m

AppDelegate allocates a Dependencies object. That dependencies object will then install a RootViewController onto the Window object. Dependencies […]

Using protocols to have components talk to each other in iOS Design Pattern

https://www.objc.io/issues/13-architecture/viper/ Protocol is a one to one relationship where a receiving object implements a delegate protocol. A sending object uses it and sends messages (assuming that those methods are implemented) since the receiver promised to comply to the protocol. First, the Interactor protocol! The interactor is the middle man between data and the presenter. It […]

Interview Exercise – Earliest Index of array, where the subarray contains all unique elements of the array

Time: 2 hours Try to solve the following exercise in O(n) worst-case time complexity and O(n) worst-case space complexity – giving a more complex solution is also acceptable, but not so valuable. Also, try not to rely on library functions, unless they don’t increase complexity. Please test your solution – correctness is important. You get […]

AVL tree

ref – https://github.com/redmacdev1988/avl-binary-tree height and balance The height of a node is the maximum number of vertices from itself to a leaf. Thus, a leaf has a height of 0. If the leaf has a parent node, the parent node’s height would be 1. The balance factor of a node is the height of the […]

Binary Search Tree

http://code.runnable.com/VUTjJDME6nRv_HOe/delete-node-from-bst-for-c%2B%2B demo download xCode 7.3 (c++) Adding to Tree Concept Traverse until you hit a leaf. Then, Re-point at the leaf