<?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 Nikhil Motghare on Medium]]></title>
        <description><![CDATA[Stories by Nikhil Motghare on Medium]]></description>
        <link>https://medium.com/@motgharenikhil8?source=rss-8a43a701569f------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*460Nq0LwJBgPaD1LjZMPnA@2x.jpeg</url>
            <title>Stories by Nikhil Motghare on Medium</title>
            <link>https://medium.com/@motgharenikhil8?source=rss-8a43a701569f------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 19:10:29 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@motgharenikhil8/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[Localisation in iOS: tips]]></title>
            <link>https://medium.com/@motgharenikhil8/localisation-is-fun-33880cc8da4a?source=rss-8a43a701569f------2</link>
            <guid isPermaLink="false">https://medium.com/p/33880cc8da4a</guid>
            <category><![CDATA[language]]></category>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[xcode]]></category>
            <category><![CDATA[developer]]></category>
            <category><![CDATA[ios]]></category>
            <dc:creator><![CDATA[Nikhil Motghare]]></dc:creator>
            <pubDate>Wed, 22 May 2024 12:09:17 GMT</pubDate>
            <atom:updated>2024-09-27T19:13:52.030Z</atom:updated>
            <content:encoded><![CDATA[<p>Localisation in iOS: tips</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/573/1*2jAx5D7DdeDXJiVnUu977g@2x.jpeg" /></figure><p>___________اختباراتFUN – – – – -</p><p>As a developer, I have meticulously added localization files, meticulously checked contents, and meticulously created UI for each respective language. I always ensure that all content and UI elements are functioning flawlessly.</p><p>In a stroke of genius, I decided to test the app in an unfamiliar language. There are some languages out there where everything works in reverse – including our app. And let’s not forget those languages where the content is either ridiculously lengthy or frustratingly short.</p><p>After putting the app through its paces and fixing some broken UI elements, I can confidently say that this experience will undoubtedly give you a newfound appreciation for your app. Perhaps it will even prompt you to reconsider your approach to UI/UX design.</p><p>Go ahead, give it a try.</p><ol><li>Always Give leading and Trailing instead of left and right</li><li>Add separate assets for layout direction or languages</li><li>Determine layout direction using swift code</li></ol><pre>if UIView.userInterfaceLayoutDirection(<br>    for: myView.semanticContentAttribute) == .rightToLeft {<br><br>      // The view is shown in right-to-left mode right now.<br>}</pre><p>4. Check for ;; in Localisable.strings and replace with ;</p><p>5. Setup Build Lanbguage in Edit Schema-&gt; options-&gt;system region and System language</p><p>6. Add Device Languages in Settings-&gt;General-&gt;Language and Region. Check different language text input in API services.</p><p>7. Use Google Lense to check content on image</p><p>…</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=33880cc8da4a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AdServices implementation in Swift and Objective-C]]></title>
            <link>https://medium.com/@motgharenikhil8/adservices-implementation-in-swift-and-objective-c-3ee950040e63?source=rss-8a43a701569f------2</link>
            <guid isPermaLink="false">https://medium.com/p/3ee950040e63</guid>
            <category><![CDATA[apple]]></category>
            <dc:creator><![CDATA[Nikhil Motghare]]></dc:creator>
            <pubDate>Wed, 04 Aug 2021 16:27:10 GMT</pubDate>
            <atom:updated>2021-08-04T16:27:10.217Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/693/1*HMxyYiYYsntnl4-nd4PNdA@2x.jpeg" /></figure><p>Attribute app-download campaigns that originate from the App Store, Apple News, or Stocks on iOS devices.</p><p>The Apple Ads Attribution API is a solution that combines the AdServices framework on client devices and a RESTful API for server-side communication with Apple’s attribution server. The API retrieves attribution data from app downloads and redownloads from Apple Search Ads campaigns. Measure attribution data using specific Apple Search Ads campaign metadata against the performance of Apple Search Ads campaigns. See Attribution Payload for attribution responses.</p><p>Add <strong>iAd </strong>and <strong>AdServices</strong> Framework in your project.</p><h4>Swift:-</h4><pre>func fetchAttributionData() {<br>    if #available(iOS 14.3, *) {<br>       ​if let adAttributionToken = try? AAAttribution.attributionToken() {<br>           ​let request = NSMutableURLRequest(url: URL(string:&quot;https://api-adservices.apple.com/api/v1/&quot;)!)<br>           ​request.httpMethod = &quot;POST&quot;<br>           ​request.setValue(&quot;text/plain&quot;, forHTTPHeaderField: &quot;Content-Type&quot;)<br>           ​request.httpBody = Data(adAttributionToken)<br>           ​let task = URLSession.shared.dataTask(with: request as URLRequest) { (data, _, error) in<br>               ​if let error = error {<br>                   ​print(error)<br>                   ​return<br>               ​}<br>               ​do {<br>                  ​let jsonResponse = try JSONSerialization.jsonObject(with: data!, options: .allowFragments) as! [String:Any]<br>                   ​if let campaignId = jsonResponse[&quot;campaignId&quot;] as? Int {<br>              //Send Data to APP Backend<br><br>                   ​}<br>               ​} catch {<br>                  ​print(error)<br>               ​}<br>           ​}<br>       ​task.resume()<br>       ​}<br>    } else {<br>       ​ADClient.shared().requestAttributionDetails({ (attributionDetails, error) in<br>           ​guard let attributionDetails = attributionDetails else {<br>               ​print(&quot;Search Ads error: \(error?.localizedDescription ?? &quot;&quot;)&quot;)<br>               ​return<br>           ​}<br>           ​for (version, adDictionary) in attributionDetails {<br>               ​print(&quot;Search Ads version:&quot;, version)<br>                   ​if var adAttributionInfo = adDictionary as? Dictionary&lt;String, Any&gt; {<br>              <br>                       ​if let campaignId = attributionInfo[&quot;iad-campaign-id&quot;] as? String {<br>                       //Send Data to APP Backend<br>                   ​}<br>               ​}<br>           ​}<br>       ​})<br>    }<br>}</pre><h4>Objective-C :-</h4><pre>- (<strong>void</strong>) fetchAttributionData {</pre><pre><strong>if</strong> (<strong>@available</strong>(iOS 14.3, *)){</pre><pre>NSError *error;</pre><pre>NSString *adAttributionToken = [AAAttribution attributionTokenWithError:&amp;error];<br><strong>if</strong> (adAttributionToken){<br>NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:[[NSURL alloc] initWithString:@&quot;https://api-adservices.apple.com/api/v1/&quot;]];</pre><pre>request.HTTPMethod = @&quot;POST&quot;;</pre><pre>NSData *postdata = [adAttributionToken dataUsingEncoding: NSUTF8StringEncoding allowLossyConversion:YES];</pre><pre>NSString *postLength = [NSString stringWithFormat:@&quot;%d&quot;,[postdata length]];</pre><pre>request.HTTPBody =. postdata;</pre><pre>[request setValue:postLength forKey:@&quot;Content-Length&quot;];<br>NSURLSessionDataTask *task = [[NSURLSession sharedSession] dataTaskWithRequest:request completionHandler:^(NSData * <strong>_Nullable</strong> data, NSURLResponse * <strong>_Nullable</strong> response, NSError * <strong>_Nullable</strong> taskError) {</pre><pre><strong>if</strong> (taskError) {</pre><pre>NSLog(@&quot;%@&quot;, taskError);</pre><pre>} <strong>else</strong> {</pre><pre>NSError *jsonError = <strong>nil</strong>;</pre><pre>NSDictionary *jsonResponse = [NSJSONSerialization JSONObjectWithData:data options:0 error:&amp;jsonError];</pre><pre><strong>if</strong>(jsonError) {</pre><pre>NSLog(@&quot;%@&quot;, jsonError);</pre><pre>}</pre><pre><strong>else</strong> {</pre><pre>NSLog(@&quot;%@&quot;, jsonResponse);</pre><pre><strong>if</strong>([jsonResponse valueForKey:@&quot;iad-campaign-id&quot;]){<br>//Send Data to APP Backend<br>}<br>}<br>}<br>}];<br>[task resume];<br>}<br>} <strong>else</strong> {</pre><pre>[ADClient.sharedClient requestAttributionDetailsWithBlock:^(NSDictionary&lt;NSString *,NSObject *&gt; * <strong>_Nullable</strong> attributionDetails, NSError * <strong>_Nullable</strong> error) {</pre><pre><strong>if</strong> (error){</pre><pre><strong>if</strong> (error.code == ADClientErrorLimitAdTracking) {</pre><pre>NSLog(@&quot;Limit Ad Tracking is enabled for this device.&quot;);</pre><pre>}<br><strong>return</strong>;<br>}</pre><pre>// Check value for &quot;iad-attribution&quot;:</pre><pre>// Check value:</pre><pre>//                if ([[attributionDetails valueForKey:@&quot;iad-attribution&quot;] boolValue]) {</pre><pre><strong>for</strong>(NSString *versionKey <strong>in</strong> attributionDetails){</pre><pre><strong>if</strong>([attributionDetails valueForKey:versionKey]){</pre><pre>NSMutableDictionary *adAttributionInfo = [(NSDictionary *)attributionDetails[versionKey] mutableCopy];</pre><pre><strong>if</strong> (adAttributionInfo[@&quot;iad-campaign-id&quot;]){</pre><pre>NSString *campaignId = adAttributionInfo[@&quot;iad-campaign-id&quot;];<br>//Send Data to APP Backend<br>adAttributionInfo[@&quot;campaignId&quot;] = campaignId;}<br>}<br>}<br>}];<br>}<br>}</pre><p><a href="https://developer.apple.com/documentation/adservices">https://developer.apple.com/documentation/adservices</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3ee950040e63" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Switch tabs in UITabBarController programmatically using swift]]></title>
            <link>https://medium.com/@motgharenikhil8/switch-tabs-in-uitabbarcontroller-programmatically-using-swift-b54686ae00dd?source=rss-8a43a701569f------2</link>
            <guid isPermaLink="false">https://medium.com/p/b54686ae00dd</guid>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[tabs]]></category>
            <category><![CDATA[switch]]></category>
            <category><![CDATA[programmatically]]></category>
            <dc:creator><![CDATA[Nikhil Motghare]]></dc:creator>
            <pubDate>Sun, 19 May 2019 07:41:36 GMT</pubDate>
            <atom:updated>2025-08-03T03:09:45.874Z</atom:updated>
            <content:encoded><![CDATA[<h3>Switch Tabs in UITabBarController programmatically using swift</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/585/1*Cxf_BcsIvCyZN217YyW58w@2x.jpeg" /></figure><p>Hello Friends!, This article will help you to solve issue switching the tabs in UITabBarController programmatically using swift.</p><p>Consider in your tabbed application you faced the situation when you performed a task in one tab and after completion/ failure you want to redirect to another tab.</p><p>Also you perform operations like deeplink and switch Tabs</p><p>Don&#39;t worry. Just follow the steps</p><h4><strong>1:</strong> Add UIApplication Extension</h4><pre>extension UIApplication {<br><br>/*function will return reference to tabbarcontroller */<br><br>   func tabbarController() -&gt; UIViewController? {<br><br>     guard let vcs = self.keyWindow?.rootViewController?.childViewControllers else { return nil }<br><br>        for vc in vcs {<br><br>           if  let _ = vc as? TabController {<br><br>              return vc<br><br>           }<br><br>         }<br><br>       return nil<br><br>    }<br><br> }</pre><h4>2: How to use</h4><pre>guard let tabbarController = UIApplication.shared.tabbarController() as? TabController}<br><br>tabbarController.selectedIndex = 0  // Will redirect to first tab ( index = 0 )</pre><h4>3. keyWindow deprecated warning</h4><pre>guard let keyWindow = UIApplication.shared.connectedScenes<br>        .filter({$0.activationState == .foregroundActive})<br>        .compactMap({$0 as? UIWindowScene})<br>        .first?.windows<br>        .filter({$0.isKeyWindow}).first, vcs = keyWindow?.rootViewController?.childViewControllers {<br>//…<br>}<br></pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b54686ae00dd" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>