Skip to content

Instantly share code, notes, and snippets.

//
// HowToGoViewController.swift
// Test
//
// Created by Haydar Karkin on 5.06.2015.
// Copyright (c) 2015 Haydar Karkin. All rights reserved.
//
import UIKit
import MapKit
@loplopLover
loplopLover / gist:36a0e89836e45bb1a01d
Created July 15, 2015 09:18
M13ProgressHUD implementation
import Foundation
let CBBProgresViewTag = 23452
class M2XHUD : M13ProgressHUD {
override func hitTest(point: CGPoint, withEvent event: UIEvent?) -> UIView? {
return nil // allow to touch on any other place of the UI without blocking
}
}
@loplopLover
loplopLover / NSObject+PublicClass.swift
Created November 13, 2015 09:30
Determine if a random NSObject subclass instance is a public or private framework (does not test for your objects)
import Foundation
extension NSObject {
var isPublicClass: Bool {
return self.dynamicType.isPublicClass
}
class var isPublicClass: Bool {
return _PUBLIC_IOS_CLASSES.contains(NSStringFromClass(self))
}
@loplopLover
loplopLover / PushNotificationManager.swift
Created November 13, 2015 13:45 — forked from takecian/PushNotificationManager.swift
Utility functions for iOS PushNotification
class PushNotificationManager {
class var isPushNotificationEnable: Bool {
let osVersion = UIDevice.currentDevice().systemVersion
if osVersion < "8.0" {
let types = UIApplication.sharedApplication().enabledRemoteNotificationTypes()
if types == UIRemoteNotificationType.None {
// push notification disabled
return false
}else{
// push notification enable
@loplopLover
loplopLover / String.swift
Created December 7, 2015 03:05 — forked from abarax/String.swift
String extensions for Swift
import Foundation
extension String
{
var length: Int {
get {
return self.characters.count
}
}
@loplopLover
loplopLover / String.swift
Created December 7, 2015 03:38 — forked from loiclefloch/String.swift
Swift usefull extensions
extension String
{
var length: Int {
get {
return count(self)
}
}
func contains(s: String) -> Bool
{