Skip to content

Instantly share code, notes, and snippets.

View nRewik's full-sized avatar

Nutchaphon Rewik nRewik

View GitHub Profile
@nRewik
nRewik / chainingRequestDelegate.swift
Created September 8, 2015 13:20
how request chaining work with NSUrlSessionDelegate
//: Playground - noun: a place where people can play
import UIKit
import XCPlayground
XCPSetExecutionShouldContinueIndefinitely(continueIndefinitely: true)
class ExampleChainingRequest: NSObject{
private var session: NSURLSession!
@nRewik
nRewik / UIImage+Orientation.swift
Created August 21, 2015 09:00
UIImage fix orientation ( rotate pixel rather than relying on exif )
//
// UIImage+Orientation.swift
// DrCloudPatient
//
// Created by DW78 on 8/21/15.
// Copyright (c) 2015 DW78. All rights reserved.
//
import UIKit
@nRewik
nRewik / NSDate+Utility.swift
Last active August 29, 2015 14:27
Create all dates in specific month and year as in `gregorian` calendar
import UIKit
extension NSDate{
/**
Create all dates in specific month and year as in `gregorian` calendar
**Usage Example**
`NSDate.datesInMonthCalendar(month: 8, year: 2015)`
@nRewik
nRewik / UILabel+FontSize.Swift
Last active April 22, 2024 20:49
iOS-Swift adjust font size to fit in rect
//
// UILabel+FontSize.Swift
//
// Created by Nutchaphon Rewik on 7/11/15.
// Copyright (c) 2015 Nutchaphon Rewik. All rights reserved.
//
import UIKit
extension UILabel{