let fir = UserDefaults.init(suiteName: "ViewController")
fir?.set("1", forKey: "test")
let sec = UserDefaults.init(suiteName: "ViewController")
print(sec?.value(forKey: "test"))
Optional(1)
sec?.set("2", forKey: "test")
print(fir?.value(forKey: "test"))
Optional(2)
结论:Userdefaults suiteName一致时,数据统一存储