[CoreLocation] update for iPhone 6/Plus and iOS 8

This commit is contained in:
Craig Dunn 2014-10-17 13:51:14 -07:00
Родитель 746c617d20
Коммит 3f38062fee
4 изменённых файлов: 58 добавлений и 9 удалений

Просмотреть файл

@ -3,14 +3,12 @@
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">iPhoneSimulator</Platform>
<ProductVersion>9.0.21022</ProductVersion>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{6EC86F9F-D4AE-4BFA-8936-11B3ECD60B01}</ProjectGuid>
<ProjectTypeGuids>{6BC8ED88-2882-458C-8E55-DFD12B67127B};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<OutputType>Exe</OutputType>
<RootNamespace>Example_CoreLocation</RootNamespace>
<AssemblyName>Example_CoreLocation</AssemblyName>
<MtouchSdkVersion>4.0</MtouchSdkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhoneSimulator' ">
<DebugSymbols>True</DebugSymbols>
@ -24,7 +22,8 @@
<MtouchDebug>True</MtouchDebug>
<MtouchI18n>
</MtouchI18n>
<MtouchArch>ARMv7</MtouchArch>
<MtouchArch>i386</MtouchArch>
<AssemblyName>CoreLocation</AssemblyName>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhoneSimulator' ">
<DebugType>none</DebugType>
@ -35,6 +34,8 @@
<MtouchLink>None</MtouchLink>
<MtouchI18n>
</MtouchI18n>
<AssemblyName>CoreLocation</AssemblyName>
<MtouchSdkVersion>4.0</MtouchSdkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhone' ">
<DebugSymbols>True</DebugSymbols>
@ -50,6 +51,8 @@
</MtouchI18n>
<IpaPackageName>
</IpaPackageName>
<AssemblyName>Example_CoreLocation</AssemblyName>
<MtouchSdkVersion>4.0</MtouchSdkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhone' ">
<DebugType>none</DebugType>
@ -60,6 +63,8 @@
<CodesignKey>iPhone Developer</CodesignKey>
<MtouchI18n>
</MtouchI18n>
<AssemblyName>Example_CoreLocation</AssemblyName>
<MtouchSdkVersion>4.0</MtouchSdkVersion>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
@ -68,6 +73,7 @@
<Reference Include="monotouch" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.MonoTouch.CSharp.targets" />
<ItemGroup>
<Compile Include="AppDelegate.cs" />
<Compile Include="Application.cs" />
@ -93,6 +99,7 @@
<ItemGroup>
<InterfaceDefinition Include="MainScreen\MainViewController_iPad.xib" xmlns="" />
<InterfaceDefinition Include="MainScreen\MainViewController_iPhone.xib" xmlns="" />
<InterfaceDefinition Include="Resources\LaunchScreen.storyboard" />
</ItemGroup>
<ItemGroup>
<None Include="Info.plist" />

Просмотреть файл

@ -23,7 +23,7 @@
<key>CFBundleVersion</key>
<string>1</string>
<key>MinimumOSVersion</key>
<string>5.0</string>
<string>8.0</string>
<key>UIDeviceFamily</key>
<array>
<integer>1</integer>
@ -37,7 +37,9 @@
<array>
<string>UIInterfaceOrientationPortrait</string>
</array>
<key>NSLocationWhenInUseUsageDescription</key>
<string>Getting location for sample application</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>Getting location for sample application</string>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
</dict>
</plist>

Просмотреть файл

@ -65,10 +65,12 @@ namespace Example_CoreLocation
UpdateLocation (mainScreen, e.Locations [e.Locations.Length - 1]);
};
} else {
#pragma warning disable 618
// this won't be called on iOS 6 (deprecated)
iPhoneLocationManager.UpdatedLocation += (object sender, CLLocationUpdatedEventArgs e) => {
UpdateLocation (mainScreen, e.NewLocation);
};
#pragma warning restore 618
}
//iOS 8 requires you to manually request authorization now - Note the Info.plist file has a new key called requestWhenInUseAuthorization added to.
@ -133,8 +135,8 @@ namespace Example_CoreLocation
{
ms = mainScreen;
}
// called for iOS5.x and earlier
[Obsolete("called for iOS5.x and earlier")]
public override void UpdatedLocation (CLLocationManager manager, CLLocation newLocation, CLLocation oldLocation)
{
MainViewController.UpdateLocation (ms, newLocation);

Просмотреть файл

@ -0,0 +1,38 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="6245" systemVersion="13F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="X5k-f2-b5h">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6238"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="gAE-YM-kbH">
<objects>
<viewController id="X5k-f2-b5h" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="Y8P-hJ-Z43"/>
<viewControllerLayoutGuide type="bottom" id="9ZL-r4-8FZ"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="yd7-JS-zBw">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" misplaced="YES" text="Xamarin" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="0q6-MR-edx">
<rect key="frame" x="201" y="300" width="194" height="39"/>
<fontDescription key="fontDescription" name="HelveticaNeue-Light" family="Helvetica Neue" pointSize="36"/>
<color key="textColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" white="0.0" alpha="1" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstAttribute="centerX" secondItem="0q6-MR-edx" secondAttribute="centerX" id="18"/>
<constraint firstItem="0q6-MR-edx" firstAttribute="centerY" secondItem="yd7-JS-zBw" secondAttribute="centerY" id="19"/>
</constraints>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="XAI-xm-WK6" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="349" y="339"/>
</scene>
</scenes>
</document>