<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Ibrahim Ulukaya on Medium]]></title>
        <description><![CDATA[Stories by Ibrahim Ulukaya on Medium]]></description>
        <link>https://medium.com/@ulukaya?source=rss-a50102e58511------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*qMJswDIKDVoDoESOPQA5nQ.jpeg</url>
            <title>Stories by Ibrahim Ulukaya on Medium</title>
            <link>https://medium.com/@ulukaya?source=rss-a50102e58511------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 23:42:57 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ulukaya/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[See how ML Kit and ARKit play together]]></title>
            <link>https://medium.com/firebase-developers/see-how-ml-kit-and-arkit-play-together-54ba8136766e?source=rss-a50102e58511------2</link>
            <guid isPermaLink="false">https://medium.com/p/54ba8136766e</guid>
            <category><![CDATA[firebase]]></category>
            <category><![CDATA[ar]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[arkit]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Ibrahim Ulukaya]]></dc:creator>
            <pubDate>Mon, 17 Dec 2018 00:00:00 GMT</pubDate>
            <atom:updated>2019-01-10T16:06:25.034Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xVqEnBFwQegzi6gZQWvdCQ.png" /></figure><p>We at the Firebase office all enjoyed playing with Hanley Weng’s “<a href="https://github.com/hanleyweng/CoreML-in-ARKit">CoreML-in-ARKit</a>” project. It displays 3D labels on top of images it detects in the scene. While the on-device detection provides a fast response, we wanted to build a solution that gave you the speed of the on-device model with the accuracy you can get from a cloud-based solution. Well, that’s exactly what we built with our MLKit-ARKit project. Read on to find out more about how we did it!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*Tt66sfMiUn0lRNnD_LQrOA.gif" /><figcaption>This image takes a while to load, but it’s worth it.</figcaption></figure><h3>How it all works</h3><p><strong>ML Kit for Firebase </strong>is a mobile SDK that enables developers to bring Google’s machine learning (ML) expertise to their Android and iOS apps. It includes easy-to-use on-device and cloud-based Base APIs and also offers the ability to bring your own custom TFLite models.</p><p><strong>ARKit</strong> is Apple’s framework that combines device motion tracking, camera scene capture, advanced scene processing, and display conveniences to simplify the task of building an AR experience. You can use these technologies to create many kinds of AR experiences using either the back camera or front camera of an iOS device.</p><p>In this project we are pushing ARKit frames from the back camera into a queue. ML Kit processes these to find out the objects in that frame.</p><p>When the user taps the screen, ML Kit returns the detected label with the highest confidence. We then create a 3D bubble text and add it into the user’s scene.</p><h4>How ML Kit works</h4><p>ML Kit makes ML easy for all mobile developers, whether you have experience in ML or are new to the space. For those with more advanced use cases, ML Kit allows you to bring your own TFLite models, but for more common use cases, you can implement one of the easy-to-use Base APIs. These APIs cover use cases such as text recognition, image labeling, face detection and more. We’ll be using image labeling in our example.</p><p>Base APIs are available in two flavors: On-device and cloud-based. The on-device APIs are free to use and run locally, while the cloud-based ones provide higher accuracy and more precise responses. Cloud-based Vision APIs are free for the first 1000/API calls and paid after that. They provide the power of full-sized models from Google’s Cloud Vision APIs.</p><h4>Hybrid approach</h4><p>We are using the ML Kit on-device image labeling API to get a live feed of results while keeping our frame rate steady at 60fps. When the user taps the screen we fire up an async call to the Cloud image labeling API with the current image. When we get a response from this higher accuracy model, we update the 3D label on the fly. So while we are continuously running the on-device API and using its result as the initial source of information, the higher accuracy Cloud API is called on-demand and its results replaces on-device label eventually.</p><p><strong>Which result to show?</strong></p><p>While the on-device API is real-time with all the processing happening locally, the Cloud Vision API makes a network request to the Google Cloud backend, leveraging a larger, higher accuracy model. Once the response arrives, we replace the label provided by the on-device API with the result from Cloud Vision API.</p><h3>Try it yourself!</h3><p>1. Clone the project</p><pre>$ git clone <a href="https://github.com/FirebaseExtended/MLKit-ARKit.git">https://github.com/FirebaseExtended/MLKit-ARKit.git</a></pre><p>2. Install the pods and open the .xcworkspace file to see the project in Xcode.</p><pre>$ cd MLKit-ARKit<br>$ pod install — repo-update<br>$ open MLKit-ARKit.xcworkspace</pre><p>3. To set up the Firebase ML Kit in the sample app:3. To set up the Firebase ML Kit in the sample app:</p><ul><li>Follow these instructions for <a href="https://firebase.google.com/docs/ios/setup">adding Firebase to your app</a>.</li><li>Make sure to specify “com.google.firebaseextended.MLKit-ARKit” as the iOS project bundle ID.</li><li>Download the GoogleService-Info.plist file generated as part of adding Firebase to your app.</li><li>In Xcode, add the GoogleService-Info.plist file to your app, next to Info.plist.</li></ul><p>At this point, the app should work using the on-device recognition.</p><p>4. (Optional) To set up Cloud Vision API in the sample app:</p><p>a .Switch your Firebase project to the Blaze plan — <strong>Only Blaze-level projects can use the Cloud Vision APIs. Follow these steps to switch your project to the Blaze plan and enable pay-as-you-go billing.</strong></p><ul><li>Open your project in the <a href="https://console.firebase.google.com/">Firebase console</a>.</li><li>Click on the <strong>MODIFY</strong> link in the lower left corner next to the currently selected Spark plan.</li><li>Select the Blaze plan and follow the instructions in the Firebase Console to add a billing account.</li></ul><blockquote>The cloud label detection feature is still free for first 1000 uses per month. Click here to see additional pricing details.</blockquote><ul><li>Go to the ML Kit section of the Firebase console and enable the “Cloud Based APIs” toggle at the top.</li></ul><p>At this point, the app should update labels with more precise results from the Cloud Vision API.</p><p><em>Originally published at </em><a href="https://firebase.googleblog.com/2018/12/see-how-ml-kit-and-arkit-play-together.html"><em>firebase.googleblog.com</em></a><em> on December 17, 2018.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=54ba8136766e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/firebase-developers/see-how-ml-kit-and-arkit-play-together-54ba8136766e">See how ML Kit and ARKit play together</a> was originally published in <a href="https://medium.com/firebase-developers">Firebase Developers</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Create an Xcode Linter for Swift]]></title>
            <link>https://medium.com/google-developers/creating-linting-rules-for-firebase-ec51fcb7623a?source=rss-a50102e58511------2</link>
            <guid isPermaLink="false">https://medium.com/p/ec51fcb7623a</guid>
            <category><![CDATA[ios-app-development]]></category>
            <category><![CDATA[linter]]></category>
            <category><![CDATA[firebase]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[swift]]></category>
            <dc:creator><![CDATA[Ibrahim Ulukaya]]></dc:creator>
            <pubDate>Tue, 08 Aug 2017 21:08:53 GMT</pubDate>
            <atom:updated>2017-08-10T16:31:36.196Z</atom:updated>
            <content:encoded><![CDATA[<h4><a href="https://github.com/realm/SwiftLint">SwiftLint</a> is a great open source tool that makes it easier for you to follow Swift style and conventions. It also helps with identifying possible errors early by highlighting problematic usage. You can run SwiftLint on your Xcode project to see all the style guide exceptions on the lines where they occur, and fix them quickly. I found it was a great help when<a href="https://medium.com/google-developers/migrating-from-objective-c-to-swift-googlecast-reference-app-81030ce814ce"> I migrated my code from Objective-c to Swift</a>.</h4><p>In the spirit of making SwiftLint even more useful for Firebase developers, we’ve added some experimental new Firebase rules into SwiftLint. These rules will display warnings on common mistakes that might lead to errors when using the Firebase SDK.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Tg8KjizASPGepWKfwvoGHg.jpeg" /></figure><p>Having zero knowledge about developing linters or rules, I dived into SwiftLint rules. SwiftLint is designed to enforce style conventions. Thus most of its rules are checking the occurrence of certain keywords or characters. And where they exist. But in Firebase rules I had a different target. Right method calls must be in the right files within the scope of right functions. For example FirebaseCore rules. We want to make sure <a href="https://firebase.google.com/docs/reference/ios/firebasecore/api/reference/Classes/FIRApp#/c:objc(cs)FIRApp(cm)configure">FirebaseApp.configure()</a> is called. And it’s called inside the UIApplicationDelegate’s <a href="https://developer.apple.com/documentation/uikit/uiapplicationdelegate/1622921-application?language=objc">application:didFinishLaunchingWithOptions</a>: function.</p><p>My <a href="https://github.com/realm/SwiftLint/pull/1346">initial attempt</a> was doing a complicated regex check. To find the specific class function, than the Firebase method call, and see if they were in the same boundary. This turned out be quite inefficient and stalled Xcode.</p><p>I went through SwiftLint’s helper function and found that there is a already a <a href="https://github.com/realm/SwiftLint/blob/master/Source/SwiftLintFramework/Extensions/File%2BSwiftLint.swift#L211">function</a> doing this for me.</p><pre>func match(pattern: String,<br>           range: NSRange? = nil,<br>           excludingSyntaxKinds: [SyntaxKind],<br>           excludingPattern: String,             <br>           exclusionMapping: MatchMapping = { $0.range })-&gt;[NSRange]</pre><p>This finds if a pattern occurs, while the other one doesn’t. This way I finally started seeing results and making the rules work.</p><p>I took this as a <a href="https://github.com/realm/SwiftLint/pull/1346">first pull request attempt</a>. But I found out that this would create too many false-positives. Since I was doing a basic regex check instead of a real syntax check. This made me to deep dive to SwiftLint to understand how it actually does the syntax checking.</p><p>Underneath the SwiftLint, there is a adorable little framework called <a href="https://github.com/jpsim/SourceKitten">SourceKitten.</a> It interacts with SourceKit to parse the Swift AST. Once you have the AST, you can do the proper syntax checking.</p><pre>{<br>  &quot;key.substructure&quot; : [<br>    {<br>      &quot;key.kind&quot; : &quot;source.lang.swift.decl.struct&quot;,<br>      &quot;key.offset&quot; : 0,<br>      &quot;key.nameoffset&quot; : 7,<br>      &quot;key.namelength&quot; : 1,<br>      &quot;key.bodyoffset&quot; : 10,<br>      &quot;key.bodylength&quot; : 13,<br>      &quot;key.length&quot; : 24,<br>      &quot;key.substructure&quot; : [<br>        {<br>          &quot;key.kind&quot; : &quot;source.lang.swift.decl.function.method.instance&quot;,<br>          &quot;key.offset&quot; : 11,<br>          &quot;key.nameoffset&quot; : 16,<br>          &quot;key.namelength&quot; : 3,<br>          &quot;key.bodyoffset&quot; : 21,<br>          &quot;key.bodylength&quot; : 0,<br>          &quot;key.length&quot; : 11,<br>          &quot;key.substructure&quot; : [<br><br>          ],<br>          &quot;key.name&quot; : &quot;b()&quot;<br>        }<br>      ],<br>      &quot;key.name&quot; : &quot;A&quot;<br>    }<br>  ],<br>  &quot;key.offset&quot; : 0,<br>  &quot;key.diagnostic_stage&quot; : &quot;source.diagnostic.stage.swift.parse&quot;,<br>  &quot;key.length&quot; : 24<br>}</pre><p>This way I went back to Firebase quickstarts, printed out their Swift AST from this tool’s CLI. I used SourceKitten’s <a href="https://github.com/realm/SwiftLint/blob/master/Source/SwiftLintFramework/Extensions/SwiftExpressionKind.swift">SwiftExpressionKind</a> and <a href="https://github.com/realm/SwiftLint/blob/master/Source/SwiftLintFramework/Extensions/SwiftDeclarationKind%2BSwiftLint.swift">SwiftDeclarationKind</a>. Then iterated through the AST. This way I finally had solid rules. They were checking the exact function and syntax kinds in exact files. I realized the available helper recursive functions were not enough for my case. So I <a href="https://github.com/firebase/SwiftLint/blob/firebase_rules/Source/SwiftLintFramework/Protocols/RecursiveRule.swift">extended</a> them for my use to achieve this goal.</p><pre>public func validateRecursive(dictionary: [String:  <br>    SourceKitRepresentable]) -&gt; Bool {<br>  if validateBaseCase(dictionary: dictionary) {<br>    return true<br>  }<br>  for subDict in dictionary.substructure {<br>    if validateRecursive(dictionary: subDict) {                   <br>      return true<br>    }<br>  }<br>  return false<br>}</pre><p>After finishing my unit tests, I was back with <a href="https://github.com/realm/SwiftLint/pull/1407">another PR</a>. This time the missing part was the examples. Each SwiftLint rule comes with triggering and non-triggering examples. It helps with readability of your code. But the examples are also used in unit tests. By putting more examples, I checked further false-positives as well false-negatives.</p><pre>public static let description = RuleDescription(<br>  identifier: &quot;firebase_config_activate&quot;,<br>  name: &quot;Firebase Config Activate&quot;,<br>  description: &quot;Firebase Config should be activated.&quot;,          <br>  <br>  <strong>nonTriggeringExamples</strong>: [              <br>    &quot;remoteConfig.fetch(withExpirationDuration:    <br>        TimeInterval(expirationDuration)) {&quot; +                 <br>        &quot; (status, error) -&gt; Void in \n <br>            self.remoteConfig.activateFetched() \n }&quot;,            <br>    &quot;foo.fetch() { }&quot;,<br>    &quot;foo.fetch(fromURL: URL) { }&quot;<br>  ],<br>  <br>  <strong>triggeringExamples</strong>: [              <br>    &quot;remoteConfig.fetch(withExpirationDuration: <br>        TimeInterval(expirationDuration)) {&quot; +                <br>        &quot; (status, error) -&gt; Void in \n }&quot;,            <br>    &quot;remoteConfig.fetch(withExpirationDuration: <br>        TimeInterval(expirationDuration)) {&quot; +<br>        &quot; (status, error) -&gt; Void in \n foo.fetch() \n }&quot;<br>  ]<br>)</pre><blockquote>Currently we are hosting the rules on<a href="https://github.com/firebase/swiftlint/tree/firebase_rules"> our fork in a firebase_rules branch</a>. Our<a href="https://github.com/firebase/SwiftLint/releases/tag/0.1"> pre-release binary</a> holds the Firebase rules. You can simply download the .pkg file and double click to install. You can also build the binary from the source.</blockquote><blockquote>Since the rules are opt-in, you’ll need to add a <strong>.swiftlint.yml</strong> file in the same folder as your Swift source files, containing the following text:</blockquote><pre>opt_in_rules:<br>  - firebase_config_activate<br>  - firebase_config_defaults<br>  - firebase_config_fetch<br>  - firebase_core<br>  - firebase_dynamiclinks_customschemeURL<br>  - firebase_dynamiclinks_schemeURL<br>  - firebase_dynamiclinks_universallink<br>  - firebase_invites</pre><p>Then, just run SwiftLint on your project like normal.</p><p>We’d love for you to give it a try and send us feedback on Twitter with #FirebaseLinter. You can also ask questions on <a href="https://stackoverflow.com/questions/tagged/firebase+swiftlint">StackOverflow</a> using the firebase and swiftlint tags together.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ec51fcb7623a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/google-developers/creating-linting-rules-for-firebase-ec51fcb7623a">How to Create an Xcode Linter for Swift</a> was originally published in <a href="https://medium.com/google-developers">Google Developers</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to migrate iOS API Reference from Doxygen to Jazzy]]></title>
            <link>https://medium.com/google-developers/how-to-migrate-ios-api-reference-from-doxygen-to-jazzy-35bd89c6a92b?source=rss-a50102e58511------2</link>
            <guid isPermaLink="false">https://medium.com/p/35bd89c6a92b</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[api]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[ios-app-development]]></category>
            <category><![CDATA[swift]]></category>
            <dc:creator><![CDATA[Ibrahim Ulukaya]]></dc:creator>
            <pubDate>Tue, 25 Apr 2017 23:42:49 GMT</pubDate>
            <atom:updated>2017-04-25T23:44:52.301Z</atom:updated>
            <content:encoded><![CDATA[<p>… and start supporting Swift. At Firebase, <a href="https://medium.com/@ulukaya/how-to-generate-fabulous-api-reference-docs-for-ios-5bd297b9697d">we moved our iOS API reference docs from Doxygen to Jazzy</a>. Here are the issues we faced and the full migration guide.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_KBWvOI6HTmj_EHJ_BBQRg.jpeg" /><figcaption>Jazzy console output</figcaption></figure><h4>Add comments for all interfaces, protocols, properties, methods, enums, structs, and typedefs</h4><p>If you don’t have documentation for one of these elements, Jazzy will still include it in the output, marked as “undocumented”. You can use the --skip-documentation parameter with <em>jazzy</em> script to see which declarations in your public headers are missing documentation.</p><p><strong>Causes Jazzy Error</strong></p><pre>@property(nonatomic, copy) NSString *someProperty;</pre><p><strong>Fix</strong></p><pre>/// This is a comment for someProperty.<br>@property(nonatomic, copy) NSString *someProperty;</pre><p><strong>Alternate Fix</strong></p><pre>///<br>@property(nonatomic, copy) NSString *someProperty;</pre><h3>Use documentation tags supported by Jazzy</h3><p>Jazzy currently only supports the following documentation tags. Do not use @brief, @var, @enum, @protocol, @discussion, or @remarks as they are not currently supported by jazzy. To see the formatting for Quick Help in Xcode, press and hold the “option” key and click on the method name or property.</p><ol><li>@see</li><li>@param</li><li>@return</li><li>&lt;code&gt;&lt;/code creates a link to a constant, property, or method and should be used instead of @link (use &lt;code&gt;&lt;/code with @see)</li><li>&lt;pre&gt; instead of \code or @code</li><li>&lt;/pre&gt; instead of \endcode or @endcode</li></ol><p><strong>Fix</strong></p><pre>/// This is the description for a method.<br>///<br>/// @see &lt;code&gt;someProperty&lt;/code&gt;<br>/// @see &lt;code&gt;-someMethod:&lt;/code&gt;<br>///<br>/// &lt;pre&gt;<br>/// // This is a comment inside a code snippet.<br>/// // @code and @endcode are not currently supported by<br>/// // jazzy. Use &lt;pre&gt; and &lt;/pre&gt; instead.<br>/// NSString *someString = [[NSString alloc] init];<br>/// &lt;/pre&gt;<br>///</pre><pre>/// @param someParam1 This is a description for someParam1.<br>/// @param someParam2 This is a description for someParam2.<br>///<br>/// @return Description of the return value.<br>(NSString *)someMethodWithParam1:(NSString *)someParam1 <br>                          param2:(NSString *)someParam2;</pre><p><strong>Alternate Fix</strong></p><pre>/**<br> * This is the description for a method.<br> *<br> * @see &lt;code&gt;someProperty&lt;/code&gt;<br> * @see &lt;code&gt;-someMethod:&lt;/code&gt;<br> *<br> * &lt;pre&gt;<br> * // This is a comment inside a code snippet.<br> * // @code and @endcode are not currently supported by<br> * // jazzy. Use &lt;pre&gt; and &lt;/pre&gt; instead.<br> * NSString *someString = [[NSString alloc] init];<br> * &lt;/pre&gt;<br> *<br> * @param someParam1 This is a description for someParam1.<br> * @param someParam2 This is a description for someParam2.<br> *<br> * @return Description of the return value.<br> */<br>(NSString *)someMethodWithParam1:(NSString *)someParam1<br>                          param2:(NSString *)someParam2;</pre><h3>Add blank lines before and after the @param block</h3><p>There needs to be a newline between the last description paragraph and the first parameter block. There also needs to be a newline before the @return block. Otherwise the parameters and return value show up in both the description (badly formatted).</p><p><strong>Causes Jazzy Error</strong></p><pre>/**<br> * Use removeObserverWithHandle: to stop receiving updates.<br> * @param eventType The type of event to listen for.<br> * @param block The block that should be called with initial data.<br> * @return A handle used to unregister this block later.<br> */</pre><p><strong>Fix</strong></p><pre>/**<br> * Use removeObserverWithHandle: to stop receiving updates.<br> *<br> * @param eventType The type of event to listen for.<br> * @param block The block that should be called with initial data.<br> *<br> * @return A handle used to unregister this block later.<br> */</pre><p>Use #pragma mark instead of @name</p><p>Do not use @name tags, they show up with the */ characters appended to the end in the Jazzy built files. Use #pragma mark instead.</p><p><strong>Causes Jazzy Error</strong></p><pre>/** @name Attach observers to read data */</pre><p><strong>Fix</strong></p><pre>#pragma mark — Attach observers to read data</pre><h3>Use + instead of * in Markdown lists</h3><p>Do not use * Markdown syntax to create bulleted lists, they won’t show up as lists and the * characters are left behind, making things look like pointers.</p><p><strong>Causes Jazzy Error</strong></p><pre>/**<br> * To modify the data, set its value property to any of the native<br> * types support by Firebase Database:<br> * * NSNumber (includes BOOL)<br> * * NSDictionary<br> * * NSArray<br> * * NSString<br> * * nil / NSNull to remove the data<br> */</pre><p><strong>Fix</strong></p><pre>/**<br> * To modify the data, set its value property to any of the native<br> * types support by Firebase Database:<br> *<br> * + NSNumber (includes BOOL)<br> * + NSDictionary<br> * + NSArray<br> * + NSString<br> * + nil / NSNull to remove the data<br> */</pre><h3>Use HTML syntax for error-code lists</h3><p>If you don’t, Jazzy puts them all together on one line. Also need a — character between the error code name and the description.</p><p><strong>Causes Jazzy Error</strong></p><pre>@remarks Possible error codes:<br>- @c FIRAuthErrorCodeInvalidCustomToken Indicates a validation error with the custom token.<br>- @c FIRAuthErrorCodeCustomTokenMismatch Indicates the service account and the API key belong to different projects.</pre><p><strong>Fix</strong></p><pre>@remarks Possible error codes:<br>&lt;ul&gt;<br>  &lt;li&gt;@c FIRAuthErrorCodeInvalidCustomToken — Indicates a validation error with the custom token.&lt;/li&gt;<br>  &lt;li&gt;@c FIRAuthErrorCodeCustomTokenMismatch — Indicates the service account and the API key belong to different projects.&lt;/li&gt;<br>&lt;/ul&gt;</pre><p><strong>Note: </strong>the &lt;ul&gt; must not have an empty line between it and the line above or it will end up in a separate &lt;p&gt; tag and not show bullets.</p><h3>No @c tags inside @param or @return tags</h3><p>They break the build.</p><p><strong>Causes Jazzy Error</strong></p><pre>@param app The @c FIRApp for which to retrieve the associated @c FIRAuth instance.<br>@return The @c FIRAuth instance associated with the given @c FIRApp.</pre><p><strong>Fix</strong></p><pre>@param app The FIRApp for which to retrieve the associated FIRAuth instance.<br>@return The FIRAuth instance associated with the given FIRApp.</pre><h3>No smart quotes (“”)</h3><p>They get passed through by Jazzy and cause warnings when you add the generated docs to a CL.</p><p><strong>Causes Jazzy Error</strong></p><pre>“One account per email address”</pre><p><strong>Fix</strong></p><pre>&quot;One account per email address&quot;</pre><h3>Use nullable and nonnull in Objective-C public headers</h3><p>Audit Objective-C public headers with <a href="https://developer.apple.com/swift/blog/?id=25">nullability annotations</a> for interoperability with Swift code. Simple pointers that can be <em>nil</em> in Objective-C should be annotated as <em>nullable</em> so that they are mapped properly to optional types in Swift.</p><p><strong>Causes Swift to map everything to implicitly unwrapped optional</strong></p><pre>- (AAPLListItem *)itemWithName:(NSString *)name;</pre><p><strong>Fix</strong></p><pre>- (nullable AAPLListItem *)itemWithName:(nonnull NSString *)name;</pre><p>For more information, see <a href="https://developer.apple.com/swift/blog/?id=25">Nullability and Objective-C</a> in the Apple Developer Blog.</p><h3>Hide documentation for private/pre-release properties and methods with :nodoc:</h3><p>Properties and methods sometimes make it into header files before you’re ready to document them. To skip documenting these properties or methods, add :nodoc: to their comment, like so:</p><pre>/**<br> * A new authorization token that we’re not ready to document yet.<br> * :nodoc:<br> */<br>@property(nonatomic, copy) NSString *authToken;</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=35bd89c6a92b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/google-developers/how-to-migrate-ios-api-reference-from-doxygen-to-jazzy-35bd89c6a92b">How to migrate iOS API Reference from Doxygen to Jazzy</a> was originally published in <a href="https://medium.com/google-developers">Google Developers</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to generate fabulous API reference docs for iOS]]></title>
            <link>https://medium.com/google-developers/how-to-generate-fabulous-api-reference-docs-for-ios-5bd297b9697d?source=rss-a50102e58511------2</link>
            <guid isPermaLink="false">https://medium.com/p/5bd297b9697d</guid>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[api]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[ios-app-development]]></category>
            <category><![CDATA[ios]]></category>
            <dc:creator><![CDATA[Ibrahim Ulukaya]]></dc:creator>
            <pubDate>Tue, 25 Apr 2017 23:41:59 GMT</pubDate>
            <atom:updated>2017-04-25T23:43:46.432Z</atom:updated>
            <content:encoded><![CDATA[<p>At Firebase, we were using <a href="http://www.stack.nl/~dimitri/doxygen/">Doxygen</a> to generate <a href="https://firebase.google.com/docs/reference/ios/firebasecore/api/reference/Classes">iOS API reference docs</a>. While it did the job for ObjectiveC, it wasn’t supporting Swift. We started using <a href="https://github.com/realm/jazzy">Jazzy</a> for the look and feel of Apple’s official reference documentation. The documentation which iOS developers are used to.</p><p><a href="https://github.com/realm/jazzy">jazzy</a> is a command-line utility that generates documentation for Swift or Objective-C.<em> </em>It<em> </em>is composed of two parts:</p><ol><li>The parser, <a href="https://github.com/jpsim/SourceKitten">SourceKitten</a> (written in Swift)</li><li>The site generator (written in ruby)</li></ol><p>It leverages</p><ul><li>modern HTML templating (<a href="http://mustache.github.io/">Mustache</a>)</li><li>the power and accuracy of the <a href="http://clang.llvm.org/docs/IntroductionToTheClangAST.html">Clang AST</a> and <a href="http://www.jpsim.com/uncovering-sourcekit">SourceKit</a></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LP1jnAzlUxe6wxYFDaX5WQ.jpeg" /><figcaption>Firebase iOS API Reference documentation</figcaption></figure><p>In our setup, we have a shell script. It</p><ul><li>simplifies jazzy setup,</li><li>unifies through different modules we have,</li><li>sets mustache templates.</li></ul><p>In our first try, we were awed by the beautiful documentation right of the batch. But, we saw couple issues. These were originating because Jazzy was <strong>only accepting ObjectiveC/Swift style comments</strong>. Whereas Doxygen was supporting C++ style comments. Before <a href="https://medium.com/@ulukaya/how-to-migrate-ios-api-reference-from-doxygen-to-jazzy-35bd89c6a92b">diving down to each issue</a>, let me explain how we tackled them:</p><ol><li>We created a Jazzy style guide for comments for future development.</li><li>We used Jazzy’s--skip-documentation parameter to find out the missing or broken comments. We integrated this parameter into our script as well for due diligence.</li><li>We worked with engineers to update the comments into new syntax as soon as we can.</li><li>In the interim we created a preprocessing script. It removes unsupported keywords from our header files temporarily (just for the execution).</li></ol><pre>sed -i ‘’ -e ‘s/ * @method [:_.[:alnum:]]*[:[:alnum:]]//g’ *.h<br>sed -i ‘’ -e ‘s/ * @typedef [:_.[:alnum:]]*[:[:alnum:]]//g’ *.h<br>sed -i ‘’ -e ‘s/ * @class [:_.[:alnum:]]*[:[:alnum:]]//g’ *.h<br>sed -i ‘’ -e ‘s/ * @fn [:_.[:alnum:]]*[:[:alnum:]]//g’ *.h<br>sed -i ‘’ -e ‘s/ * @property [:_.[:alnum:]]*[:[:alnum:]]//g’ *.h<br>sed -i ‘’ -e ‘s/ * @enum [:_.[\:alnum:]]*[:[:alnum:]]//g’ *.h<br>sed -i ‘’ -e ‘s/@abstract //g’ *.h<br>sed -i ‘’ -e ‘s/@brief //g’ *.h<br>sed -i ‘’ -e ‘s/@discussion //g’ *.h<br>sed -i ‘’ -e ‘s/@remarks //g’ *.h<br>sed -i ‘’ -e ‘s/@returns/Returns/g’ *.h<br>sed -i ‘’ -e ‘s/ @memberof [:_.[:alnum:]]*[:[:alnum:]]//g’ *.h<br>sed -i ‘’ -e ‘s/ @related[:_.[:alnum:]]*[:[:alnum:]]//g’ *.h<br>sed -i ‘’ -e ‘s/{@link \([:_.[:alnum:]]*[:[:alnum:]]\)}/&lt;code&gt;\1&lt;\/code&gt;/g’ *.h<br>sed -i ‘’ -e ‘s/@c \([:_.[:alnum:]]*[:[:alnum:]]\)/&lt;code&gt;\1&lt;\/code&gt;/g’ *.h</pre><p>You can keep reading the <a href="https://medium.com/@ulukaya/how-to-migrate-ios-api-reference-from-doxygen-to-jazzy-35bd89c6a92b">Migration Guide from Doxygen to Jazzy</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5bd297b9697d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/google-developers/how-to-generate-fabulous-api-reference-docs-for-ios-5bd297b9697d">How to generate fabulous API reference docs for iOS</a> was originally published in <a href="https://medium.com/google-developers">Google Developers</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Run TravisCI locally on Docker]]></title>
            <link>https://medium.com/google-developers/how-to-run-travisci-locally-on-docker-822fc6b2db2e?source=rss-a50102e58511------2</link>
            <guid isPermaLink="false">https://medium.com/p/822fc6b2db2e</guid>
            <category><![CDATA[github]]></category>
            <category><![CDATA[travis-ci]]></category>
            <category><![CDATA[git]]></category>
            <category><![CDATA[continuous-integration]]></category>
            <category><![CDATA[docker]]></category>
            <dc:creator><![CDATA[Ibrahim Ulukaya]]></dc:creator>
            <pubDate>Wed, 19 Apr 2017 21:41:40 GMT</pubDate>
            <atom:updated>2017-04-20T15:03:39.671Z</atom:updated>
            <content:encoded><![CDATA[<p>Have a private Github repo that you don’t want Travis to access? Scratching your head on a build error but can’t see logs? Build it locally! (<a href="https://medium.com/google-developers/hacks-i-did-to-use-travis-ci-with-firebase-ios-quickstarts-da67c4986f29">Interested in TravisCI configuration</a>?)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qfR9N8vMEPRye8f473tYpA.jpeg" /></figure><ol><li><a href="https://docs.docker.com/docker-for-mac/install/">Install Docker</a></li><li>Install Travis on Docker</li></ol><pre># choose the image according to the language chosen in .travis.yml<br>$ docker run -it -u travis quay.io/travisci/travis-jvm /bin/bash</pre><pre># now that you are in the docker image, switch to the travis user<br>sudo — travis</pre><pre># Install a recent ruby (default is 1.9.3)<br>rvm install 2.3.0<br>rvm use 2.3.0</pre><pre># Install travis-build to generate a .sh out of .travis.yml<br>cd builds \<br>git clone <a href="https://github.com/travis-ci/travis-build.git">https://github.com/travis-ci/travis-build.git</a> \<br>cd travis-build \<br>gem install travis \<br>travis # to create ~/.travis \<br>ln -s `pwd` ~/.travis/travis-build \<br>bundle install</pre><pre># Create ssh key for Github<br>ssh-keygen -t rsa -b 4096 -C “YOUR EMAIL REGISTERED IN GITHUB”</pre><pre># Click enter to use default location for key<br># You can choose empty passphrase by clicking enter twice</pre><pre># Now that we have the key, let’s share with Github<br>less ~/.ssh/id_rsa.pub</pre><pre># Copy the contents of the id_rsa.pub<br></pre><p>3. Go to your <a href="https://github.com/settings/keys">Github SSH key settings</a><br>4. Create a new ssh key with title: “docker key”: “PASTE THE KEY CONTENTS HERE”<br>5. Go back to docker terminal</p><pre># Create project dir, assuming your project is `AUTHOR/PROJECT` on GitHub<br>cd ~/builds \<br>mkdir AUTHOR \<br>cd AUTHOR \<br>git clone <a href="/service/mailto:git@github.com">git@github.com</a><a href="https://github.com/AUTHOR/PROJECT.git">:AUTHOR/PROJECT.git</a> \<br>cd PROJECT</pre><pre># change to the branch or commit you want to investigate<br># compile travis script into bash script<br>travis compile &gt; ci.sh</pre><pre># Go to bash script and fix the branch name<br>vi ci.sh</pre><pre># in Vi type “/branch” to search and add the right branch name<br># — branch\=\’\NEW_BRANCH’\</pre><pre># You most likely will need to edit ci.sh as it ignores ‘matrix’ and ‘env’ keywords<br>bash ci.sh</pre><p>Congrats, in few steps you are already running TravisCI locally.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=822fc6b2db2e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/google-developers/how-to-run-travisci-locally-on-docker-822fc6b2db2e">How to Run TravisCI locally on Docker</a> was originally published in <a href="https://medium.com/google-developers">Google Developers</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Convert a full ObjectiveC app to Swift]]></title>
            <link>https://medium.com/google-developers/migrating-from-objective-c-to-swift-googlecast-reference-app-81030ce814ce?source=rss-a50102e58511------2</link>
            <guid isPermaLink="false">https://medium.com/p/81030ce814ce</guid>
            <category><![CDATA[objective-c]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[xcode]]></category>
            <dc:creator><![CDATA[Ibrahim Ulukaya]]></dc:creator>
            <pubDate>Mon, 03 Apr 2017 14:39:23 GMT</pubDate>
            <atom:updated>2017-04-21T16:21:41.273Z</atom:updated>
            <content:encoded><![CDATA[<h4>At GoogleCast, we migrated <a href="https://github.com/googlecast/CastVideos-ios">a reference iOS app</a> to Swift using an app, compiler, simple rules and a linter. Here’s what we learned.</h4><p>Recently <a href="https://twitter.com/ToddKerpelman">@ToddKerpelman</a> and I converted <a href="https://github.com/googlecast/CastVideos-ios">a reference iOS Google Cast app</a> to Swift. Before, I implemented <a href="https://github.com/firebase/quickstart-ios">Firebase iOS quickstarts</a>. I created both ObjectiveC and Swift target at the same time. But I never tried to migrate a full app to Swift before. So I welcomed this challenge.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7BBCFwDqT9uGH4KGuB-EZQ.jpeg" /></figure><p>Blame me being lazy. I didn’t want to do to mundane work of declaring each variable and function in Swift. I decided to take a leap in faith and try a converter tool as a starter. I was going to see how good it can translate. Then I was going to catch build errors and bugs after checking line by line. Finally I was going through with a linter tool to catch any bad style.</p><p>After googling “ObjectiveC to Swift converter” I decided to give a try to <a href="https://objectivec2swift.com/">Swiftify</a>. I did a test on a small file, it looked good. Then I uploaded the whole project, pressed convert button, closed my eyes and hoped for the best.</p><p>What I received looked like a Swift code. There were double definitions of the variables as they got imported from both .h and .m. Some of the definitions that should’ve been on the top of the file were on the bottom. But in general it looked like I saved tons of hours of mundane work to fix dots and parentheses. Because of the original code, I even saw definitions like private(set) public var. We started with 269 build errors (more like 800 as you fix, you get more :). Luckily there were lots of low hanging fruits:</p><ul><li>double definitions of vars</li><li>wrong optionality, function signatures</li><li>Swift 3 style issues (enumeration naming)</li><li>Xcode suggested fixes (nullability checks).</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xuKb9VP_OPIUQ1MZeg96vw.png" /><figcaption>Build Errors</figcaption></figure><p>This took 3 days as we go down all the way to 2 digits. Now the no-brainer bugs were gone. We had to use assistant view to fix remaining bugs side by side. Most of the bugs turned out to be wrong guesses on the optionality types of class vars. Converter always picks implicitly unwrapped variables instead of optionals. Or it would try to guess local variable types wrong. (You don’t need to declare variable types most of the times as Swift can infer them). Only because I was eager to see the app built, I took a shortcut. I used force unwrapping and force casting only to get rid of build errors. Little did I know, I was going to pay a high price for this later on debugging. After bunch of var to let conversions (converter defined all variables as var), we had an app that built!</p><p>Don’t get so hyped yet, we were only beginning. Yes, our app was building, but returning no data and crashing at startup. We spent the next 100 hours debugging to find all the</p><ul><li>null errors</li><li>wrong if not null checks,</li><li>and lots of optionality fixes.</li></ul><p>After those, our app was initializing. It was “almost” casting, yet another force unwrapping error.</p><p>There is a reason for style guides. They help you to use the language the way it was designed to be used, and they prevent most bugs before you create them. At that moment <a href="https://github.com/realm/SwiftLint/">SwiftLint</a> came to rescue. You can run SwiftLint on Xcode to see all the style guide exceptions on the lines they occur, and fix them quick. I was determined to get rid of all optionality bugs and stay close to style guide as much as possible. I enabled even the opt-in rules. Fixing style not only helped the readability, but also improved our confidence on the errors. We found further bugs on the way. We got rid of all the force unwrapping, force casting, explicit type declarations, implicitly unwrapped optionals. We favored if let and guard let statements wherever possible.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*49s3dykYY8bvFmnTidv5aw.png" /><figcaption>Force unwrapping violations</figcaption></figure><h3>Results:</h3><p>We will be refactoring the app in next weeks, but at least, we have a <a href="https://github.com/googlecast/CastVideos-ios/tree/master/CastVideos-swift">1-to-1 swift port of the CastVideos sample app now.</a></p><ol><li><a href="https://objectivec2swift.com/">Swiftify</a> saved us valuable time instead of converting the project line by line. (As long as you now it’s not going to do the all work for you. It’ll be a guesstimate)</li><li>Never ever use ! (unwrapping symbol) unless you have no other choice. Force unwrapping myVar!, force casting as!, implicitly unwrapped optionals Type! are very prone to errors.</li><li>Replacing them with if let, guard let, and optional chaining x?.y?.do() will recover your app from exceptions instead of crashing and will help you in debugging.</li><li>Style guides both improves readability and make your code less prone to bugs. <a href="https://github.com/realm/SwiftLint">SwiftLint</a> was a great tool to force the Swift style guide.</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=81030ce814ce" width="1" height="1" alt=""><hr><p><a href="https://medium.com/google-developers/migrating-from-objective-c-to-swift-googlecast-reference-app-81030ce814ce">How to Convert a full ObjectiveC app to Swift</a> was originally published in <a href="https://medium.com/google-developers">Google Developers</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to configure TravisCI free for multi project repos]]></title>
            <link>https://medium.com/google-developers/hacks-i-did-to-use-travis-ci-with-firebase-ios-quickstarts-da67c4986f29?source=rss-a50102e58511------2</link>
            <guid isPermaLink="false">https://medium.com/p/da67c4986f29</guid>
            <category><![CDATA[github]]></category>
            <category><![CDATA[ios-app-development]]></category>
            <category><![CDATA[continuous-integration]]></category>
            <category><![CDATA[firebase]]></category>
            <category><![CDATA[cocoapods]]></category>
            <dc:creator><![CDATA[Ibrahim Ulukaya]]></dc:creator>
            <pubDate>Mon, 30 Jan 2017 22:56:48 GMT</pubDate>
            <atom:updated>2017-04-20T15:04:50.747Z</atom:updated>
            <content:encoded><![CDATA[<h4><a href="https://docs.travis-ci.com/">Travis CI</a> is a great hosted continuous integration service for Github repositories. Especially for fast tests. While I was hooking <a href="https://github.com/firebase/quickstart-ios">Firebase iOS quickstarts</a> with Travis CI, I had to implement some hacks.</h4><p>Because we,</p><ul><li>have multiple projects inside 1 repo,</li><li>use CocoaPods 1.0 (default is 0.5),</li><li>include Google plist file into each project at test,</li><li>update info.plist of each project at test,</li><li>parallelize builds across VMs,</li><li>cache bundler and dependencies (pods).</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*V8gaS6mEQUAYuW9Md4bDzQ.jpeg" /></figure><h4><strong>The Build Lifecycle</strong></h4><p>A build on Travis CI is made up of two steps:</p><ul><li>install: install any dependencies required</li><li>script: run the build script</li></ul><p>You can run custom commands before the installation step (before_install), and before (before_script) or after (after_script) the script step.</p><blockquote>In a before_install step, you can install additional dependencies required by your project such as Ubuntu packages or custom services. So here I,</blockquote><ul><li>install CocoaPods 1.0 (default is 0.5)</li><li>get into each example folder and install pods</li><li>copy in a mock Google plist file</li><li>update Google plist and info.plist with sed</li><li>add Google plist file into each target. (using ruby and xcodeproj)</li></ul><pre>- gem uninstall cocoapods -a <br>— gem install cocoapods -v ‘1.1.1’ <br>— gem install xcpretty <br>— cd $SAMPLE <br>— pod install — repo-update <br>— cp ../mock-GoogleService-Info.plist ./GoogleService-Info.plist <br>— sed -i ‘’ ‘/&lt;key&gt;BUNDLE_ID&lt;/{n;s/id/com.google.firebase.quickstart.’$SAMPLE’Example/;}’ GoogleService-Info.plist <br>— sed -i ‘’ ‘s/YOUR_REVERSED_CLIENT_ID/com.googleusercontent.apps.123456789000-hjugbg6ud799v4c49dim8ce2usclthar/’ “$SAMPLE”Example/Info.plist <br>— gem install xcodeproj <br>— ruby ../info_script.rb $SAMPLE <br>— cd -</pre><blockquote>Then in script, I run the xcodebuild</blockquote><p>before_install and script are merged in execution and executed for each<br>entry in the build matrix. Your environment variables you set with<br>env: is accessible to both.</p><h4>Parallelizing your builds across virtual machines</h4><p>To speed up a test suite, you can break it up into several parts using<br>Travis CI’s build matrix feature.</p><p>Say you want to split up your unit tests and your integration tests into two<br>different build jobs. They’ll run in parallel and fully utilize the available<br>build capacity for your account.</p><p>Here’s an example on how to utilize this feature in your .travis.yml:</p><pre>env:<br> — TEST_SUITE=units<br> — TEST_SUITE=integration</pre><blockquote>Here I use the “SAMPLE” variable for each sample name. That helps me to go into each folder, set their bundle ids respectively, and find out project and scheme names to build.</blockquote><pre>env: SAMPLE=AdMob</pre><h4>Caching directories (Bundler, dependencies)</h4><p>With caches, Travis CI can persist directories between builds. This is<br>especially useful for dependencies that need to be downloaded and/or compiled from source.</p><p><strong>Build phases</strong></p><p>Travis CI attempts to upload cache after script, but before either after_success or after_failure is run. Note that the failure to upload the cache does not mark the job a failure.</p><p><strong>Bundler</strong></p><p>On Ruby and Objective-C projects, installing dependencies via Bundler can make up a large portion of the build duration. Caching the bundle between builds drastically reduces the time a build takes to run.</p><p>The logic for fetching and storing the cache is described below.</p><p><strong><em>Enabling Bundler caching</em></strong></p><p>Bundler caching is automatically enabled for Ruby projects that include a<br>Gemfile.lock. (Bundler caching is not yet enabled automatically) You can explicitly enable Bundler caching in your .travis.yml:</p><pre>language: ruby<br>cache: bundler</pre><p>Whenever you update your bundle, Travis CI will also update the cache.</p><p><strong>CocoaPods</strong></p><p>On Objective-C projects, installing dependencies via CocoaPods can take up a good portion of your build. Caching the compiled Pods between builds helps reduce this time.</p><p>If you want to enable both Bundler caching and CocoaPods caching, you can list them both:</p><pre>language: objective-c<br>cache:<br>- bundler<br>- cocoapods</pre><p><strong>Determining the Podfile path</strong></p><p>By default, Travis CI will assume that your Podfile is in the root of the<br>repository. If this is not the case, you can specify where the Podfile is<br>like this:</p><pre>language: objective-c<br>podfile: path/to/Podfile</pre><blockquote>To be able to cache the pods:<br>- I had to specify podfile for each sample. That’s why I had to specify it inside the build-matrix.<br>- I tried use podfile: $SAMPLE/Podfile but it wouldn’t pick up the<br> environment variable, so I had to explicitly define it in the build-matrix.<br>- Instead of using just the env , I created the first sample(Admob) by<br> default and added all entries into build matrix using the matrix: include:.</blockquote><pre>cache:<br>  - bundler<br>  - cocoapods</pre><pre>podfile: admob/Podfile<br>env: SAMPLE=AdMob</pre><pre>matrix:<br>  include:<br>  - podfile: analytics/Podfile<br>    env: SAMPLE=Analytics<br>  - podfile: authentication/Podfile<br>    env: SAMPLE=Authentication</pre><h3>Results:</h3><ul><li>I set up right bundle-id and run pods for each sample.</li><li>I cache right bundler and pods for each sample.</li><li>All these tests run parallel, fast, well under travis time limit.</li><li>With caching &amp; build matrix, my tests finish under 10 minutes instead of 1 hour 40 minutes as before.</li></ul><p><strong>PS:</strong> Recently, I had an issue with my tests <a href="https://github.com/travis-ci/travis-ci/issues/6675">failing with error 65</a>, and the reason is that simulator not being ready in time. So I wrote <a href="https://github.com/firebase/quickstart-ios/blob/master/test.sh">a script</a> to retry them and it worked like magic!</p><pre>set -o pipefail &amp;&amp; xcodebuild \<br>  -workspace ${SAMPLE}/${SAMPLE}Example.xcworkspace \<br>  -scheme ${SAMPLE}Example \<br>  -sdk iphonesimulator \<br>  -destination &#39;platform=iOS Simulator,name=iPhone 7&#39; \<br>  build \<br>  test \<br>  ONLY_ACTIVE_ARCH=YES \<br>  CODE_SIGNING_REQUIRED=NO\<br>  | xcpretty<br>  <br>RESULT=$?<br>if [ $RESULT == 65 ]; then<br>  echo &quot;xcodebuild exited with 65, retrying&quot;<br>  set -o pipefail &amp;&amp; xcodebuild \<br>...<br>...</pre><pre>else<br>  exit $RESULT<br>fi</pre><p>Further read: “<a href="https://medium.com/@ulukaya/how-to-run-travisci-locally-on-docker-822fc6b2db2e">How to run TravisCI locally on Docker</a>”.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=da67c4986f29" width="1" height="1" alt=""><hr><p><a href="https://medium.com/google-developers/hacks-i-did-to-use-travis-ci-with-firebase-ios-quickstarts-da67c4986f29">How to configure TravisCI free for multi project repos</a> was originally published in <a href="https://medium.com/google-developers">Google Developers</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>