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.

You finished implementing your Server-side Swift App. Everything works well in localhost. Now you want to sent it off to Heroku so that you can share your app with the world. Here is the guideline to deploy your Swift App to Heroku. Prerequisites Register a free Heroku Account here. Install Heroku CLI Check if you have Heroku CLI installed in your machine, try to login heroku login If now, follow steps in this link to install it.

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