Saturday, December 15, 2018

Query your MongoDB

Hey All,

Welcome back to the second phase of the MongoDB. The query part. We will run the queries on the Mongo shell.



Tips to avoid Appstore Rejection

Hey Folks,

Submission of the iOS apps to the Appstore is a tricky process. If you are planning for submission it would be great if you follow some basic guidelines provided by Apple Apple-Review-Guidelines

Here you find a list of Do's and Dont's that can help you pass the submission process with the flying colors. So here you go :P


Do's

  • Project
    • App Icon [must not contain rounded corners or layers].
    • Launch / Splash images must be added in project.
    • Bundle Identifier.
    • Production Certificates & Provisioning profile.
  • iTunes Connect
    • Set App Name.
    • Set App Icon [must not contain rounded corners or layers].
    • Provide proper description.
    • Provide screen shots of the screen of every device supported.
    • Add valid comma separated keywords.
    • Support URL is also a must so that apple or customer can reach you.
    • Detailed data in App review Information.



Dont's

  • Too less or irrelevant information under App Review Information Section has high risk of rejection. Do ensure that the credentials for login are valid and server is live/reachable.
  • Never ever use any other platform related information like Android or Windows in any of your files. Any such keyword in any file is not accepted.
  • Don't use BETA / TRIAL or TEST keywords too. Apple in any case should not sense that your app is incomplete or under trial. If you wish to test your beta app use Testflight but avoid submission.
  • Inappropriate or filthy content act as a bait for rejection.
  • Complex UI or in-usability of apps too lead to rejection.
  • Screenshots or description that are irrelevant.


Will add more data in list with time. Happy Submission :)






Thursday, November 22, 2018

SHA Encryption in IOS

Hi All,

Encryption has always been a key feature in apps developed in any Platform. Used widely in iOS Apps.

So lets today explore the SHA algorithm for encryption and decryption.


What is it

The algorithm is named as Secure Hash Algorithm. Highly used for Digital Signatures. This algorithm generates a unique and non-reversible text. Suppose if you are able to get the secret key used for hashing then alone with that you cannot generate the actual data making it secure. Also, two different kinds of data with the same secret hash code cannot generate the same hashed string.

However, with SHA1 two different strings with the same hash code generated the same hashed result resulting in a collision which led the users to move to SHA256 for better security. The larger is the bit size of hash the larger is the combination option and higher is the security but definitely, the implementation is important too.

But will longer hash length have any impact on performance? Yes, it may.


It can be broken down as

SHA[Number] [Output Size in Bits]

  • SHA0 [160]
  • SHA1 [160]
  • SHA2 [SHA224, SHA256, SHA384, SHA512]
  • SHA3 [SHA224, SHA256, SHA384, SHA512]





Plain Text >> Hash Algorithm >> Hashed Text



Utilize the Encryption logic in iOS App

1. Add Security Framework




2. Import CommonCrypto.h




Objective C

- (NSData *)hmacForKeyAndData:(NSString *)key data:(NSString *)data
{
    unsigned char cHMAC[CC_SHA1_DIGEST_LENGTH];

    const char *cKey  = [key cStringUsingEncoding:NSASCIIStringEncoding];
    const char *cData = [data cStringUsingEncoding:NSASCIIStringEncoding];

    CCHmac(kCCHmacAlgSHA1, cKey, strlen(cKey), cData, strlen(cData), cHMAC);

    return [[NSData alloc] initWithBytes:cHMAC length:sizeof(cHMAC)];

}


Swift

func hmac(forKeyAndData key: String?, data: String?) -> Data
{
    let cHMAC = [UInt8](repeating: 0, count: CC_SHA1_DIGEST_LENGTH)

    let cKey = Int8(key?.cString(using: String.Encoding.ascii.rawValue) ?? 0)
    let cData = Int8(data?.cString(using: String.Encoding.ascii.rawValue) ?? 0)

    CCHmac(kCCHmacAlgSHA1, cKey, strlen(cKey), cData, strlen(cData), cHMAC) 

    return Data(bytes: &cHMAC, length: MemoryLayout<cHMAC>.size)
}

Thursday, November 1, 2018

Know your MongoDB

Hi All,

From past many weeks I had this eagerness to know what MongoDB is? & how it actually works. Brainstorming and learning lead to an inference that configuration is simple & easy, just follow some steps and start your journey in the new world.

