What you need there is a read only computed property:
var stringArray: [String] {
return whiskyArray.map{$0.whiskyName!}
}
More Related Contents:
- Nested Dictionary in my swift application
- Dynamic trim double [closed]
- Swift do-try-catch syntax
- BigInteger equivalent in Swift?
- How to use special character in NSURL?
- What protocol should be adopted by a Type for a generic function to take any number type as an argument in Swift?
- Swift: print() vs println() vs NSLog()
- Deleting list elements from SwiftUI’s List
- How to print double quotes inside “”?
- Implementing copy() in Swift
- Prevent dismissal of UIAlertController
- What sorting algorithm does Swift implement for its standard library?
- Swift – IBOutletCollection equivalent
- How do I detect which SKSpriteNode has been touched
- dispatch_once after the Swift 3 GCD API changes
- Updating the UI Using Dispatch_Async in Swift
- SwiftUI: Forcing an Update
- NSFileManager fileExistsAtPath:isDirectory and swift
- How to use openURL for making a phone call in Swift?
- Get class name of object as string in Swift
- Get terminal output after a command swift
- removeObjectsAtIndexes for Swift arrays
- Getting “file not found” in Bridging Header when importing Objective-C frameworks into Swift project
- Why is ‘nil’ not compatible with ‘UnsafePointer’ in Swift 3?
- AlamoFire asynchronous completionHandler for JSON request
- Can you override between extensions in Swift or not? (Compiler seems confused!)
- Setting the TimelineProvider refresh interval for Widget
- Standard way to “clamp” a number between two values in Swift
- Difference between SceneDelegate and AppDelegate
- How do you enumerate OptionSetType in Swift?