Sometimes, after updating your Cocoapods to the lastest version (find out how to do it here), you don’t like it and want to downgrade it back. Or you just want to install a specific version (not the latest). How to do it? Check your current pod version: $ pod --version Check your installed pod versions: $ gem list cocoapods You may see the result like this *** LOCAL GEMS *** cocoapods (1.

Method Swizzling là một thủ thuật siêu mạnh nhưng ít được biết tới và sử dụng (kiểu như phép thuật Hắc Ám trong Harry Potter) được cung cấp bởi Objective-C Runtime. Vì thế đương nhiên thủ thuật này có từ thời Objective-C và nay vẫn được sử dụng ngon lành với Swift. Thuật ngữ Method Swizzling mình có nghe danh từ lâu nhưng chưa có dịp động đến, gần đây trong team ở công ty có người nhắc lại nên đã dành chút thời gian tìm hiểu thêm.

In some reasons, you might want to store an UIImage, that is generated using Core Graphics, or from device’s Photo Gallery via UIImagePickerController, to a local file as PNG or a JPEG format.

By using UIImagePNGRepresentation() or UIImageJPEGRepresentation(), UIImage will be converted into Data so you can write it to local file easily.

Nam Doan

人生はマラソンじゃない!

IT Engineer

Tokyo