-
Notifications
You must be signed in to change notification settings - Fork 35
Added Swift 3 Examples #35
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Renamed some files to clarify version of Swift
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like some of the .swift files ended up in the /Objective-C folder (on disk, rather than in the project). Let’s consolidate all of the .swift files in the /Swift folder.
@@ -0,0 +1,23 @@ | |||
<?xml version="1.0" encoding="UTF-8"?> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking 👍 so far! I'm interested to see how the ExampleProtocol evolves
// | ||
// Created by Jordan Kiley on 10/27/16. | ||
// Copyright © 2016 Mapbox. All rights reserved. | ||
// |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: remove these generated comments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I’ve left them in the project so far, but this could be a task we do across all files before this project reaches a wider audience.
import Mapbox | ||
|
||
@objc(CustomAnnotationModelExample_Swift) | ||
|
||
class CustomAnnotationModelExample_Swift: UIViewController, MGLMapViewDelegate { | ||
override func viewDidLoad() { | ||
super.viewDidLoad() | ||
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: It looks like Xcode on your system is adding whitespace
@@ -575,7 +605,7 @@ | |||
TargetAttributes = { | |||
9619628B1C581700002D3DAB = { | |||
CreatedOnToolsVersion = 7.3; | |||
DevelopmentTeam = U8B2JGE4C6; | |||
DevelopmentTeam = 85826LGZGV; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just noting this got checked in. Not a big deal and I'm not actually sure what is correct for this project.
@@ -27,6 +27,8 @@ | |||
3ECF46101DC1871B0089118A /* SatelliteStyleExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3ECF460F1DC1871B0089118A /* SatelliteStyleExample.swift */; }; | |||
3ECF46121DC1874D0089118A /* SimpleMapViewExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3ECF46111DC1874D0089118A /* SimpleMapViewExample.swift */; }; | |||
3ECF46141DC1878F0089118A /* UserTrackingModesExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3ECF46131DC1878F0089118A /* UserTrackingModesExample.swift */; }; | |||
3ECF46151DC18DAA0089118A /* CustomAnnotationModels.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3ECF45F11DC176090089118A /* CustomAnnotationModels.swift */; }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😁 feel free to add more details in the commit message to for reviewers with less context about the problem you fixed (i.e. added ____ and ____ files to the ___ target)
MBXExampleSimpleMapView, | ||
MBXExampleUserTrackingModes, | ||
]]; | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let’s manually go back to the shorter indentation.
CLLocationCoordinate2DMake(0, 33), | ||
CLLocationCoordinate2DMake(0, 66), | ||
CLLocationCoordinate2DMake(0, 99), | ||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: align the indentation of the closing bracket with let
.
@@ -31,15 +31,15 @@ class CustomAnnotationModelExample_Swift: UIViewController, MGLMapViewDelegate { | |||
CLLocationCoordinate2DMake(-15, 0), | |||
CLLocationCoordinate2DMake(-45, 10), | |||
CLLocationCoordinate2DMake(-45, 40), | |||
] | |||
|
|||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: align the indentation of the closing bracket with var
.
CLLocationCoordinate2DMake(0, 0), | ||
CLLocationCoordinate2DMake(0, 35), | ||
CLLocationCoordinate2DMake(0, 70), | ||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: align the indentation of the closing bracket with let
.
UIView.animate(withDuration: 0.3, delay: 0, usingSpringWithDamping: 0.5, initialSpringVelocity: 0, options: [], animations: { | ||
self.layer.opacity = 0.8 | ||
self.transform = CGAffineTransform.identity.scaledBy(x: 1.5, y: 1.5) | ||
}, completion: nil) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: align the indentation of this closing brace with UIView
.
let context = NSKeyedArchiver.archivedData(withRootObject: userInfo) | ||
|
||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let’s trim the excess blank lines here.
|
||
|
||
|
||
.lightGray |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I’m kind of amazed that this works, lol.
class AnnotationViewExample_Swift: UIViewController, MGLMapViewDelegate { | ||
|
||
// #if !swift(>=3.0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we don’t need this, let’s remove it.
} | ||
|
||
// | ||
// MGLAnnotationView subclass | ||
class CustomAnnotationView: MGLAnnotationView { | ||
// #if !swift(>=3.0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let’s remove this if we don’t need it.
CLLocationCoordinate2DMake(-15, 0), | ||
CLLocationCoordinate2DMake(-45, 10), | ||
CLLocationCoordinate2DMake(-45, 40), | ||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: align this closing brace with var
.
Thanks for beavering away on this. I think we’re good to merge and then address any potential style or organization issues as we notice them. |
CC: @friedbunny