Skip to content

Instantly share code, notes, and snippets.

View anirudhamahale's full-sized avatar

Anirudha Mahale anirudhamahale

View GitHub Profile
@z5ottu
z5ottu / uibutton.3d.transform.swift
Created January 4, 2016 11:40
Swift: UIView 3d transform animation style: horizontal flip
let layer = sender.layer
var rotationAndPerspectiveTransform : CATransform3D = CATransform3DIdentity
rotationAndPerspectiveTransform.m34 = 1.0 / -1000
rotationAndPerspectiveTransform = CATransform3DRotate(rotationAndPerspectiveTransform, CGFloat(M_PI / 0.3), 0.0, 1.0, 0.0)
layer.transform = rotationAndPerspectiveTransform
UIView.animateWithDuration(2.0, animations: {
layer.transform = CATransform3DIdentity
})
@nvkiet
nvkiet / [Swift] Switch-RootViewController
Last active June 21, 2023 12:35
Switch root view controller
func switchRootViewController(rootViewController: UIViewController, animated: Bool, completion: (() -> Void)?) {
if animated {
UIView.transitionWithView(window, duration: 0.5, options: .TransitionCrossDissolve, animations: {
let oldState: Bool = UIView.areAnimationsEnabled()
UIView.setAnimationsEnabled(false)
self.window!.rootViewController = rootViewController
UIView.setAnimationsEnabled(oldState)
}, completion: { (finished: Bool) -> () in
if completion {
completion!()
@jacobbubu
jacobbubu / ioslocaleidentifiers.csv
Created February 15, 2012 14:41
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)