<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>Iganin</author_name>
  <author_url>https://blog.hatena.ne.jp/Iganin/</author_url>
  <blog_title>Iganinのブログ</blog_title>
  <blog_url>https://iganin.hatenablog.com/</blog_url>
  <categories>
    <anon>iOS</anon>
    <anon>UIKit</anon>
    <anon>技術</anon>
  </categories>
  <description>はじめに アプリを作成する際に通知の数をバッジで表現することがよくあります。たとえば通知タブを作成し、タブにバッジを表示する、UIApplication.shared.badgeNumberに値を設定してアプリアイコンにバッジをつけるといった対応です。 開発を行う中で画面のナビゲーションバー部分にバッジを付与したいと行ったケースが発生することがあります。ただ、UIBarButtonItemには通常バッジはデフォルトでは表示できないためひと工夫が必要です。 本記事ではサードパーティーのライブラリに頼らずUIBarButtonItemにバッジを表示する方法を記載します。 環境設定 以下の環境を使用…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Figanin.hatenablog.com%2Fentry%2F2020%2F02%2F09%2F161206&quot; title=&quot;【iOS】NavigationBarのUIBarButtonItemにバッジを付与する方法 - Iganinのブログ&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2020-02-09 16:12:06</published>
  <title>【iOS】NavigationBarのUIBarButtonItemにバッジを付与する方法</title>
  <type>rich</type>
  <url>https://iganin.hatenablog.com/entry/2020/02/09/161206</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
