Pourya Delnavaz

0

votes
0

answer
6

views

Dragging a uiview in a scrollview

I have a scroll view that contains an Image View. I add some UIview to that image that I want to drag and drop them in the image area. I Already use UIPanGestureRecognizer (Draggable UIView Swift 3) but it doesn't work. @IBOutlet weak var mapImage: UIImageView! @IBOutlet weak var scrollView: UIScrol...
pourya delnavaz
0

votes
0

answer
4

views

Show and hide MBprogressHUD multiply times in a swift function

a function is doing multiply things in blocks. I want to hide hud when a task is done and shows the hud for the next task. but it shows the hud at first and hides it in the end. whats the problem? This is my code: @IBAction func syncBtn(_ sender: Any) { let loadingNotification = MBProgressHUD.showAd...
pourya delnavaz
1

votes
2

answer
173

views

Get element.type from generic object in swift

I want to write an generic method to read all items from a type in realm and delete them. I wrote this: func deleteAllFromObject(_ object: T) { let allUploadingObjects = realm.objects(T.self()) try! realm.write { realm.delete(allUploadingObjects) } } but i got an error that says: Cannot convert val...