Skip to content

Instantly share code, notes, and snippets.

@khorbushko
khorbushko / PHPhotoLibrary+SaveImage
Created December 29, 2016 09:27
PHPhotoLibrary+SaveImage - save image with Photos Framework swift 3
import UIKit
import Photos
extension PHPhotoLibrary {
// MARK: - PHPhotoLibrary+SaveImage
// MARK: - Public
func savePhoto(image:UIImage, albumName:String, completion:((PHAsset?)->())? = nil) {
func save() {
@imkevinxu
imkevinxu / Device.swift
Last active March 4, 2023 16:09
iOS device checks for OS version and screen size in Swift
//
// Device.swift
// imHome
//
// Created by Kevin Xu on 2/9/15. Updated on 6/20/15.
// Copyright (c) 2015 Alpha Labs, Inc. All rights reserved.
//
import Foundation
@CocoaRush
CocoaRush / re
Last active December 14, 2021 18:12
unzip a zip file using Python. The zip may created in Win OS and would have a lot of gibberish in file name when unzipped in MAC OS, this simple snippet aim to solved the above problem stated.
sfgsg
@mbogh
mbogh / NSObject+setValuesForKeysWithJSONDictionary.h
Created May 3, 2012 13:43 — forked from atomicbird/NSObject+setValuesForKeysWithJSONDictionary.h
NSObject category for handling JSON dictionaries. Described in detail at http://www.cimgf.com/2012/01/11/handling-incoming-json-redux/. Updated to support parent properties.
//
// NSObject+setValuesForKeysWithJSONDictionary.h
// SafeSetDemo
//
// Created by Tom Harrington on 12/29/11.
// Copyright (c) 2011 Atomic Bird, LLC. All rights reserved.
//
#import <Foundation/Foundation.h>