Skip to content

Instantly share code, notes, and snippets.

View EvoIos's full-sized avatar
🐶
I may be slow to respond.

Pace.Z EvoIos

🐶
I may be slow to respond.
  • beijing
View GitHub Profile
@EvoIos
EvoIos / ioslocaleidentifiers.csv
Created November 17, 2017 08:34 — forked from jacobbubu/ioslocaleidentifiers.csv
iOS Locale Identifiers
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
mr Marathi
bs Bosnian
ee_TG Ewe (Togo)
ms Malay
kam_KE Kamba (Kenya)
mt Maltese
ha Hausa
es_HN Spanish (Honduras)
ml_IN Malayalam (India)
ro_MD Romanian (Moldova)
@EvoIos
EvoIos / ZLCSwipeCollectionViewCell.h
Last active December 2, 2024 07:04
UICollectionViewCell siwpe left to delete, or custom reveal button
#import <UIKit/UIKit.h>
extern NSString * const SwipeCollectionViewCurrentSwipeCell;
@interface ZLCSwipeCollectionViewCell : UICollectionViewCell
@property (nonatomic,strong) UIView *revealView;
/// default: YES, if you want to disable panGestureRecoginzer, you can use this property.
@property (nonatomic,assign) BOOL canSwiped;
/// optional: when only use default revealView, you maybe set this property, eg: xxx.deleteButtonTitle = @"delete"
@property (nonatomic,copy) NSString *deleteButtonTitle;
@EvoIos
EvoIos / demo: create bitmap using Quartz 2D
Last active August 17, 2016 15:58
create bitmap using Quartz 2D in swift 2.3
func createBitmapContext (pixelsWide pixelsWide: Int, pixelsHigh: Int) -> CGContextRef? {
//set colorSpace
let colorSpace = CGColorSpaceCreateWithName(kCGColorSpaceGenericRGB)
//set 32 bits per pixel, 8 bits per component, kCGImageAlphaPremultipliedLast
let bitmapBytesPerRow = (pixelsWide * 4)
let context = CGBitmapContextCreate(nil, pixelsWide, pixelsHigh, 8, bitmapBytesPerRow, colorSpace, CGImageAlphaInfo.PremultipliedLast.rawValue)
return context
}
enum HTTPMethod: String {
case GET,POST,UPDATE,PUT
}
func getDataFromServer(method: HTTPMethod) {
//request
let url = URL(string: "https://httpbin.org/\(method)")
var request = URLRequest(url: url!)
request.httpMethod = method.rawValue
request.cachePolicy = .reloadIgnoringLocalCacheData