Skip to content

Commit

Permalink
Further PR review mods.
Browse files Browse the repository at this point in the history
  • Loading branch information
julianrex committed Aug 4, 2021
1 parent 4995ba7 commit 903bf3a
Show file tree
Hide file tree
Showing 14 changed files with 26 additions and 85 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ public class SnapshotterExample: UIViewController, ExampleProtocol {
// Set the camera of the snapshotter

mapView.mapboxMap.onEvery(.mapIdle) { [weak self] _ in
// Allow the previous snapshot to complete before starting a new one.
guard let self = self, !self.snapshotting else {
return
}
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Mapbox welcomes participation and contributions from everyone.
### Features ✨ and improvements 🏁

* Added support for building with Xcode 13b3. ([#564](https://github.com/mapbox/mapbox-maps-ios/pull/564))
* Added attribution to snapshots generated by `Snapshotter`. ([567](https://github.com/mapbox/mapbox-maps-ios/pull/567))

## 10.0.0-rc.5 - July 28, 2021

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ internal final class AttributionView: UIView {
internal static let padding = CGPoint(x: 10, y: 5)

internal init(text: NSAttributedString) {
// Label
let label = UILabel()
label.attributedText = text
var labelSize = label.sizeThatFits(.zero)
Expand Down
12 changes: 12 additions & 0 deletions Sources/MapboxMaps/Foundation/Extensions/UIView.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
internal extension UIView {
var parentViewController: UIViewController? {
var parentResponder: UIResponder? = self
while parentResponder != nil {
parentResponder = parentResponder?.next
if let viewController = parentResponder as? UIViewController {
return viewController
}
}
return nil
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import UIKit
@_implementationOnly import MapboxCommon_Private

@available(iOSApplicationExtension, unavailable)
internal class MapboxInfoButtonOrnament: UIView {
internal weak var attributionDataSource: AttributionDataSource?

Expand Down
1 change: 1 addition & 0 deletions Sources/MapboxMaps/Ornaments/OrnamentsManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ internal struct Ornaments {
static let telemetryURL = "https://www.mapbox.com/telemetry/"
}

@available(iOSApplicationExtension, unavailable)
public class OrnamentsManager: NSObject {

/// The `OrnamentOptions` object that is used to set up and update the required ornaments on the map.
Expand Down
17 changes: 3 additions & 14 deletions Sources/MapboxMaps/Style/AttributionDialogManager.swift
Original file line number Diff line number Diff line change
@@ -1,28 +1,16 @@
// WIP
@_implementationOnly import MapboxCommon_Private

internal protocol AttributionDataSource: AnyObject {
func attributions() -> [Attribution]
}

@available(iOSApplicationExtension, unavailable)
internal protocol AttributionDialogManagerDelegate: AnyObject {
func attributionDialogManager(_ attributionDialogManager: AttributionDialogManager, viewControllerForPresentingFromView view: UIView) -> UIViewController
func triggerAction(for attribution: Attribution)
}

internal extension UIView {
var parentViewController: UIViewController? {
var parentResponder: UIResponder? = self
while parentResponder != nil {
parentResponder = parentResponder?.next
if let viewController = parentResponder as? UIViewController {
return viewController
}
}
return nil
}
}

@available(iOSApplicationExtension, unavailable)
internal class AttributionDialogManager {
init() {
delegate = self
Expand Down Expand Up @@ -173,6 +161,7 @@ internal class AttributionDialogManager {
}
}

@available(iOSApplicationExtension, unavailable)
extension AttributionDialogManager: AttributionDialogManagerDelegate {
func triggerAction(for attribution: Attribution) {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,8 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "testSnapshotAttribution-100_1_232D6148-268F-4BCC-B87A-A78007EF9688.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
"idiom" : "universal"
}
],
"info" : {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,8 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "testSnapshotAttribution-150_1_E8430267-DD22-4AA8-9727-BD94B2F99DF6.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
"idiom" : "universal"
}
],
"info" : {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,8 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "testSnapshotAttribution-200_1_11E08884-1F2F-4150-A662-909115267E7D.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
"idiom" : "universal"
}
],
"info" : {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,8 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "testSnapshotAttribution-250_1_8468A877-E93E-4EEE-BD0B-5D858260AF05.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
"idiom" : "universal"
}
],
"info" : {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,8 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "testSnapshotAttribution-300_1_BD9DE994-7E29-433D-895A-6A0A92C85D9A.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
"idiom" : "universal"
}
],
"info" : {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,7 @@
"images" : [
{
"filename" : "testSnapshotAttribution-50_1_CD1F7DDD-002E-42F6-A6EF-6BFE78A46E06.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
"idiom" : "universal"
}
],
"info" : {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,7 @@
"images" : [
{
"filename" : "testSnapshotLogoVisibility.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
"idiom" : "universal"
}
],
"info" : {
Expand Down

0 comments on commit 903bf3a

Please sign in to comment.