Safari Open URL
if #available(iOS 10.0, *) {
UIApplication.shared.open(url, options: [:])
} else {
UIApplication.shared.openURL(url)
reference
MKMapView - 현재 위치를 화면 중앙으로
func centerMapOnUserLocation() {
guard let coordinate = locationManager.location?.coordinate else { return }
let location: CLLocationCoordinate2D = CLLocationCoordinate2DMake(latitude, longitude)
let span = MKCoordinateSpan(latitudeDelta: 0.2, longitudeDelta: 0.2)
let region = MKCoordinateRegion(center: location, span: span)
let region = MKCoordinateRegion(center: coordinate, latitudinalMeters: 10000, longitudinalMeters: 10000)
map.setRegion(region, animated: true)
locationManager.startUpdatingLocation()
}
클립보드로 붙여넣기
import UIKit
UIPasteboard.general.string = "복사를 해버렷!!!!"
if let theString = UIPasteboard.general.string {
print("문자를 가져와버렸!!! \(theString)")
}
reference