Skip to content

Commit

Permalink
[CoreLocation] Update to Xcode 9 Beta 1 (#2224)
Browse files Browse the repository at this point in the history
* [CoreLocation] Update to Xcode 9 Beta 1

* [CoreLocation] Inline CLGeocoder_ContactsAdditions so we get Async versions
  • Loading branch information
dalexsoto authored Jun 19, 2017
1 parent 58fe128 commit c2d9032
Showing 1 changed file with 39 additions and 2 deletions.
41 changes: 39 additions & 2 deletions src/corelocation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
#if !MONOMAC
using XamCore.UIKit;
#endif
#if XAMCORE_2_0 && !TVOS
using XamCore.Contacts;
#endif
using System;

namespace XamCore.CoreLocation {
Expand Down Expand Up @@ -387,8 +390,8 @@ partial interface CLLocationManager {
[Export ("requestLocation")]
void RequestLocation ();

[NoWatch][NoTV]
[iOS (9,0)]
[NoTV]
[iOS (9,0), Watch (4,0)]
[Export ("allowsBackgroundLocationUpdates")]
bool AllowsBackgroundLocationUpdates { get; set; }
#endif
Expand Down Expand Up @@ -539,6 +542,9 @@ partial interface CLRegion : NSSecureCoding, NSCopying {
[BaseType (typeof (NSObject))]
[DisableDefaultCtor] // will crash, see CoreLocation.cs for compatibility stubs
interface CLPlacemark : NSSecureCoding, NSCopying {
[Deprecated (PlatformName.WatchOS, 4, 0, message: "Use 'CLPlacemark' properties to access data.")]
[Deprecated (PlatformName.iOS, 11, 0, message: "Use 'CLPlacemark' properties to access data.")]
[Deprecated (PlatformName.MacOSX, 10, 13, message: "Use 'CLPlacemark' properties to access data.")]
[Export("addressDictionary", ArgumentSemantic.Copy)]
NSDictionary AddressDictionary { get; }

Expand Down Expand Up @@ -593,6 +599,12 @@ interface CLPlacemark : NSSecureCoding, NSCopying {
[Export ("timeZone")]
[iOS (9,0), Mac(10,11)]
NSTimeZone TimeZone { get; }
#if XAMCORE_2_0 && !TVOS
// From CLPlacemark (ContactsAdditions) category.
[Watch (4,0), NoTV, Mac (10,13), iOS (11,0)]
[NullAllowed, Export ("postalAddress")]
CNPostalAddress PostalAddress { get; }
#endif
}

[Mac (10,10)]
Expand Down Expand Up @@ -684,6 +696,14 @@ interface CLGeocoder {
[Async]
void ReverseGeocodeLocation (CLLocation location, CLGeocodeCompletionHandler completionHandler);

[Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)]
[Export ("reverseGeocodeLocation:preferredLocale:completionHandler:")]
[Async]
void ReverseGeocodeLocation (CLLocation location, [NullAllowed] NSLocale locale, CLGeocodeCompletionHandler completionHandler);

[Deprecated (PlatformName.WatchOS, 4, 0, message: "Use 'GeocodeAddress (string, CLRegion, NSLocale, CLGeocodeCompletionHandler)' instead.")]
[Deprecated (PlatformName.iOS, 11, 0, message: "Use 'GeocodeAddress (string, CLRegion, NSLocale, CLGeocodeCompletionHandler)' instead.")]
[Deprecated (PlatformName.MacOSX, 10, 13, message: "Use 'GeocodeAddress (string, CLRegion, NSLocale, CLGeocodeCompletionHandler)' instead.")]
[Export ("geocodeAddressDictionary:completionHandler:")]
[Async]
void GeocodeAddress (NSDictionary addressDictionary, CLGeocodeCompletionHandler completionHandler);
Expand All @@ -696,8 +716,25 @@ interface CLGeocoder {
[Async]
void GeocodeAddress (string addressString, CLRegion region, CLGeocodeCompletionHandler completionHandler);

[Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)]
[Async]
[Export ("geocodeAddressString:inRegion:preferredLocale:completionHandler:")]
void GeocodeAddress (string addressString, [NullAllowed] CLRegion region, [NullAllowed] NSLocale locale, CLGeocodeCompletionHandler completionHandler);

[Export ("cancelGeocode")]
void CancelGeocode ();

#if XAMCORE_2_0 && !TVOS
[Watch (4,0), NoTV, Mac (10,13), iOS (11,0)]
[Export ("geocodePostalAddress:completionHandler:")]
[Async]
void GeocodePostalAddress (CNPostalAddress postalAddress, CLGeocodeCompletionHandler completionHandler);

[Watch (4,0), NoTV, Mac (10,13), iOS (11,0)]
[Export ("geocodePostalAddress:preferredLocale:completionHandler:")]
[Async]
void GeocodePostalAddress (CNPostalAddress postalAddress, [NullAllowed] NSLocale locale, CLGeocodeCompletionHandler completionHandler);
#endif
}

#if !MONOMAC
Expand Down

0 comments on commit c2d9032

Please sign in to comment.