@@ -21,8 +21,9 @@ final class PinRecordCell: UICollectionViewCell {
2121 } ( )
2222 public lazy var thumbnailImageView : UIImageView = {
2323 let imageView = UIImageView ( )
24- imageView. contentMode = . scaleToFill
24+ imageView. contentMode = . scaleAspectFill
2525 imageView. backgroundColor = . lightGray
26+ imageView. clipsToBounds = true
2627 return imageView
2728 } ( )
2829 private lazy var pinTitleLabel : UILabel = {
@@ -98,19 +99,19 @@ final class PinRecordCell: UICollectionViewCell {
9899extension PinRecordCell {
99100 func captureMapSnapshotWithPin( center: CLLocationCoordinate2D , imageSize: CGSize , completion: @escaping ( UIImage ? ) -> Void ) {
100101 let options = MKMapSnapshotter . Options ( )
101- options. region = MKCoordinateRegion ( center: center, span: MKCoordinateSpan ( latitudeDelta: 0.003 , longitudeDelta: 0.003 ) )
102- options. size = imageSize
103- options. mapType = . standard
104-
105- let snapshotter = MKMapSnapshotter ( options: options)
106- snapshotter. start { snapshot, error in
107- guard let snapshot = snapshot, error == nil else {
108- print ( " 스냅샷 생성 실패 " )
109- completion ( nil )
110- return
111- }
112-
113- completion ( snapshot. image)
102+ options. region = MKCoordinateRegion ( center: center, span: MKCoordinateSpan ( latitudeDelta: 0.003 , longitudeDelta: 0.003 ) )
103+ options. size = imageSize
104+ options. mapType = . standard
105+
106+ let snapshotter = MKMapSnapshotter ( options: options)
107+ snapshotter. start { snapshot, error in
108+ guard let snapshot = snapshot, error == nil else {
109+ print ( " 스냅샷 생성 실패 " )
110+ completion ( nil )
111+ return
114112 }
113+
114+ completion ( snapshot. image)
115+ }
115116 }
116117}
0 commit comments