I have a struct and I would like to know if I can access variables using bracket syntax. Here is my struct:
import UIKit
public struct Pixel {
public var v
What you're describing is not a Swift feature, unless you use subscripting (as vadian has explained). If you want something that supplies subscripting automatically, use a dictionary. Otherwise, if you really want true introspection, use Cocoa — use a class derived from NSObject instead of a struct, and employ key-value coding.