Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Commit

Permalink
[ios, macos] Make Xcode 7.3 the minimum required version
Browse files Browse the repository at this point in the history
- Removes nullability shims for Xcode 6.
- Removes MGLTypes.h from files where it was only being used for
  nullability support.
- Accepts that `NS_SWIFT_NAME` is not fully supported by Xcode 7.2 and
  lower.
- Adds documentation about Xcode 7.3 requirement.
  • Loading branch information
friedbunny committed Aug 18, 2016
1 parent 7de7f9d commit 256689a
Show file tree
Hide file tree
Showing 47 changed files with 25 additions and 79 deletions.
2 changes: 0 additions & 2 deletions platform/darwin/src/MGLAccountManager.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#import <Foundation/Foundation.h>

#import "MGLTypes.h"

NS_ASSUME_NONNULL_BEGIN

/**
Expand Down
2 changes: 0 additions & 2 deletions platform/darwin/src/MGLAnnotation.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
#import <CoreLocation/CoreLocation.h>
#import <TargetConditionals.h>

#import "MGLTypes.h"

NS_ASSUME_NONNULL_BEGIN

/**
Expand Down
1 change: 0 additions & 1 deletion platform/darwin/src/MGLBackgroundStyleLayer.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// This file is generated.
// Edit platform/darwin/scripts/generate-style-code.js, then run `make style-code-darwin`.

#import "MGLTypes.h"
#import "MGLStyleAttributeValue.h"
#import "MGLBaseStyleLayer.h"

Expand Down
1 change: 0 additions & 1 deletion platform/darwin/src/MGLCircleStyleLayer.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// This file is generated.
// Edit platform/darwin/scripts/generate-style-code.js, then run `make style-code-darwin`.

#import "MGLTypes.h"
#import "MGLStyleAttributeValue.h"
#import "MGLBaseStyleLayer.h"

Expand Down
2 changes: 0 additions & 2 deletions platform/darwin/src/MGLClockDirectionFormatter.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#import <Foundation/Foundation.h>
#import <CoreLocation/CoreLocation.h>

#import "MGLTypes.h"

NS_ASSUME_NONNULL_BEGIN

/**
Expand Down
2 changes: 0 additions & 2 deletions platform/darwin/src/MGLCompassDirectionFormatter.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#import <Foundation/Foundation.h>
#import <CoreLocation/CoreLocation.h>

#import "MGLTypes.h"

NS_ASSUME_NONNULL_BEGIN

/**
Expand Down
2 changes: 0 additions & 2 deletions platform/darwin/src/MGLCoordinateFormatter.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#import <Foundation/Foundation.h>
#import <CoreLocation/CoreLocation.h>

#import "MGLTypes.h"

NS_ASSUME_NONNULL_BEGIN

/**
Expand Down
2 changes: 0 additions & 2 deletions platform/darwin/src/MGLFeature.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
#import "MGLPointAnnotation.h"
#import "MGLShapeCollection.h"

#import "MGLTypes.h"

NS_ASSUME_NONNULL_BEGIN

/**
Expand Down
1 change: 0 additions & 1 deletion platform/darwin/src/MGLFillStyleLayer.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// This file is generated.
// Edit platform/darwin/scripts/generate-style-code.js, then run `make style-code-darwin`.

#import "MGLTypes.h"
#import "MGLStyleAttributeValue.h"
#import "MGLBaseStyleLayer.h"

Expand Down
2 changes: 0 additions & 2 deletions platform/darwin/src/MGLGeometry.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
#import <CoreLocation/CoreLocation.h>
#import <CoreGraphics/CGBase.h>

#import "MGLTypes.h"

NS_ASSUME_NONNULL_BEGIN

/** Defines the area spanned by an `MGLCoordinateBounds`. */
Expand Down
1 change: 0 additions & 1 deletion platform/darwin/src/MGLLineStyleLayer.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// This file is generated.
// Edit platform/darwin/scripts/generate-style-code.js, then run `make style-code-darwin`.

#import "MGLTypes.h"
#import "MGLStyleAttributeValue.h"
#import "MGLBaseStyleLayer.h"

Expand Down
2 changes: 0 additions & 2 deletions platform/darwin/src/MGLMapCamera.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
#import <CoreGraphics/CoreGraphics.h>
#import <CoreLocation/CoreLocation.h>

#import "MGLTypes.h"

NS_ASSUME_NONNULL_BEGIN

/**
Expand Down
2 changes: 0 additions & 2 deletions platform/darwin/src/MGLMultiPoint.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@

#import "MGLShape.h"

#import "MGLTypes.h"

NS_ASSUME_NONNULL_BEGIN

/**
Expand Down
1 change: 0 additions & 1 deletion platform/darwin/src/MGLMultiPoint_Private.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#import "MGLMultiPoint.h"

#import "MGLGeometry.h"
#import "MGLTypes.h"

#import <mbgl/annotation/annotation.hpp>
#import <vector>
Expand Down
2 changes: 0 additions & 2 deletions platform/darwin/src/MGLOfflineRegion.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#import <Foundation/Foundation.h>

#import "MGLTypes.h"

NS_ASSUME_NONNULL_BEGIN

/**
Expand Down
2 changes: 0 additions & 2 deletions platform/darwin/src/MGLOverlay.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
#import "MGLAnnotation.h"
#import "MGLGeometry.h"

#import "MGLTypes.h"

NS_ASSUME_NONNULL_BEGIN

/**
Expand Down
2 changes: 0 additions & 2 deletions platform/darwin/src/MGLPointAnnotation.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@

#import "MGLShape.h"

#import "MGLTypes.h"

NS_ASSUME_NONNULL_BEGIN

/**
Expand Down
1 change: 0 additions & 1 deletion platform/darwin/src/MGLRasterStyleLayer.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// This file is generated.
// Edit platform/darwin/scripts/generate-style-code.js, then run `make style-code-darwin`.

#import "MGLTypes.h"
#import "MGLStyleAttributeValue.h"
#import "MGLBaseStyleLayer.h"

Expand Down
2 changes: 0 additions & 2 deletions platform/darwin/src/MGLShape.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

#import "MGLAnnotation.h"

#import "MGLTypes.h"

NS_ASSUME_NONNULL_BEGIN

/**
Expand Down
4 changes: 2 additions & 2 deletions platform/darwin/src/MGLStyle.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#import <Foundation/Foundation.h>

#import "MGLTypes.h"

#import "MGLStyleLayer.h"

#import "MGLTypes.h"

@class MGLSource;

NS_ASSUME_NONNULL_BEGIN
Expand Down
2 changes: 2 additions & 0 deletions platform/darwin/src/MGLStyleAttribute.mm
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
#import "MGLStyleAttributeValue_Private.h"
#import "MGLStyleAttributeFunction_Private.h"

#import "MGLTypes.h"

@interface MGLStyleAttribute()
@end

Expand Down
2 changes: 0 additions & 2 deletions platform/darwin/src/MGLStyleAttributeValue.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#import <Foundation/Foundation.h>

#import "MGLTypes.h"

@protocol MGLStyleAttributeValue <NSObject>
@optional
@end
1 change: 0 additions & 1 deletion platform/darwin/src/MGLStyleAttributeValue_Private.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#import <Foundation/Foundation.h>

#import "MGLTypes.h"
#import "MGLStyleAttributeFunction_Private.h"

#include <array>
Expand Down
1 change: 0 additions & 1 deletion platform/darwin/src/MGLStyleLayer.h.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
// This file is generated.
// Edit platform/darwin/scripts/generate-style-code.js, then run `make style-code-darwin`.

#import "MGLTypes.h"
#import "MGLStyleAttributeValue.h"
#import "MGLBaseStyleLayer.h"

Expand Down
1 change: 0 additions & 1 deletion platform/darwin/src/MGLStyleLayer.mm
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#import "MGLStyleLayer.h"

#import "MGLTypes.h"
#import "MGLStyleLayer_Private.h"
#import "MGLMapView_Private.h"
1 change: 0 additions & 1 deletion platform/darwin/src/MGLSymbolStyleLayer.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// This file is generated.
// Edit platform/darwin/scripts/generate-style-code.js, then run `make style-code-darwin`.

#import "MGLTypes.h"
#import "MGLStyleAttributeValue.h"
#import "MGLBaseStyleLayer.h"

Expand Down
10 changes: 0 additions & 10 deletions platform/darwin/src/MGLTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,6 @@

#pragma once

#if !__has_feature(nullability)
#define NS_ASSUME_NONNULL_BEGIN
#define NS_ASSUME_NONNULL_END
#define nullable
#define nonnull
#define null_resettable
#define _Nullable
#define _Nonnull
#endif

#if TARGET_OS_IPHONE
@class UIColor;
#define MGLColor UIColor
Expand Down
2 changes: 0 additions & 2 deletions platform/darwin/src/NSData+MGLAdditions.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#import <Foundation/Foundation.h>

#import "MGLTypes.h"

NS_ASSUME_NONNULL_BEGIN

@interface NSData (MGLAdditions)
Expand Down
2 changes: 0 additions & 2 deletions platform/darwin/src/NSString+MGLAdditions.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#import <Foundation/Foundation.h>

#import "MGLTypes.h"

NS_ASSUME_NONNULL_BEGIN

@interface NSString (MGLAdditions)
Expand Down
2 changes: 0 additions & 2 deletions platform/darwin/src/NSURL+MGLAdditions.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#import <Foundation/Foundation.h>

#import "MGLTypes.h"

NS_ASSUME_NONNULL_BEGIN

@interface NSURL (MGLAdditions)
Expand Down
1 change: 1 addition & 0 deletions platform/ios/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Mapbox welcomes participation and contributions from everyone. Please read [CONT

* A new runtime styling API allows you to adjust the style and content of the base map dynamically. All the options available in [Mapbox Studio](https://www.mapbox.com/studio/) are now exposed via MGLStyle and subclasses of MGLStyleLayer and MGLSource. ([#5727](https://github.com/mapbox/mapbox-gl-native/pull/5727))
* The user location annotation is now customizable via the newly added `MGLUserLocationAnnotationView` class. ([#5882](https://github.com/mapbox/mapbox-gl-native/pull/5882))
* Xcode 7.3 or higher is now required to use this SDK. ([#6059](https://github.com/mapbox/mapbox-gl-native/issues/6059))
* Simulator architecture slices are included in the included dSYM file, allowing you to symbolicate crashes that occur in the Simulator. ([#5740](https://github.com/mapbox/mapbox-gl-native/pull/5740))
* As the user zooms in, tiles from lower zoom levels are scaled up until tiles for higher zoom levels are loaded. ([#5143](https://github.com/mapbox/mapbox-gl-native/pull/5143))
* Fixed an issue causing the wrong annotation view to be selected when tapping an annotation view with a center offset applied. ([#5931](https://github.com/mapbox/mapbox-gl-native/pull/5931))
Expand Down
3 changes: 3 additions & 0 deletions platform/ios/DEVELOPING.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ This document explains how to build the Mapbox iOS SDK from source. It is intend

The Mapbox iOS SDK and iosapp demo application build against the iOS 7.0 SDK. The SDK is intended to run on iOS 7.0 and above, while iosapp is intended to run on iOS 8.0 and above due to the use of a dynamic framework. Both require Xcode on a computer running macOS.

The Mapbox iOS SDK requires Xcode 7.3 or higher.

## Building the SDK

Make sure that you have the [core dependencies](../../INSTALL.md) installed.
Expand Down Expand Up @@ -83,6 +85,7 @@ To add an Objective-C class, protocol, category, typedef, enumeration, or global
To add an Objective-C header or implementation file to the iOS SDK:

1. Add the file to the Headers or Compile Sources build phase, as appropriate, of both the “dynamic” and “static” targets. You can either use the Build Phases tab of the project editor or the Target Membership section of the File inspector.
1. Audit new headers for nullability. Typically, you will wrap a header with `NS_ASSUME_NONNULL_BEGIN` and `NS_ASSUME_NONNULL_END`.
1. _(Optional.)_ If it’s a public header, change its visibility from Project to Public and import it in [the iOS SDK’s umbrella header](./src/Mapbox.h).
1. _(Optional.)_ If the file would also be used by the macOS SDK, make sure it’s in [platform/darwin/src/](../darwin/src/), then consult [the companion macOS document](../macos/DEVELOPING.md#adding-a-source-code-file) for further instructions.

Expand Down
4 changes: 3 additions & 1 deletion platform/ios/INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@ This document explains how to build a development version of Mapbox iOS SDK for

### Requirements

The Mapbox iOS SDK application builds against the iOS 7.0 SDK. It is intended to run on iOS 7.0 and above on the following devices and their simulators:
The Mapbox iOS SDK builds against the iOS 7.0 SDK. It is intended to run on iOS 7.0 and above on the following devices and their simulators:

* iPhone 4S and above (5, 5c, 5s, 6, 6 Plus)
* iPad 2 and above (3, 4, Mini, Air, Mini 2, Air 2)
* iPod touch 5th generation and above

The Mapbox iOS SDK requires Xcode 7.3 or higher.

### Building the SDK

1. [Install core dependencies](../../INSTALL.md).
Expand Down
2 changes: 2 additions & 0 deletions platform/ios/docs/pod-README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ For more information, check out the [Mapbox iOS SDK homepage](https://www.mapbox

The Mapbox iOS SDK may be installed as either a dynamic framework or a static framework. (To reduce the download size, the static framework is omitted from some distributions; you may need to download the full package from the [release page](https://github.com/mapbox/mapbox-gl-native/releases/).)

Integrating the Mapbox iOS SDK requires Xcode 7.3 or higher.

{{DYNAMIC}}

### Dynamic framework
Expand Down
8 changes: 6 additions & 2 deletions platform/ios/src/MGLAPIClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,14 @@
#import "MGLMapboxEvents.h"
#import "MGLTypes.h"

NS_ASSUME_NONNULL_BEGIN

@interface MGLAPIClient : NSObject <NSURLSessionDelegate>

- (void)postEvents:(nonnull NS_ARRAY_OF(MGLMapboxEventAttributes *) *)events completionHandler:(nullable void (^)(NSError * _Nullable error))completionHandler;
- (void)postEvent:(nonnull MGLMapboxEventAttributes *)event completionHandler:(nullable void (^)(NSError * _Nullable error))completionHandler;
- (void)postEvents:(NS_ARRAY_OF(MGLMapboxEventAttributes *) *)events completionHandler:(nullable void (^)(NSError * _Nullable error))completionHandler;
- (void)postEvent:(MGLMapboxEventAttributes *)event completionHandler:(nullable void (^)(NSError * _Nullable error))completionHandler;
- (void)cancelAll;

@end

NS_ASSUME_NONNULL_END
2 changes: 0 additions & 2 deletions platform/ios/src/MGLAnnotationImage.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#import <UIKit/UIKit.h>

#import "MGLTypes.h"

NS_ASSUME_NONNULL_BEGIN

/**
Expand Down
2 changes: 0 additions & 2 deletions platform/ios/src/MGLAnnotationView.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#import <UIKit/UIKit.h>

#import "MGLTypes.h"

NS_ASSUME_NONNULL_BEGIN

@protocol MGLAnnotation;
Expand Down
2 changes: 0 additions & 2 deletions platform/ios/src/MGLCalloutView.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#import <Foundation/Foundation.h>

#import "MGLTypes.h"

NS_ASSUME_NONNULL_BEGIN

@protocol MGLCalloutViewDelegate;
Expand Down
2 changes: 0 additions & 2 deletions platform/ios/src/MGLMapView+IBAdditions.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#import <Foundation/Foundation.h>

#import "MGLTypes.h"

@class MGLMapView;

NS_ASSUME_NONNULL_BEGIN
Expand Down
2 changes: 0 additions & 2 deletions platform/ios/src/MGLUserLocation.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@

#import "MGLAnnotation.h"

#import "MGLTypes.h"

NS_ASSUME_NONNULL_BEGIN

/**
Expand Down
2 changes: 0 additions & 2 deletions platform/ios/src/MGLUserLocationAnnotationView.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
#import <CoreLocation/CoreLocation.h>
#import <Mapbox/Mapbox.h>

#import "MGLTypes.h"

NS_ASSUME_NONNULL_BEGIN

@class MGLMapView;
Expand Down
5 changes: 4 additions & 1 deletion platform/macos/DEVELOPING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ This document explains how to build the Mapbox macOS SDK from source. It is inte

## Requirements

The Mapbox macOS SDK and the macosapp demo application run on macOS 10.10.0 and above.
The Mapbox macOS SDK and the macosapp demo application run on macOS 10.10.0 or above.

The Mapbox macOS SDK requires Xcode 7.3 or above.

## Building the SDK

Expand Down Expand Up @@ -34,6 +36,7 @@ To add an Objective-C class, protocol, category, typedef, enumeration, or global
To add an Objective-C header or implementation file to the macOS SDK:

1. Add the file to the “dynamic” target’s Headers or Compile Sources build phase, as appropriate. You can either use the Build Phases tab of the project editor or the Target Membership section of the File inspector.
1. Audit new headers for nullability. Typically, you will wrap a header with `NS_ASSUME_NONNULL_BEGIN` and `NS_ASSUME_NONNULL_END`.
1. _(Optional.)_ If it’s a public header, change its visibility from Project to Public and import it in [the macOS SDK’s umbrella header](./src/Mapbox.h).
1. _(Optional.)_ If the file would also be used by the iOS SDK, make sure it’s in [platform/darwin/src/](../darwin/src/), then consult [the companion iOS document](../ios/DEVELOPING.md#adding-a-source-code-file) for further instructions.

Expand Down
Loading

0 comments on commit 256689a

Please sign in to comment.