Skip to content
This repository has been archived by the owner on Jun 7, 2020. It is now read-only.

[NEW] Share user location #2598

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

luismachado
Copy link
Contributor

@RocketChat/ios

So, the feature I've talked about previously.

It mirrors Whatsapp functionality and includes:

  • View Controller to select and share a location (based or not on user's location)
  • Address fetching
  • Custom cell to show the shared location
  • View controller to see the shared location, with distance and time calculations as well options to open apple maps / google maps / waze.

Closes #2331

@CLAassistant
Copy link

CLAassistant commented Mar 21, 2019

CLA assistant check
All committers have signed the CLA.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission, we really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

// Set the region of the map that is rendered.
mapSnapshotOptions.region = region

// Set the scale of the image. We'll just use the scale of the current device, which is 2x scale on Retina screens.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line Length Violation: Line should be 120 characters or less: currently 123 characters (line_length)

let coordinatesText = self.replacingOccurrences(of: "https://maps.google.com/?q=", with: "")

let splitCoordinates = coordinatesText.split(separator: ",")
if splitCoordinates.count == 2, let latitude = Double(splitCoordinates[0]), let longitude = Double(splitCoordinates[1]) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line Length Violation: Line should be 120 characters or less: currently 129 characters (line_length)

return
}

delegate?.openURLFromCell(url: locationChatItemItem.url, username: locationChatItemItem.message?.user?.username ?? "")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line Length Violation: Line should be 120 characters or less: currently 126 characters (line_length)

func adaptivePresentationStyle(for controller: UIPresentationController) -> UIModalPresentationStyle {
return .none
}
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

File Line Length Violation: File should contain 400 lines or less: currently contains 447 (file_length)

}
}

func mapView(_ mapView: MKMapView, annotationView view: MKAnnotationView, calloutAccessoryControlTapped control: UIControl) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line Length Violation: Line should be 120 characters or less: currently 129 characters (line_length)

subtitleLabel.text = subtitle
subtitleLabel.sizeToFit()

let titleView = UIView(frame: CGRect(x: 0, y: 0, width: max(titleLabel.frame.size.width, subtitleLabel.frame.size.width), height: 30))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line Length Violation: Line should be 120 characters or less: currently 142 characters (line_length)

headerAddress = addressComponentsListWOCountry
}

callback(Address(shortAddress: shortAddress, placeName: placeName, completeAddress: completeAddress, headerAddress: headerAddress))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line Length Violation: Line should be 120 characters or less: currently 143 characters (line_length)


extension CLLocationCoordinate2D {

func getLocationName(callback: @escaping (_ address: Address) -> Void) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cyclomatic Complexity Violation: Function should have complexity 10 or less: currently complexity equals 16 (cyclomatic_complexity)
Function Body Length Violation: Function body should span 40 lines or less excluding comments and whitespace: currently spans 59 lines (function_body_length)

popover.popoverPresentationController?.delegate = self
popover.popoverPresentationController?.sourceView = view
popover.popoverPresentationController?.sourceRect = view.bounds
popover.popoverPresentationController?.backgroundColor = UIColor(red: 240/255, green: 240/255, blue: 240/255, alpha: 0.85)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line Length Violation: Line should be 120 characters or less: currently 130 characters (line_length)

mapView.deselectAnnotation(view.annotation, animated: false)

let storyboard = UIStoryboard(name: "Location", bundle: nil)
guard let popover = storyboard.instantiateViewController(withIdentifier: "locationPopover") as? LocationPopover else { return }

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line Length Violation: Line should be 120 characters or less: currently 135 characters (line_length)

@rafaelks rafaelks changed the title Feature/share user location [NEW] Share user location Apr 1, 2019
@rafaelks rafaelks self-requested a review April 2, 2019 12:19
@rafaelks rafaelks self-assigned this Apr 2, 2019
@rafaelks rafaelks removed their assignment Aug 1, 2019
@lbblitz54
Copy link

@luismachado so did this hit a dead end.
or did everyone just get busy on other things

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[NEW] Share Current Location
5 participants