Skip to content

Instantly share code, notes, and snippets.

View modestman's full-sized avatar

Anton Glezman modestman

View GitHub Profile
extension String {
var composedCount : Int {
var count = 0
enumerateSubstrings(in: startIndex..<endIndex, options: .byComposedCharacterSequences) {_ in count+=1}
return count
}
}
//
// GTMapGridDataSource.m
// GallopTravel
//
// Created by Anton Glezman on 08.12.16.
// Copyright © 2016 Globus It. All rights reserved.
//
#import "GTMapGridDataSource.h"
#import "GTDataProviderProtocol.h"
//
// GTMapDatasource.m
// GallopTravel
//
// Created by Anton Glezman on 02.06.16.
// Copyright © 2016 Globus It. All rights reserved.
//
@interface GTMapDatasource() <GTMapDataSourceDelegate, GTPoiDataSourceDelegate>
{
<OpenLife.ApiOnboardingResponse
URL : "http://dev.openlife.staging.globus-ltd.com/v1/slides"
MIMEType : "application/json"
StatusCode : internal server error (500)
Headers : {
"X-Rate-Limit-Reset" : "0",
"X-Rate-Limit-Limit" : "4",
"Content-Type" : "application/json; charset=UTF-8",
"Server" : "nginx/1.10.3",
"X-Rate-Limit-Remaining" : "2",
source 'https://github.com/CocoaPods/Specs.git'
inhibit_all_warnings!
def core_pods
pod 'Globus/CoreFoundation/DateFormatter'
pod 'Globus/ApiManager'
pod 'Globus/Model'
pod 'Globus/Timer'
// Базовый класс
class Parameters {
var parameters: [String: Any] = [:]
/**
Добавить параметр.
- parameter parameter: имя параметра;
- parameter value: значение параметра.
@modestman
modestman / mail.swift
Last active August 13, 2022 03:21
Url scheme for compose email with Gmail and Spark
import UIKit
class ViewController: UIViewController {
@IBAction func gmail(_ sender: Any) {
let compose = "googlegmail:///co?subject=Subject&body=some text&to=test@example.com"
.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed)!
let url = URL(string: compose)!
if UIApplication.shared.canOpenURL(url) {
UIApplication.shared.open(url)
@modestman
modestman / Font.swift
Created April 1, 2021 09:49
iOS Fonts
import UIKit
extension UIFont {
static var largeTitle: UIFont {
basisSFPro(FontFamily.SFProText.bold, size: 40, iPhone5Size: 28, textStyle: .largeTitle)
}
static var title1: UIFont {
basisSFPro(FontFamily.SFProText.bold, size: 24, iPhone5Size: 20, textStyle: .title1)
@modestman
modestman / Version.swift
Created April 2, 2021 11:43
SemVer Parsing
import Foundation
/// https://semver.org/
struct Version: Comparable, CustomStringConvertible {
let major: Int
let minor: Int
let patch: Int
@modestman
modestman / Data+HEX.swift
Created July 27, 2021 06:46
Hex encoded Data swift
import Foundation
public extension Data {
struct HexEncodingOptions: OptionSet {
public let rawValue: Int
public static let upperCase = HexEncodingOptions(rawValue: 1 << 0)
public init(rawValue: Int) {
self.rawValue = rawValue
}