A Pen by Carlos Linares on CodePen.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
// Conform the `Polygon` protocol to specify the vertices of the polygon. | |
protocol Polygon { | |
var vertices: [CGPoint] { get } | |
} | |
// UIView conforms the protocol `Polygon` to specified the vertices of the rectangle. | |
extension UIView: Polygon { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
override func tabBar(_ tabBar: UITabBar, didSelect item: UITabBarItem) { | |
let index = CGFloat(integerLiteral: tabBar.items!.index(of: item)!) | |
let itemWidth = indicatorImage?.frame.width | |
let newCenterX = (itemWidth! / 2) + (itemWidth! * index) | |
UIView.animate(withDuration: 0.3) { | |
self.indicatorImage?.center.x = newCenterX | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
```json | |
{ | |
"body": { | |
"client": { | |
"name": "keybase.io node.js client", | |
"version": "0.7.7" | |
}, | |
"key": { | |
"fingerprint": "8c19240afd7230efb629f33d6c28a9663b79991a", | |
"host": "keybase.io", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no' /> | |
<style> | |
body { margin:0; padding:0; } | |
#map { position:absolute; top:0; bottom:0; width:100%; } | |
.marker-properties { | |
border-collapse:collapse; |