Latest 0.0.2
Homepage https://github.com/humberaquino/cammap
License MIT
Platforms ios 11.0
Frameworks UIKit, MapKit
Authors

📷+🗺+⚡️ = CamMap

CamMap is a swift library that helps apps take photos and grab locations at the same time.

Sample screenshot

Features 🚀

  • [x] Capture images as JPEG
  • [x] Use the current location as soon as possible.
  • [x] Floating pin for better selecting the coordinates. Tap to save the location.
  • [x] Drag and drop pin within the map.
  • [x] Store photos in the device. Provide a configurable flag to turn it off.
  • [x] Handle portrait and landscape nicely.

Installation 💻

Using CocoaPods

Add pod 'CamMap' to your Podfile and run pod install. Also add use_frameworks! to the Podfile.

use_frameworks!
pod 'CamMap'

Usage

Import it first:

import CamMap

Then implement the delegate protocol:

extension YouViewController: CamMapDelegate {
    func camMapDidComplete(images: [UIImage], location: CLLocationCoordinate2D?) {
        // This method gets called if the user took at least one pic
    }

    func camMapDidCancel() {
        // Or this gets called if the user cancelled the action
    }

    func camMapHadFailure(error: CamMapError) {
        // Is called when there's a non recoverall issue with the camera or location maanger
    }

    func camMapPermissionFailure(type: PermType, details: String) {
        // Gets call if there is a missing permission
    }
}

And within a method from YouViewController present the view controller:

let vc = CamMapViewController()
vc.delegate = self
present(vc, animated: true, completion: nil)

Permissions

You need to add the following elements to your Info.plist file, oherwise the app will crash with a related message.

  • NSLocationWhenInUseUsageDescription
  • NSCameraUsageDescription
  • NSPhotoLibraryAddUsageDescription

Code sample

You can find a simple example within this repo. To try it please clone it and then execute:

cd Examples/SimpleCamMapExample/
pod install
open SimpleCamMapExample.xcworkspace

Roadmap 🏁

  • [x] Better action buttons
  • [x] Indicate how many photos were taken
  • [ ] Be able to cancel/close the controller after one photo got in
  • [ ] Customizable map and camera sizes
  • [ ] Be able to delete selected photos
  • [ ] Better permission handling

Author

Humber Aquino [email protected] @goku2

License

CamMap is released under the MIT license.
See LICENSE for details.

Latest podspec

{
    "name": "CamMap",
    "version": "0.0.2",
    "summary": "Take photos and grab location fast",
    "description": "CamMap aims at taking photos with location fast.",
    "homepage": "https://github.com/humberaquino/cammap",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Humberto Aquino": "[email protected]"
    },
    "social_media_url": "http://twitter.com/goku2",
    "platforms": {
        "ios": "11.0"
    },
    "source": {
        "git": "https://github.com/humberaquino/cammap.git",
        "tag": "0.0.2"
    },
    "source_files": "CamMap/**/*.{swift}",
    "swift_version": "4.2",
    "resources": "CamMap/Media.xcassets",
    "ios": {
        "resource_bundles": {
            "CamMap": "CamMap/**/*.xcassets"
        }
    },
    "frameworks": [
        "UIKit",
        "MapKit"
    ]
}

Pin It on Pinterest

Share This