Cocoa is the user interface toolkit used by macOS and iOS applications alike (though on iOS it's called Cocoa Touch). Swift is a programming languages that's often used to write Cocoa applications, usually through the AppKit, UIKit, or SwiftUI frameworks.