introduce

The premise of componentization is to have basic component, function component and business component. The basic components and functional components can be made into SDK, which can be selectively called by other apps.

For example, the map component is packaged into a separate SDK. If you need to use the map, load this SDK. If you don’t need to use the map, don’t load it. As with wrapping everything into a common library, this can both decouple and reduce package size.

Map module integrated Framework

In business, many apps use THE SDK of Amap. This module is a functional component. The following is to package all AmAP into an SDK for other apps

The new Framework

Naming Framework

Example Change the minimum supported version

Import the AMap SDK

Add dependency libraries (dependency libraries required by Amap)

Unified import to gDSdK. h

New tViewController.swift to adapt swift project import (SDK cannot be imported by SWIFT project if no SWIFT file exists)

Declare the MAMapView variable in TViewController to solve the Could not find auto-Linked Framework problem

Compile through, map module SDK integration is completed, the use of GDSDK in the project is introduced below.

The SDK integration

Create a new project DituDemo

Drag in our packaged GDSDK

Import the binary GDSDK

Import GDSDK in ViewController, and declare traversal mapView, compile through. At this point, the map component is completed, and other projects can import this SDK to develop map business functions.

Pay attention to

  • Make sure to add the TViewController file and declare the MAMapView variables when you finish GDSDK. So the SDK will have auto Link Framework

  • Remember to add the dependency library required by The AUtonavi SDK. If the SDK needs to be updated, remember to update the dependency library in time

  • Code reference GDSDK