Created
          November 7, 2016 09:22 
        
      - 
      
 - 
        
Save benoitjadinon/186a89192b01d8e1c3da36e38e022099 to your computer and use it in GitHub Desktop.  
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | public static class UIStoryboardExtensions | |
| { | |
| // Storyboard.InstantiateViewController<LoginController>() | |
| // instead of : | |
| // Storyboard.InstantiateViewController(nameof(LoginController)) as LoginController | |
| // instead of : | |
| // Storyboard.InstantiateViewController("LoginController") as LoginController | |
| public static T InstantiateViewController<T>(this UIStoryboard @this) | |
| where T : UIViewController | |
| { | |
| return (T)@this.InstantiateViewController(typeof(T).Name); | |
| } | |
| } | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment