mapkit

MapKit in Swift, Part 3 - MKPointAnnotation, addAnnotations

亡梦爱人 提交于 2021-01-28 21:34:32
问题 I'm trying work with Map Kit in Swift. I try to display the area on the map, some pins (MKPointAnnotation) and the current position. I decided to extend the class MKPointAnnotation - add a category. Class MyAnnotation.swift: import UIKit import MapKit class MyAnnotation: MKPointAnnotation { var category = Int() } I made an array of tuples to store information about the objects. In the loop I process all the elements of this array and make from it an array MyAnnotation . Then, I try to display

Member access into incomplete type 'CALayer'

对着背影说爱祢 提交于 2021-01-27 11:52:26
问题 For the code below : CGRect frame = CGRectMake(0, 0, cellWidth, 240); MKMapView *mapView = [[MKMapView alloc] initWithFrame:frame]; mapView.layer.masksToBounds = YES; mapView.layer.cornerRadius = 10.0; I included MapKit,QuartzCore and CoreLocation Frameworks in addition. For the last 2 lines, I am getting error : "Member access into incomplete type 'CALayer'" Please tell me why I get this error and how to resolve this EDIT: I got this error as I did not import Quartz.h, but i still dont

Subclassing MKCircle in Swift

天涯浪子 提交于 2021-01-27 04:07:08
问题 I'd like to subclass MKCircle (e.g. MyCircle ) by adding another String property, let's call it " code ". This property shall not be an optional and constant, so I have to set it from an initializer, right? Of course MyCircle should also get center coordinate and the radius. These two properties are read-only, so I also need to set them via initializer. In the end I need an initializer that takes 3 parameters: coordinate , radius and code . Sounds pretty easy but Swifts designated and

Subclassing MKCircle in Swift

心已入冬 提交于 2021-01-27 04:06:50
问题 I'd like to subclass MKCircle (e.g. MyCircle ) by adding another String property, let's call it " code ". This property shall not be an optional and constant, so I have to set it from an initializer, right? Of course MyCircle should also get center coordinate and the radius. These two properties are read-only, so I also need to set them via initializer. In the end I need an initializer that takes 3 parameters: coordinate , radius and code . Sounds pretty easy but Swifts designated and

Subclassing MKCircle in Swift

流过昼夜 提交于 2021-01-27 04:06:12
问题 I'd like to subclass MKCircle (e.g. MyCircle ) by adding another String property, let's call it " code ". This property shall not be an optional and constant, so I have to set it from an initializer, right? Of course MyCircle should also get center coordinate and the radius. These two properties are read-only, so I also need to set them via initializer. In the end I need an initializer that takes 3 parameters: coordinate , radius and code . Sounds pretty easy but Swifts designated and

Xcode - Debug View Hierarchy

走远了吗. 提交于 2021-01-27 03:53:15
问题 I'm trying to debug my app's view hierarchy and a little purple square appeared on the left pane of Xcode's window (see screenshot). Any idea what that issue could be? 回答1: Alright! I found where this issue comes from… It's a constraint issue!!! 来源: https://stackoverflow.com/questions/49664266/xcode-debug-view-hierarchy

Xcode - Debug View Hierarchy

僤鯓⒐⒋嵵緔 提交于 2021-01-27 03:50:19
问题 I'm trying to debug my app's view hierarchy and a little purple square appeared on the left pane of Xcode's window (see screenshot). Any idea what that issue could be? 回答1: Alright! I found where this issue comes from… It's a constraint issue!!! 来源: https://stackoverflow.com/questions/49664266/xcode-debug-view-hierarchy