Skip to content

Instantly share code, notes, and snippets.

View dkotama's full-sized avatar

Darma Kotama, I Nyoman dkotama

View GitHub Profile
@dkotama
dkotama / QuestionModal.swift
Created September 10, 2018 00:10
Swift Question Modal
let alert = UIAlertController(title: NSLocalizedString("logout_confirm", comment: ""), message: "", preferredStyle: .alert)
alert.addAction(UIAlertAction(title: "Yes", style: .default, handler: { action in
self.pushLogout()
}))
alert.addAction(UIAlertAction(title: "No", style: .cancel, handler: nil))
self.present(alert, animated: true)
@dkotama
dkotama / MultipleModal.swift
Last active September 10, 2018 00:08
Swift Show Multiple Choices Modal
// in case i want to copy paste thing
let alertCtrl = UIAlertController(title: nil, message: nil, preferredStyle: .actionSheet)
let galleryBtn = UIAlertAction(title: NSLocalizedString("select_image", comment: ""), style: .destructive, handler: { (action) -> Void in
self.openGallery()
})
let deletePhotoBtn = UIAlertAction(title: NSLocalizedString("delete_image", comment: ""), style: .destructive, handler: { (action) -> Void in
self.editProfilePresenter?.pushUpdateValue(.image_id, values: self.imageId)