This file contains hidden or 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
- (void)mapView:(GMSMapView*)mapView idleAtCameraPosition:(GMSCameraPosition*)position | |
{ | |
CLLocationCoordinate2D topLeft = mapView.projection.visibleRegion.farLeft; | |
CLLocationCoordinate2D bottomLeft = mapView.projection.visibleRegion.nearLeft; | |
double lat = fabs(topLeft.latitude - bottomLeft.latitude); | |
double mpp = cos(lat * M_PI / 180) * 2 * M_PI * 6378137 / (256 * pow(2, mapView.camera.zoom)); | |
double distance = mpp * mapView.frame.size.width; | |
[[SearchManager shareInstance] distance: distance]; | |
} |
This file contains hidden or 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
// | |
// OneLineForEachSectionLayout.swift | |
// | |
// Created by Philipp Kinschel on 28/11/2016. | |
// | |
// | |
// | |
// very basic solution to layout one section in one line without linebreaks | |
// TODO: find name for the class | |
// |
This file contains hidden or 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 React from "react"; | |
import dateFns from "date-fns"; | |
class Calendar extends React.Component { | |
state = { | |
currentMonth: new Date(), | |
selectedDate: new Date() | |
}; | |
renderHeader() { |
This file contains hidden or 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
// | |
// AudioPlayer.swift | |
// | |
// Created by MDobekidis | |
// | |
import Foundation | |
import AVFoundation | |
import UIKit | |
import Signals |
This file contains hidden or 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
// | |
// AVPlayer+Repeat.swift | |
// | |
// Created by Jun Tanaka on 4/1/16. | |
// Copyright © 2016 eje Inc. All rights reserved. | |
// | |
import AVFoundation | |
private final class RepeatManager: NSObject { |
This file contains hidden or 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
class ResumableTimer: NSObject { | |
private var timer: Timer? = Timer() | |
private var callback: () -> Void | |
private var startTime: TimeInterval? | |
private var elapsedTime: TimeInterval? | |
// MARK: Init |
This file contains hidden or 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
// | |
// RoundedPolygon.swift | |
// | |
// Created by Nate on 2022-10-17. | |
// | |
import SwiftUI | |
struct RoundedPolygon: Shape { | |
This file contains hidden or 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 SwiftUI | |
extension Calendar { | |
func generateDates( | |
inside interval: DateInterval, | |
matching components: DateComponents | |
) -> [Date] { | |
var dates: [Date] = [] | |
dates.append(interval.start) |
This file contains hidden or 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 Foundation | |
struct Film: Codable { | |
let actor: String | |
let year: Int | |
let key: String | |
// Объявляем ключи только для тех которые внутри модели | |
enum CodingKeys: CodingKey { | |
case actor |
This file contains hidden or 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 Foundation | |
struct EvolutionProposal: Codable { | |
var id: String | |
var title: String | |
var reviewStartDate: Date | |
var reviewEndDate: Date | |
enum CodingKeys: String, CodingKey { |
OlderNewer