I also noticed the concepts being interchangingly used. It seems in Swift they mostly coincide for structures, classes. For protocols they may differ. Your example above is correct. The initialization with a value seems to define it. Not sure if an assignment later on is a definition. Question remains if one can speak about namedVariable being defined on line 3? Put differently is the declaration part of the definition?
var namedVariable: Int
var namedVariable2: Int
namedVariable = 2
Structures, classes are a different story. Objective-C had a .h file and a .m file. .h contained the header and would coincide with the interface in Swift: the properties (and type) plus the methods (and ingoing and outgoing parameters). It declared the structure or class. .m implemented the properties and also the getters and setters declared in the .h file. The declared properties and methods were defined. Not sure if the declaration + implementation was the definition or only the .m implementation file. I guess the latter. In Swift the structure or class definition no longer has 2 separate files so the declaration file disappeared. If you create the interface it 'd have been the .h file though. In Swift declaration and definition became one as thus as far as structures and classes is concerned.
In Swift the distinction becomes clear when we're talking protocols. If the protocol does not implement itself the implementation is left to the classes or structures conforming to it. The conforming class knows a function is present/was declared but must still implement/define it. Protocol members were also only declared in the protocol.
I have the impression in all former examples the implementation or initialization is the definition. This also could mean that the declaration need not be part of the definition. In swift however it often is. Somehow designing Swift they decided to place declaration central. Something is declared. In most cases the declaration will hold its implementation or initialization. For variables/constants that be the initialization. Structures, classes the declaration holds the implementation consequently we often read 'the class definition.' Protocol members however are declared but not defined.
The documentation blends the terminology and had better clearly outlined what both meant. '
A declaration introduces a new name or construct into your program. For example, you use declarations to introduce functions and methods, variables and constants, and to define new, named enumeration, structure, class, and protocol types. You can also use a declaration to extend the behavior of an existing named type and to import symbols into your program that are declared elsewhere.
In Swift, most declarations are also definitions in the sense that they are implemented or initialized at the same time they are declared. That said, because protocols don’t implement their members, most protocol members are declarations only. For convenience and because the distinction isn’t that important in Swift, the term declaration covers both declarations and definitions.'