AppDelegateを利用すればできると思います。
AppDelegate.swift
1import UIKit
2
3@UIApplicationMain
4class AppDelegate: UIResponder, UIApplicationDelegate {
5 var Value = 0
6...
7}
A.swift
1import UIKit
2
3//Valueの値を変更
4
5class A: UIViewController {
6
7 let app:AppDelegate = UIApplication.shared.delegate as! AppDelegate
8
9override func viewDidLoad() {
10
11 app.Value = 1
12
13...
14}
15...
16}
17
B.swift
1import UIKit
2//Valueの値を参照
3class A: UIViewController {
4
5 let app:AppDelegate = UIApplication.shared.delegate as! AppDelegate
6
7override func viewDidLoad() {
8
9 var i = app.Value
10
11...
12}
13...
14}