Skip to content

Instantly share code, notes, and snippets.

View AmirDaliri's full-sized avatar
🏠
Working from home

Naser(Amir) Daliri AmirDaliri

🏠
Working from home
View GitHub Profile
@gmertk
gmertk / RangeWhileMonitorPart06.swift
Created May 27, 2015 11:18
A Simple Beacon Manager which starts/stops ranging when a beacon region transition happens.
import Foundation
import CoreLocation
let beaconManagerDidEnterRegionsNotification = "beaconManagerDidEnterRegionsNotification"
let beaconManagerDidExitRegionsNotification = "beaconManagerDidExitRegionsNotification"
let beaconManagerUserInfoEnteredRegionsKey = "enteredRegions"
let beaconManagerUserInfoExitedRegionsKey = "exitedRegions"
class BeaconManager: NSObject, CLLocationManagerDelegate {
private var manager = CLLocationManager()
@brocoo
brocoo / Extensions.swift
Last active April 12, 2021 13:27
Swift UIImage extension for base64 conversion
// MARK: - UIImage (Base64 Encoding)
public enum ImageFormat {
case PNG
case JPEG(CGFloat)
}
extension UIImage {
public func base64(format: ImageFormat) -> String {
@yonat
yonat / Badge.swift
Last active December 22, 2022 09:40
Rounded UILabel and UIButton, Badged UIBarButtonItem
//
// Badge.swift
// Extensions for Rounded UILabel and UIButton, Badged UIBarButtonItem.
//
// Usage:
// let label = UILabel(badgeText: "Rounded Label");
// let button = UIButton(type: .System); button.rounded = true
// let barButton = UIBarButtonItem(badge: "42", title: "How Many Roads", target: self, action: "answer")
//
// Created by Yonat Sharon on 06.04.2015.