タグ

2016年7月24日のブックマーク (4件)

  • Swift で MapKit のマップ上のピン画像を変えたい

    MapKitでピンはアノテーションとアノテーションビューいう概念で扱われます。 アノテーションが地図上の位置などを保持していて、それをピンの形など具体的に表現するのがアノテーションビューになります。 ということで、デフォルトではアノテーションはピンの形になるので、アノテーションビューに任意の画像を設定することで、好きな画像をピンの代わりに配置することができます。 例えば下記のようなコードになります。 アノテーションのカスタマイズはデリゲートで行うのでMKMapViewDelegateに準拠する宣言を書きます。 MKMapViewにデリゲートを設定します。 mapView(mapView:, viewForAnnotation:)メソッドで必要に応じてアノテーションビューを生成して、画像を設定して返します。アノテーションには現在地を示すマークなども含まれるので適宜判定します。 class V

    Swift で MapKit のマップ上のピン画像を変えたい
    enmtknt
    enmtknt 2016/07/24
  • MKPointAnnotation Tutorial

    The MKPointAnnotation is the basic version of an annotation that can be used to display a pin along with a title and subtitle. These can come in handy for displaying basic information on a map. If you want to do more than show a point on a map with a title, then you will need to use MKAnnotation and MKAnnotationView. We’ll look at both of those later in this tutorial. Note that you can change the

    MKPointAnnotation Tutorial
    enmtknt
    enmtknt 2016/07/24
  • Free vectors icons

    No notifications to show yet You’ll see useful information here soon. Stay tuned!

    Free vectors icons
    enmtknt
    enmtknt 2016/07/24
  • UIBarButtonItemで隠されたボタンを使用する

    UIBarButtonItemには、typeを指定して、標準で用意されている様々なアイコンを使用できます。 (ここに一覧が掲載されています。) しかし、< > ∧ ∨や、ゴミ箱アイコンといったものが用意されていません。 これを毎回画像で用意するのはしんどいし、"< >"と文字で生成するとなんかダサいし。。 ただ、標準アプリであるSafariとか、UINavigationBarの戻るボタン等、標準で< >を使っているのでなんとかして使えるなら使いたい。 それを解決してみます。 enum UIBarButtonHiddenItem: Int { case Previous = 101 case Next = 102 case Up = 103 case Down = 104 case Locate = 100 case Trash = 110 func convert() -> UIBarBu

    UIBarButtonItemで隠されたボタンを使用する