MapKitDragAndDrop 3

Update
Version 3.2 with new sample for iOS 4.2 is available here.


With iOS 4 MapKit built-in draggable support, MapKitDragAndDrop now goes to version 3.

MapKitDragAndDrop is designed to bring drag and drop support to MapKit on iPhone platform, with just one single lightweight DDAnnotation and DDAnnotationView, users are able to drag and drop annotation pin and get the new coordinate.

For real world example, you can check out my app: QR+Emoji

QR+Emoji Screenshot

In version 3, the whole project had shifted to modern runtime, using Objective-C 2.0 ABI and LLVM 1.5 compiler. So you will have smaller and faster binary that runs on both iOS 4 and ealier iPhone OS 3.1.x/3.2 at the same time.

Features

  • Support both iPhone OS 3.1.x, 3.2 and iOS 4 at the same time, in the same source code.
  • Use iOS 4 MapKit built-in draggable support (Yes, you get Retina Display high resolution support for free!)
  • Use legacy MapKit techniques to create draggable annotations on iPhone OS 3.1.x and 3.2.
  • Use Core Animation to create pin effects you saw in built-in Maps.app on iPhone OS 3.1.x and 3.2.
  • Use modern runtime, Objective-C 2.0 ABI, and LLVM 1.5 compiler.

Requirements

  • Xcode 3.2.3 with iOS 4 SDK or Xcode 4 Preview.
  • Project file (.xcodeproj) needs to:

    1. C/C++ Compiler Version (GCC_VERSION) set to “LLVM compiler 1.5”
    2. Other C Flags (OTHER_CFLAGS) should add “-Xclang -fobjc-nonfragile-abi2” flag
    3. Base SDK (SDKROOT) should be “iPhone Device 4.0”
    4. Deployment Target (IPHONEOS_DEPLOYMENT_TARGET) can be “iPhone OS 3.1” if you want.

Note

-Xclang here means “pass argument to the clang compiler,” and the argument is -fobjc-nonfragile-abi2. So you should add ‘-Xclang -fobjc-nonfragile-abi2' into $OTHER_CFLAGS.

For more details, check “-Xclang -fobjc-nonfragile-abi2” is single flag with one argument.

Screenshot

License

Source code is licensed under MIT license.
You can download it from github.

References

  1. digdog posted this