Question: I am trying to parse/organize a list of strings line by line from a text file into an array that is in Ruby. I hope I explained that right.

example.txt

```
exampleuser:examplepassword
myusername:mypassword
askfjwaeir:dcqw38974q238ifj

```

How I want to store example.txt in Ruby - 

```
$username = [ "exampleuser",
      "myusername",
      "askfjwaeir"
]

$password = [ "examplepassword",
      "mypassword",
      "dcqw38974q238ifj"

```

I've been searching for a couple hours but can't seem to find anything to what I'm looking for. I know about .strip, .split, cutting off from the semicolon, but I cannot seem to do what I described here.

Answer: 
You can use extension of `UIViewController` 

```
extension UIViewController
{
   // write code that has to be used in all view controllers
   func applyTheRequiredPropertiesToGestureRecognizer(gr:UIGestureRecognizer)
   {
      // do whatever you want to do
   }
}

```

Later while using

```
class SomeViewController:UIViewController{

   let gestureRecog = UIGestureRecognizer()

   //call the method 
   func someMethod()
   {
     self.applyTheRequiredPropertiesToGestureRecognizer(gestureRecog)
   }
}

```
Make a baseviewController and do all the functions which are generic or used at most of the view controllers like an alert.

```
class BaseViewController: UIViewController {
 func yourGestureRecogniser() {
  // do the process
 }
}

```

Then inherit the base view to other view controllers like this,

```
class ViewController1: BaseViewController {
 override func viewDidLoad() {
    super.viewDidLoad()
    yourGestureRecogniser()
 } 
}

class ViewController2: BaseViewController {
 override func viewDidLoad() {
    super.viewDidLoad()
    yourGestureRecogniser()
 } 
}

```

customize the gesture function as per your needs.