Skip to content

Commit

Permalink
Finished
Browse files Browse the repository at this point in the history
  • Loading branch information
max.bause committed Jan 25, 2018
1 parent 7bd5f62 commit b382b4d
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 18 deletions.
8 changes: 4 additions & 4 deletions SuperVarioWohnen.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -470,10 +470,10 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = GSS77QYM85;
DEVELOPMENT_TEAM = 6EV2E58M9V;
INFOPLIST_FILE = SuperVarioWohnen/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = de.tobias.SuperVarioWohnen;
PRODUCT_BUNDLE_IDENTIFIER = de.tobias.SuperVarioWohnen4;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 4.0;
TARGETED_DEVICE_FAMILY = 1;
Expand All @@ -485,10 +485,10 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = GSS77QYM85;
DEVELOPMENT_TEAM = 6EV2E58M9V;
INFOPLIST_FILE = SuperVarioWohnen/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = de.tobias.SuperVarioWohnen;
PRODUCT_BUNDLE_IDENTIFIER = de.tobias.SuperVarioWohnen4;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 4.0;
TARGETED_DEVICE_FAMILY = 1;
Expand Down
8 changes: 4 additions & 4 deletions SuperVarioWohnen/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13196" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="RfQ-0b-ZBo">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13771" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="RfQ-0b-ZBo">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13173"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13772"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
Expand Down Expand Up @@ -37,11 +37,11 @@
<rect key="contentStretch" x="0.0" y="0.0" width="0.0" height="0.0"/>
</mapView>
<view hidden="YES" alpha="0.59999999999999998" contentMode="scaleToFill" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="y7h-EQ-5Mp" colorLabel="IBBuiltInLabel-Blue">
<rect key="frame" x="0.0" y="516" width="375" height="58"/>
<rect key="frame" x="0.0" y="502" width="375" height="72"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="Label" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="mYM-Mi-OG1">
<rect key="frame" x="69" y="19" width="237" height="21"/>
<rect key="frame" x="0.0" y="19" width="375" height="21"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
Expand Down
8 changes: 4 additions & 4 deletions SuperVarioWohnen/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
<string>Test</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>Test</string>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
Expand All @@ -39,9 +43,5 @@
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
<string>Test</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>Test</string>
</dict>
</plist>
39 changes: 33 additions & 6 deletions SuperVarioWohnen/Map.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class Map: UIViewController, CLLocationManagerDelegate,UISearchBarDelegate,MKMap
mapView.delegate=self
initTableView()
initGesture()

initPopupView()
searchBar.showsCancelButton=true
searchCompleter.delegate = self
searchBar.delegate = self
Expand Down Expand Up @@ -69,9 +69,25 @@ class Map: UIViewController, CLLocationManagerDelegate,UISearchBarDelegate,MKMap
tableView.register(UITableViewCell.self, forCellReuseIdentifier: "MyCell")
tableView.dataSource = self
tableView.delegate = self


}


func initPopupView(){
let screen = UIScreen.main
let height = screen.bounds.size.height
let width = screen.bounds.size.width
popupView.frame.size.height = popupView.frame.size.height-13
let popupHeight = popupView.frame.size.height
popupView.frame.size.width = width

let tabHeight = tabBarController?.tabBar.frame.size.height

let y = height-(popupHeight+tabHeight!)
popupView.frame.origin.y=y

timeRoute.frame.size.width=width
}



Expand Down Expand Up @@ -103,7 +119,12 @@ class Map: UIViewController, CLLocationManagerDelegate,UISearchBarDelegate,MKMap
annotation.title = "Auswahl"
mapView.addAnnotation(annotation)
pointAnnotation=annotation
routeShow()
if(myLocation != nil){
routeShow()
}
else{
print("Kein Standort")
}
}

@objc func shortTap(sender: UITapGestureRecognizer) {
Expand Down Expand Up @@ -156,7 +177,7 @@ class Map: UIViewController, CLLocationManagerDelegate,UISearchBarDelegate,MKMap
else{
searchMode=true
searchBar.placeholder="Suchen..."
popupView.removeFromSuperview()
popupView.isHidden=true
}
if(searchBar.text != ""){
searching()
Expand Down Expand Up @@ -199,6 +220,7 @@ class Map: UIViewController, CLLocationManagerDelegate,UISearchBarDelegate,MKMap


func searching(){
self.searchBar.endEditing(true)
tableView.removeFromSuperview()
let request = MKLocalSearchRequest()
request.naturalLanguageQuery = searchBar.text
Expand All @@ -211,8 +233,14 @@ class Map: UIViewController, CLLocationManagerDelegate,UISearchBarDelegate,MKMap
if(self.searchMode){
self.mapView.setRegion(MKCoordinateRegionMake(self.pointAnnotation.coordinate, MKCoordinateSpanMake(0.2,0.2)), animated: true)
}

else{
self.routeShow()
if(self.myLocation != nil){
self.routeShow()
}
else{
print("Kein Standort")
}
}
}
}
Expand Down Expand Up @@ -272,7 +300,6 @@ class Map: UIViewController, CLLocationManagerDelegate,UISearchBarDelegate,MKMap

for route in response!.routes {
self.mapView.add(route.polyline, level: MKOverlayLevel.aboveRoads)

self.dist=route.distance
self.time=route.expectedTravelTime
self.showTime()
Expand Down

0 comments on commit b382b4d

Please sign in to comment.