跳到主要內容

發表文章

目前顯示的是 7月, 2017的文章

udemy ios10

L12 mapView override func viewDidLoad() { super.viewDidLoad() mapView.delegate = self locationManager.delegate = self locationManager.desiredAccuracy = kCLLocationAccuracyBest locationManager.requestWhenInUseAuthorization() locationManager.startUpdatingLocation() } func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) { let location = CLLocationCoordinate2DMake(locations[0].coordinate.latitude, locations[0].coordinate.longitude) let span = MKCoordinateSpan(latitudeDelta: 0.05, longitudeDelta: 0.05) let region = MKCoordinateRegion(center: location, span: span) self.mapView.setRegion(region, animated: true) } 導航模式 ViewController     func mapView(_ mapView: MKMapView, annotationView view: MKAnnotationView, calloutAccessoryControlTapped control: UIControl) {         if transmittedLatitude != 0{             if transmittedLongitude != 0{       ...

udemy ios10 develope L7-L11

Animate Section 7,Lecture 57 let randomNumber = Int( arc4random_uniform (UInt32( kennyArray.count - 1 ))) Section 7,Lecture 59 if self.score > Int(highScoreLabel.text!)! {      UserDefaults.standard.set(self.score, forKey: "highscore")      highScoreLabel.text = String(self.score) } //會記錄在本機 let UserDefaults.standard.object(forKey: "highscore") Section 9 引用型別 override func prepare(for segue: UIStoryboardSegue, sender: Any?) { if segue.identifier == "toImageSegue" { let destinationVC = segue.destination as! ImageViewController destinationVC.selectedLandmarkName = chooseLandmarkName destinationVC.selectedLandmarkImage = chooseLandmarkImage   } }         }    Section 10 引用型別  另建一個Simpon.swift 及用Array包住Simpson instance override func prepare(for segue: UIStoryboardSegue, sender: Any?) { if segue.identifier == "toDetailVc"{ let VC2 = segue.destination as! DetailsViewControlle...