/
ns-CoreLocation.xml
44 lines (44 loc) · 1.83 KB
/
ns-CoreLocation.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<Namespace Name="CoreLocation">
<Docs>
<summary>The CoreLocation namespace provides classes for tracking and monitoring location, regions (including iBeacons), and geocoding.</summary>
<remarks>
<para>The Core Location namespace revolves around tracking and monitoring user location, the device's entry-and-exit from regions (either fixed or iBeacon-based), and geocoding between addresses and locations.</para>
<para>Geocoding use-cases center on the <see cref="T:CoreLocation.CLGeocoder" /> class. Geocoding is simple:</para>
<example>
<code lang="csharp lang-csharp"><![CDATA[
async void GeocodeToConsoleAsync (string address) {
var geoCoder = new CLGeocoder();
var placemarks = await geoCoder.GeocodeAddressAsync(address);
foreach (var placemark in placemarks) {
Console.WriteLine(placemark);
}
]]></code>
</example>
<para>As is reverse-geocoding:</para>
<example>
<code lang="csharp lang-csharp"><![CDATA[
async void ReverseGeocodeToConsoleAsync (CLLocation location) {
var geoCoder = new CLGeocoder();
var placemarks = await geoCoder.ReverseGeocodeLocationAsync(location);
foreach (var placemark in placemarks) {
Console.WriteLine(placemark);
}
}
]]></code>
</example>
<para>Other use-cases typically will start with the <see cref="T:CoreLocation.CLLocationManager" /> class:</para>
<list type="bullet">
<item>
<term>Tracking the device's location</term>
</item>
<item>
<term>Region monitoring (Geofencing)</term>
</item>
<item>
<term>iBeacon ranging</term>
</item>
</list>
<para>These use-cases are discussed in the <see cref="T:CoreLocation.CLLocationManager" /> class documentation.</para>
</remarks>
</Docs>
</Namespace>