So follow the trail to know what it actually is...


What is Mongo DB
A document based Database that stores Data in JSON Format. The fields can vary from document to document & YES its FREE and OPEN SOURCE.


Pros

  • Dynamic : There is no defined schema so your collection and its document can be of user's choice,  style & need.
  • No Joins required that makes it simple and easy to use
  • Flexible : Fields addition, updation is super easy and has less/no impact on he Application
  • Easy Integration & Configuration
  • It is document based & highly powerful
  • Cloud storage and distribution is key feature
  • High performance


Cons

  • Not perfectly ACID compliant
  • No stored procedure.
  • No auto-increment default option however can be achieved using Javascript code logic


Configuration

  • Download from https://www.mongodb.com/download-center
  • Alternative way to install using Homebrew as $ brew install mongodb 
  • You can configure  on local as well as remote machine
  • From 3.6 version of mongodb both mongod and mongos binaries are by default bind to LocalHost
  • Open your terminal
  • Unzip the downloaded TAR in a folder named Mongo
    • $ cd Mongo
    • $ tar-zxvf mongodb-osx-ssl-x86_64-4.0.3.tgz
  • Move
    • $ sudo mv mongodb-osx-ssl-x86_64-4.0.3 /usr/local/mongodb
  • Create a folder where Mongodb can store/write data, by default location is /data/db which needs to be created manually with proper permissions
    • $ sudo mkdir -p /data/db
    • $ sudo chown [LOGGED_IN_USER] /data/db
    • The default location can also be changed using 
      • $ mongod --dbpath /your_directory
  • To access mongodb commands you have to create a ~/.bash_profile file & assign /usr/local/mongodb/bin to $PATH environment variable
    • $ cd ~
    • $ pwd /users/[LOGGED_IN_USER]
    • $ touch .bash_profile
    • $ open .bash_profile 
      • Above command opens a text editor, paste below 2 commands in there and save
      • export MONGO_PATH=/usr/local/mongodb
      • export PATH=$PATH:$MONGO_PATH/bin
  • Restart the terminal 
  • $ mongo -version
  • $ mongod 
    • above command start the mongo daemon
  • Open another terminal window
    • $ mongo
  • Now in this terminal window you will see 
      MongoDB server version: 4.0.3
      Welcome to the MongoDB shell



What is Mongo

  • This is a JS shell interface for MongoDB which access the database


What is MongoD

  • This is a daemon, a host process for the database which runs mongodb process in background.
  • This has several default params associated with it
    • It runs on port 27017
    • Stores data in /data/db

What is bash profile & its usage in MongoDB
  • Its a hidden file that loads before the Terminal loads the shell environment
  • It contains shell configurations and preferences.
  • MongoDB paths are set in this file


Difference between SQL and Mongodb


Sql ServerMongoDB
DatabaseDatabase
TableCollection
IndexIndex
RowDocument
ColumnField
JoinsLink
PartitionRange Partition


Monday, September 24, 2018

The Savior Commands of Hg : Mercurial

Hi all,


I am back after a long time. Many of you have been using HG / Mercurial for repository work. So here goes the list of commands that I find useful and handy:

[ui]
username = swati <swati.srivastava@gmail.com>

$ hg clone <repo url> 
-- Clone from a URL


$ hg st
-- Get the status/list of all uncommitted changes


$ hg st -a
-- Get the status/list of all added files


$ hg st -m
-- Get the status/list of all modified files


$ hg st -r
-- Get the status/list of all removed files


$ hg heads
-- Get the list of all heads



$ hg tip

-- Get the latest revision of the current branch


$ hg addremove
-- Adds new files and removes the deleted files from your file system


$ hg commit -m "commit message"
-- Commit the data/files with a message


$ hg pull
-- Fetches all the code/files committed by other on all branches



$ hg update
-- Updates the working copy with the latest code


$ hg update tip
-- Updates the working copy with the latest code of the tip


$ hg update -r <revision no>
-- Updates the working copy with the latest code of the revision no mentioned


$ hg push
-- Push your committed code


$ hg push -r <revision no>
-- Push your committed code of a particular version


$ hg merge
-- Merge the code


$ hg revert
-- Undo / Discard all the uncommitted changes


$ hg strip <changeset>
-- Srips / removes the particular changeset. This may lead to error
hg : unknown command named strip
'strip' is provided by the following extension mq : manage stack of patches

