in Technology by
Explain the difference between Swift vs Objective-C.?

1 Answer

0 votes
by

Enlisted below are the various differences between Swift vs Objective-C.

  1. Swift is an object-oriented and functional programing language, whereas Objective-C is a class-based object-oriented programing language.
  2. Swift supports dynamic libraries, whereas Objective-C does not support dynamic libraries.
  3. Swift supports Tuples, whereas Objective-C does not support Tuples.
  4. Semicolons are not required in Swift, whereas semicolons are required in Objective-C.
  5. Swift is an open-source programing language, whereas Objective-C is limited to Apple, and it’s not an open-source language.
  6. We have to use the “let” keyword to declare for constant and “var” keyword to declare for a variable, whereas in objective C, we have to declare the variable as “NSString” and constant as “int”.
  7. Swift enables us to define methods in structure, classes or enumeration, whereas Objective C does not allow this.
  8. In swift, we can define classes in a single file (.swift), whereas in Objective C we create separate interface (.h) files for classes and implementation (.m) files for classes.

Related questions

0 votes
    Can we use both swift (.swft) and objective c (.h .m) in same xcode project ?...
asked Mar 9, 2021 in Technology by JackTerrance
0 votes
    How do I call Objective-C code from Swift?...
asked Mar 9, 2021 in Technology by JackTerrance
0 votes
    What is the difference between #import and #include in Objective-C?...
asked Nov 10, 2020 in Technology by JackTerrance
0 votes
    Explain the difference between Endpoint Security vs. Network Security?...
asked Oct 24, 2020 in Technology by JackTerrance
0 votes
    Explain the difference between Smoke Test Vs Build Acceptance Testing?...
asked Oct 17, 2020 in Technology by JackTerrance
0 votes
    Explain the difference between Sanity Testing Vs Regression Testing?...
asked Oct 17, 2020 in Technology by JackTerrance
0 votes
    What is the difference between Let and Var in swift?...
asked Nov 30, 2020 in Technology by JackTerrance
0 votes
    Can we create Dynamic Classes in Objective C? If Yes, Explain how to create with a valid use case?...
asked Nov 10, 2020 in Technology by JackTerrance
0 votes
    Is Objective C, a dynamic language? True/False, explain....
asked Nov 10, 2020 in Technology by JackTerrance
0 votes
    Explain what is dot notation in Objective-C?...
asked Nov 10, 2020 in Technology by JackTerrance
0 votes
    Explain how to call function in Objective-C....
asked Nov 10, 2020 in Technology by JackTerrance
0 votes
    Explain what is @synthesize in Objective-C?...
asked Nov 10, 2020 in Technology by JackTerrance
0 votes
    Explain when to use NSArray and NSMutableArray. Which one is faster and threadsafe in Objective-C?...
asked Nov 10, 2020 in Technology by JackTerrance
0 votes
    Explain types of protocol in Objective C?...
asked Nov 10, 2020 in Technology by JackTerrance
0 votes
    Explain what is protocol in Objective-C?...
asked Nov 10, 2020 in Technology by JackTerrance
...