<?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 Shrutika Surve on Medium]]></title>
        <description><![CDATA[Stories by Shrutika Surve on Medium]]></description>
        <link>https://medium.com/@shrutika.surve96?source=rss-2a349d0aa2e9------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*ce5IDy_I4PZ2gOJPBxBvzw.jpeg</url>
            <title>Stories by Shrutika Surve on Medium</title>
            <link>https://medium.com/@shrutika.surve96?source=rss-2a349d0aa2e9------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 12:29:15 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@shrutika.surve96/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[How to Implemented Localization in Swift]]></title>
            <link>https://medium.com/@shrutika.surve96/how-to-implemented-localization-in-swift-f7619fb48c1f?source=rss-2a349d0aa2e9------2</link>
            <guid isPermaLink="false">https://medium.com/p/f7619fb48c1f</guid>
            <category><![CDATA[ios-app-development]]></category>
            <category><![CDATA[multiple-language-support]]></category>
            <category><![CDATA[localization]]></category>
            <category><![CDATA[swift]]></category>
            <dc:creator><![CDATA[Shrutika Surve]]></dc:creator>
            <pubDate>Sat, 17 Sep 2022 19:49:43 GMT</pubDate>
            <atom:updated>2022-09-17T19:51:18.602Z</atom:updated>
            <content:encoded><![CDATA[<p>Localization is the process of translating and adapting your app into multiple languages and regions. Localize your app to provide access for users who speak a variety of languages, and who download from different App Store territories.</p><p>Localization in your application is not just adding support for translation. It includes adapting your app Interface to support language and regional specificities. That includes supporting different time zones, regional numeric formats, dates, measurement units, etc. All countries don’t use the same type of calendar to show date and time, some countries use the mile system, others the metric system and so on for the other units. All these differences have to be taken in account while developing your apps, as part of the Internationalization process, and even during the design stage, as a globalised User Experience design. In this document we will manage the strings for the application.</p><h3>Steps for localization</h3><ul><li><strong>Step 1 : Create Localizable.strings file</strong></li><li><strong>Step 2 : Adding languages</strong></li><li><strong>Step 3 : Working with translation</strong></li></ul><blockquote><strong>Create Localizable.strings file</strong></blockquote><p>First, you need to create a new file named Localizable.strings. To create this file, go to File &gt; New &gt; File, search for Strings File and name it as Localizable.strings. Then on the right panel, click on the Localized button.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*G1DPNHv6TGc_YP9fw0Mzpg.png" /></figure><blockquote><strong>Adding languages</strong></blockquote><p>Let’s add some languages to the application and create .strings files for each language. Select your root project file, and then proceed to the project panel. Find the Localization section, click the “plus” (+) icon, and add the desired languages. Select only the Localizable.strings file for localization.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/968/1*AjeRuZHcc6_0tvlE21qEkA.png" /><figcaption>Project general setting</figcaption></figure><p>If you want to manage some UI component string by using Object Id instead of localizable.string file then you can select the main.storyboard and LaunchScreen.storyboard so you no need to update strings inside class.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/258/1*iQ-WjaE2KfJU02bzEZM1mQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/963/1*dwl12B2blo4nmkgey7pfKQ.png" /></figure><p>Your file is now localized. You can select in which language you want to write by selecting the localized Localizable.strings file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/518/1*shhYTy3R9TDqwmD8XGVwaw.png" /></figure><blockquote><strong>Working with translation</strong></blockquote><p>Localizable.strings files are ready, therefore let’s populate these. As mentioned before, the localization process involves keys and values. Key is a unique identifier that is used in the source code, when the application is served to the user, keys are replaced with the corresponding translations for the language set by the user.</p><p><strong>Localizable.strings (English):</strong></p><p>“welcome_screen_title” = “Welcome”;</p><p>“login_button”= “Log in”;</p><p><strong>Localizable.strings (French):</strong></p><p>“welcome_screen_title” = “Bienvenue”;</p><p>“login_button”= “Connexion”;</p><p>Here “welcome_screen_title” , “login_button” are keys that are unique and as per the translation you can update the string. iOS will automatically recognize this file as a translation file, which will contain all your translations. This file works with key value pairs, with each key representing a string, one file per language. That’s these keys that will then replace strings in your code. By using the NSLocalizedString you can assign the text to your UI Componets (Label, Button) as per the selected language code text will appear on screen.</p><blockquote>Eg. welcomeScreen.title = NSLocalizedString(“login_button” ,comment: “” )</blockquote><p><strong>Make an extension for the setting default lang.</strong></p><p>langCode — Each language has its unique code. eg English — en , Spanish — es , Indonesian — in .</p><blockquote>///MARK:- Bundle file extention<br>extension Bundle {</blockquote><blockquote>class func setLanguage(_ language: String) {<br>defer {<br>object_setClass(Bundle.main, AnyLanguageBundle.self)<br>}<br>objc_setAssociatedObject(Bundle.main, &amp;bundleKey, Bundle.main.path(forResource: language, ofType: “lproj”),<br>.OBJC_ASSOCIATION_RETAIN_NONATOMIC)<br>}<br>}</blockquote><blockquote>extension String{<br>var localized: String {<br>return NSLocalizedString(self, comment: “”)<br>}</blockquote><blockquote>}</blockquote><p><strong>Test the application on iOS Simulator or Devices</strong></p><p>Finally, the last step in the <strong>Internationalization process</strong> is to <strong>test that everything works as expected in different languages</strong>. To do that, you can either change your device or simulator language and region, or you can directly configure it in your <strong>Scheme Options</strong>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/894/1*LyWQMZVGKIm4yWWub_5pyw.png" /></figure><p>This are the some basic steps to implement the localization in your application.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f7619fb48c1f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Apple Sign — Generate Authentication and Revoke token for Account Deletion]]></title>
            <link>https://medium.com/@shrutika.surve96/apple-sign-generate-authentication-and-revoke-token-for-account-deletion-396f4a93728f?source=rss-2a349d0aa2e9------2</link>
            <guid isPermaLink="false">https://medium.com/p/396f4a93728f</guid>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[account-deletion]]></category>
            <category><![CDATA[ios-app-development]]></category>
            <category><![CDATA[apple-sign-in]]></category>
            <dc:creator><![CDATA[Shrutika Surve]]></dc:creator>
            <pubDate>Mon, 12 Sep 2022 05:49:04 GMT</pubDate>
            <atom:updated>2022-09-13T06:57:16.036Z</atom:updated>
            <content:encoded><![CDATA[<h3>Apple Sign-In -Generate Authentication and Revoke token for Account Deletion</h3><p>Apple is taking a firm stance to protect user’s privacy with this new feature. In Apple Sign-in integration we have to first authenticate user using the apple auth token sign-in api and generate the token. We have to store this token in our local storage or keychain. When the user will perform the delete account, logout at that time we will call the revoke token api.</p><p><strong>Account deletion guidance</strong></p><p>Account deletion is a significant decision for the user, and the process for initiating and confirming deletion should be straightforward and transparent:</p><p>● Make the account deletion option easy to find in your app. Typically, it’s included in the app’s account settings.</p><p>● Offer to delete the entire account record, along with associated personal data. You may include additional options, but only offering to temporarily deactivate or disable an account is insufficient.</p><p>● To avoid this above scenario we are generating token at app side and revoke that token while deleting account</p><p><strong>Steps to create the apple sign-in generate token</strong></p><p>To integrate the Apple sign its has own delegate method which return us the user Credential State. If the user is authorized then we will get the authentication related information in it. Eg- AuthToken , AuthCode , Email , name.</p><p>func AuthorizationController(controller: ASAuthorizationController, didCompleteWithAuthorization authorization: ASAuthorization) {<br>} — this is method we will check the user credentialState.</p><p>Generating and validating token Doc <a href="https://developer.apple.com/documentation/sign_in_with_apple/generate_and_validate_tokens"><strong><em>https://developer.apple.com/documentation/sign_in_with_apple/generate_and_validate_tokens</em></strong></a></p><p>Api Url — (POST) <a href="https://appleid.apple.com/auth/token">https://appleid.apple.com/auth/token</a></p><p>Parameters<br><strong>client_id (</strong>string )<strong>(Required) — </strong>The identifier (App ID or Services ID) for your app. The identifier must not include your Team ID, to help mitigate the possibility of exposing sensitive data to the end user.</p><p>To generating the client_id we have to refer below doc <a href="https://developer.okta.com/blog/2019/06/04/what-the-heck-is-sign-in-with-apple"><strong><em>https://developer.okta.com/blog/2019/06/04/what-the-heck-is-sign-in-with-apple</em></strong></a></p><p><strong>client_secret (</strong>string) <strong>(Required) — </strong>A secret JSON Web Token (JWT) that uses the Sign in with Apple private key associated with your developer account.</p><p><strong>Steps to generate the client secret key</strong></p><p>We have to make the generateClientSecrete.rb file, we have to update team id , private key , client id then run the script using the following command it will generate the client_scret.txt file in that we get client_sceret key.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0wh85ctTlEnnO6fULdSvnA.png" /></figure><p>Key_file — In this we have to give the our .p8 certificate file name</p><p>Key_id — In this we have to mention the primary key id</p><p>Command to be executed on terminal</p><ul><li>shrutikasurve@user ~ % sudo gem install jwt<br>Password:<br>Successfully installed jwt-2.4.1</li><li>Parsing documentation for jwt-2.4.1<br>Done installing documentation for jwt after 0 seconds<br>1 gem installed<br>shrutikasurve@user ~ % cd /Users/shrutikasurve/Documents shrutikasurve@user Documents % ruby generate_client_secret.rb &gt;&gt; client_secret.txt shrutikasurve@user Documents %</li></ul><p><strong>code (</strong>string) <strong>(Required)</strong>— The authorization code received in an authorization response sent to your app. The code is single-use only and valid for five minutes. Authorization code validation requests require this parameter.</p><p>let authCode = String(decoding: appleIDCredential.authorizationCode ?? Data(), as: UTF8.self)</p><p><strong>grant_type ( </strong>string) <strong>(Required)</strong> — It determines how the client app interacts with the validation server. Authorisation code and refresh token validation requests require this parameter. For authorisation code validation, use authorization_coda. For refresh token validation requests, use refresh_token.</p><p><strong>AFTER GENERATING THE AUTHENTICATE TOKEN</strong></p><p>We have to store reference token , access token and token type (access_token/ referesh_token) inside the keychains. Access token which we have got is valid for 180 days after it expires, at the time of revoke we require access/refresh token as an input parameter, so in that case we will if our access token has expired the we have do first refresh the token then revoke it.</p><h4>Revoke tokens</h4><p>Invalidate the tokens and associated user authorizations for a user when they are no longer associated with your app.</p><p><strong>Revoke Token Doc </strong><a href="https://developer.apple.com/documentation/sign_in_with_apple/revoke_tokens">https://developer.apple.com/documentation/sign_in_with_apple/revoke_tokens</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=396f4a93728f" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>