Skip to content

Commit

Permalink
Display a map
Browse files Browse the repository at this point in the history
User location is not shown because app doesn’t ask
for permission.
  • Loading branch information
Christoph Siedentop committed Jun 30, 2014
1 parent c232564 commit 2191aab
Show file tree
Hide file tree
Showing 6 changed files with 176 additions and 16 deletions.
15 changes: 15 additions & 0 deletions RowingTracker2.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
83FDBB1C1961ED9A00C9A0D2 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 83FDBB1A1961ED9A00C9A0D2 /* Main.storyboard */; };
83FDBB1E1961ED9A00C9A0D2 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 83FDBB1D1961ED9A00C9A0D2 /* Images.xcassets */; };
83FDBB2A1961ED9A00C9A0D2 /* RowingTracker2Tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83FDBB291961ED9A00C9A0D2 /* RowingTracker2Tests.swift */; };
83FDBB341961EDCA00C9A0D2 /* MapKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 83FDBB331961EDCA00C9A0D2 /* MapKit.framework */; };
83FDBB361961EDDF00C9A0D2 /* CoreLocation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 83FDBB351961EDDF00C9A0D2 /* CoreLocation.framework */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand All @@ -36,13 +38,17 @@
83FDBB231961ED9A00C9A0D2 /* RowingTracker2Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RowingTracker2Tests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
83FDBB281961ED9A00C9A0D2 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
83FDBB291961ED9A00C9A0D2 /* RowingTracker2Tests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RowingTracker2Tests.swift; sourceTree = "<group>"; };
83FDBB331961EDCA00C9A0D2 /* MapKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MapKit.framework; path = System/Library/Frameworks/MapKit.framework; sourceTree = SDKROOT; };
83FDBB351961EDDF00C9A0D2 /* CoreLocation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreLocation.framework; path = System/Library/Frameworks/CoreLocation.framework; sourceTree = SDKROOT; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
83FDBB0B1961ED9900C9A0D2 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
83FDBB361961EDDF00C9A0D2 /* CoreLocation.framework in Frameworks */,
83FDBB341961EDCA00C9A0D2 /* MapKit.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -59,6 +65,8 @@
83FDBB051961ED9900C9A0D2 = {
isa = PBXGroup;
children = (
83FDBB351961EDDF00C9A0D2 /* CoreLocation.framework */,
83FDBB331961EDCA00C9A0D2 /* MapKit.framework */,
83FDBB101961ED9900C9A0D2 /* RowingTracker2 */,
83FDBB261961ED9A00C9A0D2 /* RowingTracker2Tests */,
83FDBB0F1961ED9900C9A0D2 /* Products */,
Expand Down Expand Up @@ -161,6 +169,7 @@
TargetAttributes = {
83FDBB0D1961ED9900C9A0D2 = {
CreatedOnToolsVersion = 6.0;
DevelopmentTeam = 9K3DT7FM4R;
};
83FDBB221961ED9A00C9A0D2 = {
CreatedOnToolsVersion = 6.0;
Expand Down Expand Up @@ -331,9 +340,12 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
CODE_SIGN_IDENTITY = "iPhone Developer";
INFOPLIST_FILE = RowingTracker2/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 7.1;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_NAME = "$(TARGET_NAME)";
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
Expand All @@ -342,9 +354,12 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
CODE_SIGN_IDENTITY = "iPhone Developer";
INFOPLIST_FILE = RowingTracker2/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 7.1;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_NAME = "$(TARGET_NAME)";
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
};
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0600"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "83FDBB0D1961ED9900C9A0D2"
BuildableName = "RowingTracker2.app"
BlueprintName = "RowingTracker2"
ReferencedContainer = "container:RowingTracker2.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "83FDBB221961ED9A00C9A0D2"
BuildableName = "RowingTracker2Tests.xctest"
BlueprintName = "RowingTracker2Tests"
ReferencedContainer = "container:RowingTracker2.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "83FDBB0D1961ED9900C9A0D2"
BuildableName = "RowingTracker2.app"
BlueprintName = "RowingTracker2"
ReferencedContainer = "container:RowingTracker2.xcodeproj">
</BuildableReference>
</MacroExpansion>
</TestAction>
<LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
allowLocationSimulation = "YES">
<BuildableProductRunnable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "83FDBB0D1961ED9900C9A0D2"
BuildableName = "RowingTracker2.app"
BlueprintName = "RowingTracker2"
ReferencedContainer = "container:RowingTracker2.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
<BuildableProductRunnable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "83FDBB0D1961ED9900C9A0D2"
BuildableName = "RowingTracker2.app"
BlueprintName = "RowingTracker2"
ReferencedContainer = "container:RowingTracker2.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SchemeUserState</key>
<dict>
<key>RowingTracker2.xcscheme</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>
<dict>
<key>83FDBB0D1961ED9900C9A0D2</key>
<dict>
<key>primary</key>
<true/>
</dict>
<key>83FDBB221961ED9A00C9A0D2</key>
<dict>
<key>primary</key>
<true/>
</dict>
</dict>
</dict>
</plist>
19 changes: 16 additions & 3 deletions RowingTracker2/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
@@ -1,22 +1,35 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="6162" systemVersion="14A238h" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="BYZ-38-t0r">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="6154.21" systemVersion="13D65" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="BYZ-38-t0r">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6160"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6153.13"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="tne-QT-ifu">
<objects>
<viewController id="BYZ-38-t0r" customClass="ViewController" customModuleProvider="target" sceneMemberID="viewController">
<viewController id="BYZ-38-t0r" customClass="ViewController" customModule="RowingTracker2" customModuleProvider="target" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="y3c-jy-aDJ"/>
<viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
<rect key="frame" x="0.0" y="0.0" width="480" height="480"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<mapView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" ambiguous="YES" misplaced="YES" mapType="standard" translatesAutoresizingMaskIntoConstraints="NO" id="nlv-Fh-YHu">
<rect key="frame" x="0.0" y="0.0" width="480" height="339"/>
</mapView>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<constraints>
<constraint firstAttribute="height" secondItem="nlv-Fh-YHu" secondAttribute="height" id="Fx6-AG-2iX"/>
<constraint firstAttribute="width" secondItem="nlv-Fh-YHu" secondAttribute="width" id="WLT-mH-7l2"/>
</constraints>
<simulatedOrientationMetrics key="simulatedOrientationMetrics" orientation="landscapeRight"/>
</view>
<connections>
<outlet property="mapview" destination="nlv-Fh-YHu" id="f6s-Js-01g"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
</objects>
Expand Down
4 changes: 4 additions & 0 deletions RowingTracker2/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,9 @@
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
</array>
</dict>
</plist>
31 changes: 18 additions & 13 deletions RowingTracker2/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,25 @@
// Copyright (c) 2014 Christoph Siedentop. All rights reserved.
//

import UIKit
import UIKit
import MapKit
import CoreLocation

class ViewController: UIViewController {

override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
}
class ViewController: UIViewController, MKMapViewDelegate {
@IBOutlet var mapview: MKMapView = nil
var locationmgr : CLLocationManager!

override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
locationmgr = CLLocationManager()
locationmgr.requestWhenInUseAuthorization()
mapview.showsUserLocation = true
}

override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
}


}

0 comments on commit 2191aab

Please sign in to comment.