Let's say I have the following in a file:
import SwiftUI
struct MobyDickView: View {
var body: some View {
Text(mobyDick)
}
}
private let mobyDick: String = """
Call me Ishmael. Some years ago--never mind how long precisely[...]
"""
Does mobyDick
ever get released from memory if, for example, MobyDickView
isn't being used otherwise? Does this change if the string is instead:
private extension String {
static let mobyDick: String = """
[...]
"""
}
or
private extension String {
static var mobyDick: String {
"""
[...]
"""
}
}
or
private var mobyDick: String {
"""
Call me Ishmael. Some years ago--never mind how long precisely[...]
"""
}
?