Skip to content

Instantly share code, notes, and snippets.

@jerrypm
Last active October 11, 2018 03:35
Show Gist options
  • Select an option

  • Save jerrypm/64ba6dcbc63b9f2138ddf1b59a09fd03 to your computer and use it in GitHub Desktop.

Select an option

Save jerrypm/64ba6dcbc63b9f2138ddf1b59a09fd03 to your computer and use it in GitHub Desktop.
//JeriPM
// How to select an element of array Swift
import UIKit
class ExampleViewController: UIViewController {
var exArray = ["one", "two", "three"]
override func viewDidLoad() {
super.viewDidLoad()
print(exArray[0]) // result -> one
print(exArray[1]) // result -> two
print(exArray[2]) // result -> three
}
}
@jerrypm
Copy link
Copy Markdown
Author

jerrypm commented Oct 11, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment