Skip to content

Instantly share code, notes, and snippets.

Pasan Premaratne Pasanpr

Block or report user

Report or block Pasanpr

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@Pasanpr
Pasanpr / TextSize.swift
Created May 9, 2017 — forked from gnou/TextSize.swift
Calculate height of some text when width is fixed
View TextSize.swift
public struct TextSize {
fileprivate struct CacheEntry: Hashable {
let text: String
let font: UIFont
let width: CGFloat
let insets: UIEdgeInsets
fileprivate var hashValue: Int {
return text.hashValue ^ Int(width) ^ Int(insets.top) ^ Int(insets.left) ^ Int(insets.bottom) ^ Int(insets.right)
View blogs.txt
Bryan Irace: http://irace.me/
Chris Eidhof: http://chris.eidhof.nl/
Objc.io: https://www.objc.io/
Airspeed Velocity: https://airspeedvelocity.net/
Cocoa With Love: http://www.cocoawithlove.com/
Ash Furrow: https://ashfurrow.com/
Jessie Squires: http://www.jessesquires.com/
Soroush Khanlou: http://khanlou.com/
Ole Begemann: http://oleb.net/
Krzysztof Zabłocki: http://merowing.info/
View keybase.md

Keybase proof

I hereby claim:

  • I am pasanpr on github.
  • I am pasanpr (https://keybase.io/pasanpr) on keybase.
  • I have a public key ASAvauER5tk6w0IcdViNjc8qtO___bDP87wojwbOYhsyXgo

To claim this, I am signing this object:

@Pasanpr
Pasanpr / CoreDataStack
Created Jun 8, 2014
Moving CoreData code to separate Swift file
View CoreDataStack
//
// CoreDataStack.swift
// CoreDataStack
//
// Created by Pasan Premaratne on 6/8/14.
// Copyright (c) 2014 Pasan Premaratne. All rights reserved.
//
import CoreData
import Foundation
@Pasanpr
Pasanpr / Error.txt
Created Jun 13, 2015
Xcode build error
View Error.txt
CompileSwift normal x86_64 /Users/pasan/iOS/Swift/Projects/BookShelf/BookShelf/LoginViewController.swift
cd /Users/pasan/iOS/Swift/Projects/BookShelf
/Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -frontend -c -primary-file /Users/pasan/iOS/Swift/Projects/BookShelf/BookShelf/LoginViewController.swift /Users/pasan/iOS/Swift/Frameworks/OAuthSwift/OAuthSwift/NSData+OAuthSwift.swift /Users/pasan/iOS/Swift/Projects/BookShelf/BookShelf/GoodreadsCredential.swift /Users/pasan/iOS/Swift/Projects/BookShelf/BookShelf/AppDelegate.swift /Users/pasan/iOS/Swift/Frameworks/OAuthSwift/OAuthSwift/OAuth1Swift.swift /Users/pasan/iOS/Swift/Frameworks/OAuthSwift/OAuthSwift/SHA1.swift /Users/pasan/iOS/Swift/Projects/BookShelf/BookShelf/Shelf.swift /Users/pasan/iOS/Swift/Projects/BookShelf/BookShelf/NetworkDownController.swift /Users/pasan/iOS/Swift/Frameworks/OAuthSwift/OAuthSwift/String+OAuthSwift.swift /Users/pasan/iOS/Swift/Projects/BookShelf/BookShelf/HomeViewController
You can’t perform that action at this time.