Solution: open .hgrc file and write
[extensions]
mq = 



$ hg rollback
-- Rollbacks an accidental commit


$ hg diff -r<revision 1> -r<revision 2>
-- Provides difference between 2 revisions


$ hg help
-- Get a help on all types of available commands






Monday, April 9, 2018

Sensors in iPhones

Hi All,

Today I would like to share info about various sensors used in iPhones. The list may increase with time.

So here we go..

Accelerometer: Measures force of acceleration caused by any movement
  • Informs about the device Orientation.
  • Captures all the values of X, Y, Z axis.
  • Used in Gaming.
  • Available from iPhone 2G.


Gyroscope: Captures earth gravity to calculate the orientation
  • Informs about rate and angle of Rotation.
  • Used in Virtual reality.
  • Used in 360-degree rotation of images and videos.
  • Available from iPhone 4.


Finger Print Sensor: Using a capacitive touch to capture User's Finger Print

  • The Users finger can be oriented in any direction and it will be able to read.
  • Used for secure login.
  • Available from iPhone 5S.


Proximity Sensor: Detects how close is the screen to the user's body
  • Used to informs device that phone is held near ears for calling purpose so turn off the light.
  • Used to avoid accidental touch on screens.
  • Available from iPhone 2G.


BarometerCaptures altitude and elevation changes
  • Measures air pressure and temperature.
  • Used in Weather App.
  • Available from iPhone 6.


Magnetometer: Captures strength of the magnetic around the device
  • Used in Compass.
  • Available from iPhone 3GS.


Ambient Light Sensor: Adjusts the brightness of the screen depending on the amount of light its exposed to
  • Used to Conserve battery.
  • Used to avoid harmful effects of light on eyes.
  • Available from iPhone 2G.

Hope its helpful!!!

Thursday, August 24, 2017

NWJS & Mac App : Signing and Submission to Store

Hi Guys,

I am feeling very relieved and relaxed today. Wanna know WHY???

Finally I am able to sign the nwjs mac app with App store 3rd Party App and Installer certificates and create the package and yippie its on App store. :) :) :)

Lets proceed towards the starting point and follow a path to Successful upload. Here you go.


Pre-requisites for Mac App Store Upload:
  • All Apps must have Sandbox enabled. Yes its mandatory.
  • Bit Code is not supported in Mac Apps. So chill.
  • App must be packaged and submitted using Apple's packaging technology included in xcode or via command line tools.Third party installers are not allowed.
  • Bundle Display name, identifier must be properly set.
  • Provide proper Icon Files.

Mac App Certificates and their Naming Conventions:
  • The name begins with:
    • “Mac Developer” for a Mac Development certificate.
    • “3rd Party Mac Developer Application” for a Mac Submission certificate.
    • “3rd Party Mac Developer Application” for a Mac Submission certificate.
    • “3rd Party Mac Developer Application” for a Mac Submission certificate
  • Both your distribution and developer certificates appear in the My Certificates category in Keychain Access. 
    • The distribution certificates begin with the text “3rd Party Mac Developer” followed by the type of certificate and your team name.
  • Only a team agent or admin can obtain and use Distribution certificates or Developer ID certificates.


Things to Do:

  • In Info.plist of your App 
    • Add a key [if not present] named Application Category and choose its value from list provided.
    • Delete key CFBundleDocumentTypes and its Values

  • Ensure that all the files can be read by Non root users. for this you can run command in terminal
    • $ cd path_to_nwjs.app
    • $ chmod a+rX *
    • $ chmod -R u+rwX,go+rX,go-w *
    • Provide readable permission to app file , Parent and Child plists also that will be served as entitlements while code signing the app.

  • Create Parent and Child Entitlements.





  • Set the Bundle identifier of the NWJS Helper App.

  • Set the Bundle Identifier of the App_mode_loader App.

  • Now Sign the App and create package to be uploaded:
    • $ codesign -f --deep -s "3rd Party Mac Developer Application : Organization_Name (Team ID)" --entitlements Child.plist hello.app/Contents/Version/59.0.3071.115/nwjs\ Framework.framework/Resources/app_mode_loader.app
    • $ codesign -f --deep -s "3rd Party Mac Developer Application : Organization_Name (Team ID)" --entitlements Child.plist hello.app/Contents/Version/59.0.3071.115/nwjs\ Framework.framework/Versions/A/Helpers/crashpad_handler
    • $ codesign -f --deep -s "3rd Party Mac Developer Application : Organization_Name (Team ID)" --entitlements Child.plist hello.app/Contents/Version/59.0.3071.115/nwjs\ Framework.framework/Versions/A/XPCServices/AlertNotificationService.xpc/Contents/MacOS/AlertNotificationService
    • $ codesign -f --deep -s "3rd Party Mac Developer Application : Organization_Name (Team ID)" --entitlements Child.plist hello.app/Contents/Version/59.0.3071.115/nwjs\ Framework.framework/libnode.dylib
    • $ codesign -f --deep -s "3rd Party Mac Developer Application : Organization_Name (Team ID)" --entitlements Child.plist hello.app/Contents/Version/59.0.3071.115/nwjs\ Framework.framework/libffmpeg.dylib
    • $ codesign -f --deep -s "3rd Party Mac Developer Application : Organization_Name (Team ID)" --entitlements Child.plist hello.app/Contents/Version/59.0.3071.115/nwjs\ Framework.framework
    • $ codesign -f --deep -s "3rd Party Mac Developer Application : Organization_Name (Team ID)" --entitlements Child.plist hello.app/Contents/Version/59.0.3071.115/nwjs\ Framework.framework/Versions/A/nwjs\ Framework
    • $ codesign -f --deep -s "3rd Party Mac Developer Application : Organization_Name (Team ID)" --entitlements Child.plist hello.app/Contents/Version/59.0.3071.115/nwjs\ Helper.app
    • $ codesign -f --deep -s "3rd Party Mac Developer Application : Organization_Name (Team ID)" --entitlements Parent.plist hello.app

  • Create Package:
    • $ Productbuild --component "hello.app" /Applications --sign "3rd Party Mac Developer Installer : Organization_Name (Team ID)" --product "hello.app/Contents/Info.plist" myPackage.pkg

  • Upload this package using Application Loader. Choose the latest one.

You may also face some Errors:

  • The Session status is failed and the error description is "failed to open ssh session. (16)"
    • Open Preferences of Application Loader.
    • Click Advanced
    • Select only DAV and unselect Signiant and Aspera.
  • Resource fork : Finder information or similar ditritus not allowed
    • $ xattr -cr hello.app
  • Malformed framework : Framework must contain symbolic link
    • Choose nwjs version that already has inbuilt support for symlinks.
  • Unsealed contents present in the root directory of an embedded framework.
    • Do not change Info.plist files other that nwjs , nwjs Helper and app_mode_loader.app

Fix the issues and upload again.
Success is here....


Hope you guys find it useful.
Thanks a lot for the view.


:)
:)







Monday, June 19, 2017

Terminal : Commands of Daily Use

Hey folks,

Please have a look at some cool terminal commands


1. Show / hide Hidden Files : Do relaunch finder after you hit this command
$ defaults write com.apple.finder AppleShowAllFiles true / false


2. Copy Contents of folder to another
$ ditto <path of Source Folder> <Path of Destination Folder>
ditto /Users/admin/Documents/test /Users/admin/Documents/Swati/try


3. Zip a Folder
Zip -r <path of resultant zipped file> <Folder to be zipped>
$ zip -r test.zip  test 
Zip -r <path of resultant zipped file> <Folder to be zipped> -x <file not to be included in zip>
$ zip   -r  test.zip test  -x "*.DS_Store” 


4. Unzip archive
Unzip  <path of zipped file>
$ Unzip test.zip


5. Custom message on Login Window
Sudo defaults write  <path of login window> LoginwindowText "custom text"
$ sudo defaults write /Library/Preferences/com.apple.loginwindow LoginwindowText "This is Swati's Mac.. "





6. Show AnyWhere option in GateKeeper of MAC OSX Sierra or Disable GateKeeper
Sudo spctl <prefixes>
$ sudo spctl --master-disable


7. Enable GateKeeper
Sudo spctl <prefixes>
$ sudo spctl --master-enable


8. Download content from any url
Curl -0 <url>
$ curl -0 http://file-to-be-downloaded.flv


9. To know the network connectivity
Ping <host>
$ ping google.com


10. Lets talk
say "your text"
$ say "Hello Swati"



Hope its useful :)



Sunday, June 18, 2017

Dealing with Gatekeeper in OSX Sierra

Hi all,

Found something interesting in OSX Sierra. The gate keeper showed only 2 options





No Anywhere option in Gatekeeper. :(

But you can make it visible by running command in Terminal. So to

Disable GateKeeper
sudo spctl --master-disable


Enable GateKeeper
sudo spctl --master-disable



Thanks for reading :)

Wednesday, June 14, 2017

The case of Missing 'Archive'

Hey Folks,

Many of you might have faced this issue..
You start your day with creating an archive to get it tested or to upload to App store but AFAIK no archive created or created with ZERO bytes.

Had faced the same issue multiple times and solved it with different steps.
So here you go. It might help some one.


Steps that should definitely be followed:


Set Installation Directory in Build Settings of the Target

  • /Applications

Set Skip Install of Project
  • NO


Set Skip Install of Targets / Libraries for Release Scheme
  • NO


Set Skip Install of Targets / Libraries for Debug Scheme
  • YES


Check Compile Sources of all the Targets
  • Files should be listed here



Thanks to All....

Tuesday, June 13, 2017

Appstore Build Create, Upload & Test

Hey Folks,

I know you guys know the process 😉
But its worth sharing what say!!!

Create AppStore Build
  • Open Project
  • Select Target
  • Click General 
    • Set Display Name Bundle Identifier, Version and Build.
  • Click Build Settings
    • Choose Appstore Provisioning Profile corresponding to Bundle Identifier.
    • For Release Scheme choose the Certificate corresponding to the provisioning profile.
    • Now click Target Selector next to Stop Button
    • Click Archive
      • Choose Build Configuration as Release
      • Tick mark on "Reveal Archive in Finder"
    • Click on Product 
      • Click Archive : This will start the build creation.
    • Choose Always Allow for Code-signing Popup
    • Build Succeeded Toast will be shown
    • An organizer will be visible which will show your archive.
    • Right Click to show in Finder
    • You will see <TARGET><DATE>, <TIME>.xcarchive
      • Right click to Show Package Contents
      • Products >> Applications >> Build_Display_NAME.app
      • Drag and Drop this .app file in iTunes
      • Right click on the app in iTunes and click Show In Finder
      • You will see the IPA for Appstore.
    Note:
    Sometimes SwiftSupport folder is not embedded under .app.
    But you need to do this if you give swift support in App.
    So follow these steps:
    • Create a Folder Test
      • Copy SwiftSupport Folder inside Test
      • Unzip ipa and add Payload folder here inside Test
      • Open Terminal
      • Type Command : $ zip -r Name.ipa Payload SwiftSupport -x "*.DS_Store"
      • -r is for adding and -x is for removing files
      • Enter
      • A new IPA is generated with SwiftSupport


    Upload AppStore Build using Application Loader


    • Open Latest Application Loader
    • Login with Apple ID


    • Choose your IPA that you wish to upload.



    • It will start reviewing your app.



    • Then it will show you the App details.
    • Check them and click Next.



    • Now its starts adding application.
    • Then it uploads package to Appstore.
    • Uploaded package to the Appstore.
    • Click Next.



    • Success message is displayed.
    • Click Done.



    View In iTunes Connect
    • Visit https://itunesconnect.apple.com/
    • Login with Apple Id
    • Click on My Apps
    • Click on your App
    • Goto Activity Tab
    • You will see your versioned app with text (Processing)
    • Once processing is done you will see the new versioned build under TestFlight Tab.
    • Now its available for testing.
    • You can add testers either via User and Roles section or via sending invitation emails to users under TestFlight tab.


    Happy Coding
    Enjoy Uploading and Testing 😀😁😃



      Tuesday, March 28, 2017

      Swift 3.0 Cheat Sheet


      Hi All,
      Started learning Swift 3.0. Need transformed to LOVE :)
      Gathered some data that I would like to share with all.

      So below is Objective C Code and its corresponding Swift 3 Code




      ============= Variables =============


      Strings declaration
      Objective C : Type is Must for Variable or Constant
      double price = 23.55;NSString *firstMessage = @"Swift 3 is awesome. ";

      Swift : Variable Type is Not Required, this feature is called "type inference"
      var price = 123.55
      let firstMessage = "Swift 3 is awesome.



      Mutable and Immutable + variables and constants
      Objective C 
      double price = 23.55;
      int const temp = 100;

      Swift : Var is for mutable variable and let is for immutable constant, VAR is must if LET is not used
      var price = 23.55
      let temp = 100;



      Using Pointer symbol?
      Objective C
      NSString *str = @""Hello world"";

      Swift
      var str = "Hello world"



      ============= Strings ============= 


      Strings declaration
      Objective C
      NSString *str = @"Hello world";

      Swift 
      var str = "Hello world"



      String Concatenation
      Objective C
      NSString *a = @"Hello";
      NSString *b = @"World";
      NSString *str = [NSString stringWithFormat:@"%@%@",a,b];

      Swift 
      var a = "Hello"
      var b = "World"
      var str = a + b



      String Comparison
      Objective C 
      [a equalsTostring:b]

      Swift
      a == b




      Imports
      Objective C 
      #import <UIKit/UIKit.h>

      Swift 
      import UIKit


      Line Termination
      Objective C
      NSString *a = @"Hello";

      Swift 
      var a = "Hello"


      Logs
      Objective C 
      NSLog(@"test");

      Swift
      print("test")


      Colors
      Objective C
      [UIColor redcolor];

      Swift 
      UIColor.red


      Pragma Marks 
      Objective C
      #pragma mark - Separators

      Swift  
      // MARK: 


      Arrays 
      Objective C
      NSMutablearray *arr = [NSMutableArray alloc] init];
      [arr addObject:@"first"];
      [arr addObject:@"second"];
      [arr addObject:@"third"];

      Swift
      var arrayOfInts: [Int]
      var numbers: [Int] = []var listOfNames = ["Sam", "Andrew", "George"] // an array of strings
      var arrayOfStrings: [String] = ["We", "Love", "Swift"]
      var listOfNumbers = [1, 22, 13, 10, 100] // an array of numbers


      Dictionaries 
      Objective C : Keys can only be string
      NSMutableDictionary *dict = [NSDictionary alloc] init];
      [dict setValue"@"SWATI" forKey:@"NAME"];

      Swift : keys can be anything
      var dict = [String:String]()
      dict["NAME"] = "SWATI"


      Button Clicks 
      Objective C
      -(IBAction)buttonClicked:(NSString*)str;

      Swift
      @IBAction func buttonClicked();


      Parameterized Methods
      Objective C
      Signature:- (void)showAlertWithTitle:(NSString*)title andMessage:(NSString*)message;
      Calling:[self showAlertWithTitle:@"Hello" andMessage:@"Welcome to Objective C"];

      Swift
      Signature:showAlert(title:String , message:String)
      Calling:showAlert(title:"Hello", message:"Welcome To Swift")


      Enums 
      Objective C
      enum WebServiceType
      {   
          WebServiceTypeLogin,    
          WebServiceTypeFetchData
      }
      Usage : WebServiceTypeLogin use as it is when required

      Swift
      enum WebServiceType:Int
      {    
        case Login = 1   
        case FetchData = 2
      }
      enum NetworkStatusCode:Int
      {
        case Success = 1 
        case Failure = 2
      }
      Usage : NetworkStatusCode.Success


      Protocols 
      Objective C
      @protocol WebServiceResponseDelegate:NSObject
      {
       @optional
       - (void)test; 

      @required
      - (void)webServiceResponse:WebservicesManager
                        finishedTaskType:WebServiceType                                                                                                            status:NetworkStatusCode                                                                                                               id:remoteData
      }

      Swift
      protocol WebServiceResponseDelegate:class
      {
            func test();   
            func webServiceResponse(assistant:WebServicesManager ,                                                                                  finishedTaskType:WebServiceType ,                                                                                                           status:NetworkStatusCode ,                                                                                            remoteData:Any)
      }

      How to make some methods in a protocol as Optional coz by default methods are mandatory to implement 
      @objc protocol abc { func test() }

      How to call methods using delegates
      Objective C
      [delegate webServiceResponse:self                 
                             finishedTaskType:finishedTaskType   
                                              status:NetworkStatusCodeSuccess       
                                     remoteData:@""];

      Swift
      delegate.webServiceResponse(assistant:self, 
                                        finishedTransaction:finishedTransaction,  
                                                             status:NetworkStatusCode.Success,         
                                                    remoteData: ""); 


      Exception Handling

      Objective C
      @try {}
      catch (NSException *e) {}
      finally {}

      Swift
      do{}catch{}