Search code examples
ioscocoa-touchuikit

What is the difference between UIKit and Cocoa Touch?


I am learning Swift and I've been struggling a lot trying to understand how Cocoa Touch and UIKit are different. Just looking at the descriptions of the tags gives me:

- The Cocoa Touch Frameworks that drive iOS apps share many proven patterns found on the Mac, but were built with a special focus on touch-based interfaces and optimization.

- UIKit (not to be confused with the front-end framework GetUIKit) is the object-oriented framework that is responsible for most of the iOS user interface.

Can someone help me figure out how these two are different?


Solution

  • Cocoa Touch is basically just Cocoa with UIKit substituted for AppKit.

    The UIKit framework provides the required infrastructure for your iOS or tvOS apps. It provides the window and views architecture for implementing your interface, the event handling infrastructure for delivering Multi-Touch and other types of input to your app, and the main run loop needed to manage interactions among the user, the system, and your app.

    For more reference check out:

    1. For Cocoa Touch https://developer.apple.com/library/archive/documentation/General/Conceptual/DevPedia-CocoaCore/Cocoa.html
    2. For UIKit https://developer.apple.com/documentation/uikit