This blog has moved to new location
Please visit : http://www.jeenalinfotech.com/
Advertisements

Parse service will be shutting down


On January 28th, 2016, terrible news for the developer who are using Parse for their app’s back end. They have announced that Parse service and Parse will be fully shutting down next year i.e. January 28th, 2017.

Click here to read more on their official blog.

As parse will be shutting down their service, we need to find the Parse alternatives or have to write our own backend. For individual developer like me, to write the backend for my mobile app and to host on server is not possible. So, I have started out searching for the Parse alternative for my iOS mobile app and I have found the following list on github.

Check out Parse alernatives: https://github.com/milanpanchal/ParseAlternatives

P.S.

Comment out your favourite Parse alternative. 🙂

 

How to disable (ATS) Application Transport Security on Xcode 7


With the launch of iOS 9, Apple added a new level of security for communication of app and its web services. If you are creating any connection using NSURLConnection or NSURLSession in iOS 9 then you will need to use “App transport security (ATS)”, which will reject any insecure connections.

iOS 9 released has “App Transport Security” which encourages developers to use https instead of http.

App Transport Security has blocked a cleartext HTTP (http://) resource load since it is insecure. Temporary exceptions can be configured via your app’s Info.plist file.

To ignore all app transport security restrictions, add following key in your app’s Info.plist file.

<key>NSAppTransportSecurity</key>
<dict>
<!--Include to allow all connections (DANGER)-->
<key>NSAllowsArbitraryLoads</key>
      <true/>
</dict>

ATS.png

 

Also, You can add exceptions for specific domains in your Info.plist:

<key>NSAppTransportSecurity</key>
<dict>
    <key>NSAllowsArbitraryLoads</key>
    <false/>
    <key>NSExceptionDomains</key>
    <dict>
        <key><!-- your_remote_server.com / localhost --></key>
        <dict>
            <key>NSIncludesSubdomains</key>
            <true/>
            <key>NSExceptionAllowsInsecureHTTPLoads</key>
            <true/>
            <key>NSExceptionRequiresForwardSecrecy</key>
            <true/>
        </dict>
    <!-- add more domain here -->
    </dict>
</dict>
ATS#2.png

P.S.
See Apple’s Info.plist reference for full details

How to remove transparency from image(s)?


If you have set of images with transparency, and want to remove transparency from all the images?

You can achieve that by simply using imagemagick, by using following command:

$ mogrify -alpha off image-name.png

First of all make sure you have install the imagemagick. If not then install it using following command:

  • Using apt repositories:
    $ apt-get install imagemagick
  • Using brew:
    $ brew install imagemagick --disable-openmp --build-from-source

If you want to remove alpha channel (transparency) from multiple images then, move all images into one folder and navigate to that folder and use the following command:

$ mogrify -alpha off *.png

It's done! Using single command from ImageMagick we removed alpha channel from all PNG images.

You can also check whether Image contain alpha channel or not by running following command:

$ sips -g all image-name.png

Where -g stands for, --getProperty key

I'm sure you will fall in love with ImageMagic as you explore its usage.

To add border to the image or set of images:

$ mogrify -mattecolor black -frame 10x10 image-name.jpg

You can use the same command to apply multiple border to the image(s)

To convert image into gray scale image(s):

$ mogrify -type grayscale image-name.jpg

To resize the image(s):

$ mogrify -resize 50% image-name.jpg
$ mogrify -resize 500x500 image-name.jpg #To maintain the aspect ratio
$ mogrify -resize 500x500\! image-name.jpg #To ignore the aspect ratio

Xcode6: IBDesignable and IBInspectable with Objective-C


With the release of Xcode6, Apple brought some great improvement to interface builder. With new Xcode6 now you can design custom views via Interface builder. You can achieve live rendering of custom views via IB_DESIGNABLE and IBInspectable attributes.

In this blog, I will give you an overview of IB_DESIGNABLE and IBInspectable attributes. So let’s create a demo project and follow the steps.

  • Create new Project (File > New > Project)
  • Select iOS > Application > Single View Application template.
  • Choose a template for new file (File > New > File)
  • Create new Cocoa Touch Class (iOS > Source > Cocoa Touch Class)
  • Give name to to the subclass “SAMCustomView” and subclass to UIView
  • Add IB_DESIGNABLE keyword to above the @interface in header file of the custom view. (In our case its SAMCustomView.h)
  • Add the IBInspectable to the property in the custom view class
  • Now select the Storyboard or XIB file and drag the UIView in Storyboard or XIB
  • Select the added UIView
  • Select the Identity inspector
  • Change Custom class name to SAMCustomView
  • Now select the Attribute Inspector for the added view and see the magic 🙂

Sample code will look like as follow.

#import <UIKit/UIKit.h>

IB_DESIGNABLE

@interface SAMCustomView : UIView

@property (nonatomic) IBInspectable UIColor *startColor;
@property (nonatomic) IBInspectable UIColor *midColor;
@property (nonatomic) IBInspectable UIColor *endColor;
@property (nonatomic) IBInspectable NSInteger borderWidth;
@property (nonatomic) IBInspectable CGFloat cornerRadious;
@property (nonatomic) IBInspectable BOOL isHorizontal;

@end

Screenshot:

screenshot1

Currently, IBInspectable support following types.

  • Int
  • CGFloat
  • Double
  • String
  • Bool
  • CGPoint
  • CGSize
  • CGRect
  • UIColor
  • UIImage

To support older Xcode you just need to add empty macro for IBInspectable, like so:

#ifndef IBInspectable
    #define IBInspectable
#endif

If you found this useful please take a moment to share this with your friends 🙂

Get the source code on github.

what are the alternatives to TestFlight ?


Looking for TestFlight alternatives? Here’s a list of Test Flight Alternatives you can try.

# Name Free/Paid Platform Comments
1 HockeyApp Paid iOS, MAC, Android & Windows Crash reports, Analytics, In-app user feedback. Acquired by microsoft
2 Applause Paid iOS & Android Crash reports, Analytics, In-app user feedback/bug report. Also work after your app will become live.OTA distribution.
3 Appaloosa Paid iOS, Android & Windows Targets enterprise app developers
4 AppBlade Paid iOS, Android & BlackBerry Secure your app beta, encrypt app data, and even completely wipe a tester’s device afterwards.
5 Installr Paid iOS & Android
6 Ubertesters Free & Paid iOS, Android & Windows In-app bug editing, marking, reporting and user feedback. OTA App destribution. Custom Logging.
7 TestFairy Free & Paid iOS & Android Crash reports, Report for CPU, memory, battery,Network, heat maps and more. Video output for bugs. User feedback on shake
8 HockeyKit Free iOS & Android Open source version of HockeyApp
9 Diawi Free iOS & Android Distribute app via link

I recommended to use TestFairyIts very simple to use and provide what all you want.

What is the maximum size of an iOS application?


As of February 12, 2015

The size limit of an app package submitted through iTunes Connect has increased from 2 GB to 4 GB, so you can include more media in your submission and provide a more complete, rich user experience upon installation. Please keep in mind that this change does not affect the cellular network delivery size limit of 100 MB.

This information can be found on Apple news “Now Accepting Larger Binaries“.