Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let originalImage = UIImage(named: "markerIcon")
- delay(seconds: 0.05) { () -> () in
- marker.icon = self.newImageWithWidth(originalImage!, width: originalImage!.size.width/2, height: originalImage!.size.height)
- delay(seconds: 0.05, { () -> () in
- marker.icon = self.newImageWithWidth(originalImage!, width: 0.1, height: originalImage!.size.height)
- delay(seconds: 0.05, { () -> () in
- marker.icon = self.newImageWithWidth(originalImage!, width: originalImage!.size.width/2, height: originalImage!.size.height)
- delay(seconds: 0.05, { () -> () in
- marker.icon = self.newImageWithWidth(originalImage!, width: originalImage!.size.width, height: originalImage!.size.height)
- })
- })
- })
- }
- func newImageWithWidth(image: UIImage, width: CGFloat, height: CGFloat) -> UIImage{
- let imageSize = CGSize(width: width, height: height)
- UIGraphicsBeginImageContext(imageSize)
- let imageRect = CGRectMake(0, 0, width, height)
- image.drawInRect(imageRect)
- let resizedImage = UIGraphicsGetImageFromCurrentImageContext()
- UIGraphicsEndImageContext()
- return resizedImage
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement