<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>iOS on Aamnah - Frontend Web Developer</title>
    <link>https://aamnah.com/notes/ios/</link>
    <description>Recent content in iOS on Aamnah - Frontend Web Developer</description>
    <generator>Hugo</generator>
    <language>en-us</language>
    <lastBuildDate>Sun, 18 Oct 2026 22:10:00 +0300</lastBuildDate>
    <atom:link href="https://aamnah.com/notes/ios/rss.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Install Ruby with rbenv and CocoaPods on M1 MacBook (Apple Silicon)</title>
      <link>https://aamnah.com/notes/ios/ruby-rbenv-cocoapods-m1-macbook-apple-silicon/</link>
      <pubDate>Sun, 20 Jun 2021 21:26:10 +0500</pubDate>
      <guid>https://aamnah.com/notes/ios/ruby-rbenv-cocoapods-m1-macbook-apple-silicon/</guid>
      <description>&lt;ol&gt;&#xA;&lt;li&gt;install &lt;a href=&#34;https://brew.sh/&#34;&gt;Homebrew&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;Install Ruby with &lt;a href=&#34;https://github.com/rbenv/rbenv&#34;&gt;rbenv&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;Install &lt;a href=&#34;https://guides.cocoapods.org/using/getting-started.html#getting-started&#34;&gt;CocoaPods&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;Doing your own Ruby installation instead of using the system one is preferred, either with Homebrew or &lt;code&gt;rbenv&lt;/code&gt;. Apple is &lt;a href=&#34;https://github.com/ffi/ffi/issues/870#issuecomment-756989318&#34;&gt;deprectaing the default system installation of Ruby&lt;/a&gt; anyway.&lt;/p&gt;&#xA;&lt;h2 id=&#34;homebrew-rbenv-and-ruby&#34;&gt;Homebrew, rbenv and Ruby&lt;/h2&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 1&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;# install homebrew&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 2&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;/bin/bash -c &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;$(&lt;/span&gt;curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh&lt;span class=&#34;k&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 3&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 4&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;# install ruby with rbenv&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 5&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;brew install rbenv &lt;span class=&#34;c1&#34;&gt;# ruby-build is included&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 6&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;rbenv install 3.0.1&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 7&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;rbenv global 3.0.1 &lt;span class=&#34;c1&#34;&gt;# set system default ruby version&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 8&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt; 9&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;ruby -v&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;10&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;# ruby 3.0.1p64 (2021-04-05 revision 0fb782ee38) [arm64-darwin20]&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;rbenv install -l &lt;span class=&#34;c1&#34;&gt;# list versions that can be installed&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;2&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;rbenv versions &lt;span class=&#34;c1&#34;&gt;# list installed ruby versions&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;3&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;rbenv global 3.0.1 &lt;span class=&#34;c1&#34;&gt;# set system default ruby version&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&#34;cocoapods&#34;&gt;Cocoapods&lt;/h2&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;gem install ffi cocoapods&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;2&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;rbenv rehash &lt;span class=&#34;c1&#34;&gt;# run a rehash after installing gems (or a new Ruby version) to make sure everything new is on your PATH:&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;sudo&lt;/code&gt; is not needed for Ruby versions installed with &lt;code&gt;rbenv&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;ffi&lt;/code&gt; is needed here to get rid of some ffi related LoadError&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;rbenv rehash&lt;/code&gt; is important, otherwise the Podfile will keep using the old system installed Ruby&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Now you can go to your iOS project and do &lt;code&gt;pod repo update &amp;amp;&amp;amp; pod install&lt;/code&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>CocoaPods on M1 MacBooks (Apple Silicon based chip)</title>
      <link>https://aamnah.com/notes/ios/cocoapods-m1-macs/</link>
      <pubDate>Mon, 24 Feb 2020 00:00:01 +0500</pubDate>
      <guid>https://aamnah.com/notes/ios/cocoapods-m1-macs/</guid>
      <description>&lt;p&gt;CocoaPods doesn&amp;rsquo;t work out of the box on M1 Macs. Something about &lt;code&gt;ffi&lt;/code&gt; and &lt;em&gt;arch&lt;/em&gt; stuff. There are workarounds though.&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Open Terminal / iTerm with Rosetta (Get Info &amp;gt; Open using Rosetta)&lt;/li&gt;&#xA;&lt;li&gt;Install CocoaPods related commands with &lt;code&gt;arch -x86_64&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;# install CocoaPods&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;2&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;arch -x86_64 sudo gem install cocoapods&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;3&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;4&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;# install ffi&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;5&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;arch -x86_64 sudo gem install ffi&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;6&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;7&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;# install dependencies&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;8&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;arch -x86_64 pod install&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&#34;links&#34;&gt;Links&lt;/h2&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://github.com/CocoaPods/CocoaPods/issues/9907&#34;&gt;CocoaPods compatibility with Apple DTK (Apple Silicon)&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;</description>
    </item>
    <item>
      <title>iOS, Bluetooth Low Energy (BLE), CoreBluetooth and Swift - for noobs</title>
      <link>https://aamnah.com/notes/ios/intro-ios-bluetooth-low-energy-ble-corebluetooth-swift-noobs/</link>
      <pubDate>Sun, 28 Aug 2016 15:35:22 +0500</pubDate>
      <guid>https://aamnah.com/notes/ios/intro-ios-bluetooth-low-energy-ble-corebluetooth-swift-noobs/</guid>
      <description>&lt;p&gt;This &lt;a href=&#34;https://realm.io/news/yoav-schwartz-corebluetooth-peripherals/&#34;&gt;talk by Yoav Shwartz&lt;/a&gt; on the Realm.io site and this &lt;a href=&#34;https://medium.com/@ryanjjones10/how-to-set-up-ble-with-swift-2-2-34bb6f209de2&#34;&gt;post by Ryan Jones&lt;/a&gt; on Medium are the best starting points I have come across.&lt;/p&gt;&#xA;&lt;p&gt;The official documentation by Apple on CoreBluetooth is in Objective-C, which sucks because Objective-C looks like gibberish to me and i want to write Swift code. You can still read the docs though, they have listed &lt;a href=&#34;https://developer.apple.com/library/ios/documentation/NetworkingInternetWeb/Conceptual/CoreBluetooth_concepts/BestPracticesForInteractingWithARemotePeripheralDevice/BestPracticesForInteractingWithARemotePeripheralDevice.html&#34;&gt;best practices&lt;/a&gt; to work with BLE and CoreBluetooth.&lt;/p&gt;&#xA;&lt;p&gt;You do need to have an iOS device in order to use CoreBluetooth, it is not supported in the Simulator. It was, originally, but they removed it after a year because BLE got more advanced and it was difficult to remove inconsistencies between Mac and iPhone implementations, or sumthin&amp;rsquo; like that..&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
