Skip to content

Commit

Permalink
Merge pull request #25 from rckim77/develop
Browse files Browse the repository at this point in the history
Version 2.22.0
  • Loading branch information
rckim77 authored Jul 5, 2020
2 parents 8a22d09 + cb21b71 commit 08c3450
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 55 deletions.
8 changes: 4 additions & 4 deletions Daydream.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -687,7 +687,7 @@
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = "iPhone Developer";
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 7;
CURRENT_PROJECT_VERSION = 8;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
Expand Down Expand Up @@ -749,7 +749,7 @@
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = "iPhone Developer";
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 7;
CURRENT_PROJECT_VERSION = 8;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
Expand Down Expand Up @@ -785,7 +785,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.rckim.Daydream;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "daydream-provisioning-profile-distribution";
PROVISIONING_PROFILE_SPECIFIER = "daydream-prov-profile-distribution-new-mac";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
Expand All @@ -804,7 +804,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.rckim.Daydream;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "daydream-provisioning-profile-distribution";
PROVISIONING_PROFILE_SPECIFIER = "daydream-prov-profile-distribution-new-mac";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
Expand Down
19 changes: 1 addition & 18 deletions Daydream/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="16096" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="16097" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="16087"/>
Expand Down Expand Up @@ -160,29 +160,12 @@
<outlet property="floatingTitleView" destination="6KP-bC-1sz" id="hGq-XA-Ap4"/>
<outlet property="placeCardsTableView" destination="Lg2-04-32b" id="rem-0K-EVa"/>
<outlet property="placeImageView" destination="NX7-bA-oV6" id="dS6-Yy-Ut3"/>
<segue destination="CGg-aC-4y8" kind="presentation" identifier="genericMapSegue" id="G8s-9F-si3"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="hOa-Hv-SgJ" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="1085.5999999999999" y="30.295566502463057"/>
</scene>
<!--Map View Controller-->
<scene sceneID="Wgs-uz-Bis">
<objects>
<viewController id="CGg-aC-4y8" customClass="MapViewController" customModule="Daydream" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="HRt-hV-c7A">
<rect key="frame" x="0.0" y="0.0" width="414" height="842"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<viewLayoutGuide key="safeArea" id="Yii-Ue-V4b"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="1lm-RG-AHt" userLabel="First Responder" sceneMemberID="firstResponder"/>
<tapGestureRecognizer id="FCW-7U-jyB"/>
</objects>
<point key="canvasLocation" x="1909.5999999999999" y="30.295566502463057"/>
</scene>
</scenes>
<resources>
<image name="sunriseJungle" width="2246" height="3644"/>
Expand Down
4 changes: 2 additions & 2 deletions Daydream/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>2.21.0</string>
<string>2.22.0</string>
<key>CFBundleVersion</key>
<string>7</string>
<string>8</string>
<key>LSApplicationQueriesSchemes</key>
<array>
<string>googlechromes</string>
Expand Down
40 changes: 24 additions & 16 deletions Daydream/MapViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ import Combine
// swiftlint:disable type_body_length
final class MapViewController: UIViewController {

var place: Place?
var dynamicMapView: GMSMapView?
var dynamicMarker: GMSMarker?
var currentReviews: [Review]?
var currentReviewIndex = 0
private var place: Place
private var dynamicMapView: GMSMapView?
private var dynamicMarker: GMSMarker?
private var currentReviews: [Review]?
private var currentReviewIndex = 0

// Will automatically sync with system user interface style settings but can be overridden
// when the user taps the dark mode button. Note this must be called once dynamicMapView is set.
Expand Down Expand Up @@ -83,10 +83,14 @@ final class MapViewController: UIViewController {
card.addGestureRecognizer(tapGesture)
return card
}()

override func viewDidLoad() {
super.viewDidLoad()


init?(place: Place?) {
guard let place = place else {
return nil
}
self.place = place
super.init(nibName: nil, bundle: nil)

NotificationCenter.default.addObserver(self,
selector: #selector(stopDisplayingReviews),
name: UIApplication.didEnterBackgroundNotification,
Expand All @@ -95,8 +99,16 @@ final class MapViewController: UIViewController {
selector: #selector(restartDisplayingCurrentReviews),
name: UIApplication.willEnterForegroundNotification,
object: nil)
}

required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}

override func viewDidLoad() {
super.viewDidLoad()

addOrUpdateMapView(for: place?.placeId, name: place?.name, location: place?.coordinate)
addOrUpdateMapView(for: place.placeId, name: place.name, location: place.coordinate)
addProgrammaticViews()
}

Expand Down Expand Up @@ -153,11 +165,7 @@ final class MapViewController: UIViewController {
reviewCard.isHidden = true
}

private func addOrUpdateMapView(for placeId: String?, name: String?, location: CLLocationCoordinate2D?) {
guard let placeId = placeId, let name = name, let location = location else {
return
}

private func addOrUpdateMapView(for placeId: String, name: String, location: CLLocationCoordinate2D) {
let camera = GMSCameraPosition.camera(withLatitude: location.latitude,
longitude: location.longitude,
zoom: 16.0)
Expand Down Expand Up @@ -349,7 +357,7 @@ extension MapViewController: GMSMapViewDelegate {

func mapView(_ mapView: GMSMapView, didTapInfoWindowOf marker: GMSMarker) {
logEvent(contentType: "info window on marker tapped", title)
if let mapUrl = place?.mapUrl, let url = URL(string: mapUrl) {
if let mapUrl = place.mapUrl, let url = URL(string: mapUrl) {
UIApplication.shared.open(url, options: [:])
}
}
Expand Down
21 changes: 8 additions & 13 deletions Daydream/SearchDetailViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -225,17 +225,6 @@ final class SearchDetailViewController: UIViewController {
floatingTitleView.alpha = 0
}

// MARK: - Segue

override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
if let destinationVC = segue.destination as? MapViewController, let sender = sender as? Place {
// segue from Top Sights cell
if segue.identifier == "genericMapSegue" {
destinationVC.place = sender
}
}
}

// MARK: - Button selector methods

@objc
Expand Down Expand Up @@ -394,7 +383,10 @@ extension SearchDetailViewController: GMSAutocompleteResultsViewControllerDelega
extension SearchDetailViewController: SightsCardCellDelegate {
func sightsCardCell(_ cell: SightsCardCell, didSelectPlace place: Place) {
logEvent(contentType: "select point of interest", title)
performSegue(withIdentifier: "genericMapSegue", sender: place)
guard let mapVC = MapViewController(place: place) else {
return
}
present(mapVC, animated: true)
}

func sightsCardCellDidTapBusinessStatusButton(_ businessStatus: PlaceBusinessStatus) {
Expand All @@ -418,7 +410,10 @@ extension SearchDetailViewController: EateriesCardCellDelegate {
openUrl(url)
}
case .google:
performSegue(withIdentifier: "genericMapSegue", sender: eatery)
guard let mapVC = MapViewController(place: eatery as? Place) else {
return
}
present(mapVC, animated: true)
}
}

Expand Down
4 changes: 2 additions & 2 deletions DaydreamUITests/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
<key>CFBundlePackageType</key>
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
<key>CFBundleShortVersionString</key>
<string>2.21.0</string>
<string>2.22.0</string>
<key>CFBundleVersion</key>
<string>7</string>
<string>8</string>
</dict>
</plist>

0 comments on commit 08c3450

Please sign in to comment.