About Muzammil

Hey Guys, I am Muzammil Mohammad. Having 7 years of experience in iOS development. I am here to share my knowledge with all mobile application developers and those companies who are stuck on development (due to bad quality of code or don't know what to do) or want to know how to build a good mobile app. I believe I am more expert in UI and Architecture design of mobile app. So if you need my helps or assistant for your mobile app projects, Feel free to contact me. I will try my best to improve the quality of your app. Or you can hire me to develop your apps. I’d love to talk with you. Best!

How to create your own CocoaPods framework

Hello Everyone,

I hope you are well aware with CocoaPods and how to use this inside your XCode projects. If you are not well aware, follow my previous blog about how to use CocoaPods.

Now it is time to learn to build your own Pod framework.

Setup – What you need?

  • git account.
  • Make sure git is installed in your Mac machine. Because we will do all git commands from terminal only. (using source tree or any other application for git commands is not recommended)
  • Make sure your system is updated and you have latest Ruby Gems installed.
    $ sudo gem update --system
  • Install CocoaPods if you don’t have Pods installed in your Mac machine.
    $ sudo gem install cocoapods

Create your Pod framework

  1. Open terminal and redirect to desired folder where you want to put your Pod Framework.
  2. Create your framework with the command pod lib create. Here I am giving my Pod framework name ‘MZFacebookManager’.
  • $ pod lib create MZFacebookManager
This will ask you some series of questions. You can answer based on your choice. Like for my case I have given answers like this:
  1. What language do you want to use? [ ObjC / Swift ]
     - ObjC
  2. Would you like to include a demo application with your library? [ Yes / No ]
     - Yes
  3. Which testing frameworks will you use? [ Specta / Kiwi / None ]
     - None
  4. Would you like to do view based testing? [ Yes / No ]
     - No
  5. What is your class prefix?
     - MZ

Once you are done it will create the folder for MZFacebookManager. Inside this you can see structure like:

Screen Shot 2017-04-06 at 1.19.25 PM

.podspec file at the root is important file. This will contains your Pod version, dependencies, git url etc with some other Pod descriptions. You can edit the details, version and also define dependencies if your Framework is using any other third party Framework. Like in my case, my Framework is using ‘FBSDKLoginKit‘ and ‘FBSDKCoreKit‘.

Screen Shot 2017-04-06 at 1.20.49 PM

Once you are done with editing of podspec file you need to validate this file. You can do this with Pod lib lint command.

$ pod lib lint

Screen Shot 2017-04-06 at 1.36.27 PM
Now open github website and create a new repository for MZFacebookManager (give your Framework name).

Screen Shot 2017-04-06 at 1.45.58 PMOnce it is created, go back to terminal again and push your code (You can also ignore this Push if you don’t want to push a default code on your git).

But if you want to push, just make sure once again your .podspec file is defined the correct url of git repository.

s.source = { :git => 'https://github.com/muzammil-triffort/MZFacebookManager.git', :tag => s.version.to_s }

Push your code on git: 

$ git push

This will push the default code of your Framework. Now open XCode again and add your Framework files.

  • Delete ReplaceMe file
  • Add your ObjC or Swift files (based on the project type you have chosen at the start)
  • Like i have added three files inside development i.e. MZFacebookManager.h, MZFacebookLoginManager.h and .m files. These files will show when you install the Pod Framework.

Screen Shot 2017-04-06 at 2.00.39 PM

Once all files added and there is no error in your code. Update the version of your Framework by updating this inside .podspec file (0.1.1) and run lib lint command again to make sure everything is correct.

$ pod lib lint

When validation success, now first push the code on git by giving a tag.

$ git tag 0.1.1

$ git push origin 0.1.1

Push your Pods Spec

$ pod trunk push MZFacebookManager.podspec 
At first time you will get the error message to resgister your session:
[!] You need to register a session first. 
$pod trunk register muzammil@triffort.com 'Muzammil' --description='Testing'

Replace my email id and name with yours. This will send a verification link on your mail. Once you verified, you can continue with terminal.

$ pod trunk push MZFacebookManager.podspec 
If all goes well Pod spec successfully update on git and you can see it is showing the description and other Pod details on home page of your git repository.
You can also add –verbose in lib lint and trunk push command to see the detail result (in case of error).
If you open your github repository, you can see screen like this:
Screen Shot 2017-04-06 at 2.22.10 PM
 Summary
# Create Library
pod lib create LibraryName
# Verify podspec
pod lib lint
# Push the podspec
pod trunk push LibraryName.podspec

Yeah! You are done with your first Pod Framework. It’s time to have some nice coffee. 

Still facing any issue with Pod? Or want to be in touch with us? Contact us:

Email:  muzammil@triffort.com Skype: muz.iphonedev

Triffort_logo

Triffort Technologies Pvt Ltd
www.triffort.com

How to use CocoaPods with Swift project

If you already know how to install and use CocoaPods then continue else please first visit my previous blog “How to install CocoaPods in XCode” (for Objective-C).

Using CocoaPods or any Objective C library in Swift is not a big deal. XCode is quite smart and it automatically do this for you. You can also check Apple’s documentation on this Using Swift with Cocoa and Objective-C. Once libraries are added, you only need to use a bridging header between Objective-C and Swift and use the new coding style of Swift for calling those methods. Like [MBProgressHUD show] become MBProgressHUD.show( ) etc. Here I am using the example of MBProgressHUD because it is normally used in most of the projects.

Let’s see how it works:

1. Create a new XCode project and select the language Swift (no need to to this if you already have Swift project).

2. Create a Bridging-Header.h file starting with your project name. like, if my project name is SampleProject, bridging header become: SampleProject-Bridging-Header.h and Put this header at the root directory of your project.

If you are not very sure how to do this, the most simplest way is to add a test objective-c file in your project (remove that later). Xcode will prompt an option to configure bridging. When you press Yes, XCode automatically create the bridging file and put inside root of project directory.

bridging

Added Bridging Header:

bridging-file

3. Setup Pod with your project.

4. Add your Pod libraries inside bridging header file as you were normally using in Objective C project.

pod-files

6.  Now you can access MBProgressHUD methods in your swift like:

        MBProgressHUD.showHUDAddedTo(self.view, animated: true)
        MBProgressHUD.hideAllHUDsForView(self.view, animated:true)

xcode-swift

You can download my SampleProject from git. While reading this if you notice that step5 is missing, then cheers!! you follow this carefully and you understand how it works 🙂

Still facing any issue with Pod? Or want to be in touch with us? Contact us:

Email:  muzammil@triffort.com Skype: muz.iphonedev

Triffort_logo

Triffort Technologies Pvt Ltd
www.triffort.com

Apple WatchKit SDK is now available for developers

Apple today announced that its set of WatchKit development tools with XCode 6.2 (beta) are now available for developers, allowing them to begin creating apps for Apple Watch.

#watch #apple #watchkit

The WatchKit framework (WatchKit.framework) contains the classes that a WatchKit extension uses to manipulate the interface of a Watch app. A Watch app contains one or more interface controllers, each of which can have tables, buttons, sliders, and other types of visual elements. The WatchKit extension uses the classes of this framework to configure those visual elements and to respond to user interactions.
“Apple Watch is most personal device ever, and WatchKit provides the incredible iOS developer community with the tools they need to create exciting new experiences right on your wrist.”
The WatchKit extension contains the code for managing the Watch app’s user interface and responding to user interactions. With those two executables, you can support different types of user interactions on Apple Watch:

  • Your Watch app contains your app’s full user interface. The user launches your app from the home screen and uses the app to view or manipulate data. To get started creating a Watch app, see App Essentials.
  • glance is an optional read-only interface that you use to display the most timely and relevant information from your app. Not all apps need a glance, but having one gives the user a convenient way to access your app’s data. To get started creating a glance interface, see Glance Essentials.
  • Custom notification interfaces let you alter the default interface displayed for recently received local and remote notifications and add custom graphics, content, and formatting. Custom notification interfaces are optional. To get started with creating a custom notification interface, see Notification Essentials.

In addition to sharing these use cases for the Apple Watch, Apple has also created a dedicated Apple Watch site for developers, outlining the difference between full apps, Glances, and actionable notifications, offering download links to the iOS 8.2 beta with WatchKit SDK, and providing design guidelines and templates.

Feel free to send us message for any kind of assistance in developing apps for Apple Watch.

Email:  muzammil@triffort.com Skype: muz.iphonedev

Triffort_logo

Triffort Technologies Pvt Ltd
www.triffort.com

iPhone Resolutions

Yesterday Apple launched two new iPhones and Apple watch. As a developer personally i believe these iPhones looks like a pain for us. You have to manage different resolution size now, as it was painful for Android. But in keynotes they said, there will be no issue with Auto layout settings.

2

So now we have these resolutions (in pixel) :

iPhone 6 Plus (5.5 inch) : 1920-by-1080
iPhone 6 ( 4.7 inch) : 1334-by-750
iPhone 5, 5C, 5S (4 inch) : 1136-by-640
iPhone 4S : 960-by-640
iPhone 4 and below : No need to build app for this.

Now Apple is also accepting iPhone6 and iPhone6+ screen shots on iTunes connect. You can upload video preview also for your app, but for this you have to use Safari and OSX v 10.10 or later.

1What are your thoughts on these new devices?

Wants to be in touch with us?

Email:  muzammil@triffort.com Skype: muz.iphonedev

Triffort_logo

Triffort Technologies Pvt Ltd
www.triffort.com

 

Top 10 reason for iOS App rejection

Apple’s review process is infamous within the independent developer community. With its inconsistent approach to approval and rejection, apparent skirting around the rules for big players, and its notoriously vague rejection reasons. According to a survey 54% developers said it was the most frustrating thing about developing for iOS.

Total Percent of App Rejection
58% : Belongs to top 10 %
48% : Other reasons.

Top 10 reason during ending August 28, 2014

14% More information needed

8% Guideline 2.2: Apps that exhibit bugs will be rejected

6% Did not comply with terms in the Developer Program License Agreement

6% Guideline 10.6 : Apple and our customers place a high value on simple, refined, creative, well thought through interfaces. They take more work but are worth it. Apple sets a high bar. If your user interface is complex or less than very good, it may rejected.

5% Guideline 3.3: Apple with names, descriptions, or screenshot not relevant to the App content and functionality will be rejected.

5% Guideline 22.2 Apps that contain false, fraudulent or misleading representations or use names or icons similar to other Apps will be rejected.

4% Guideline 3.4: App name in iTunes Connect and as displayed on a device should be similar, so as not to cause confusion.

4% Guideline 3.2 : Apps with placeholder text will be rejected.

3% Guideline 3.8 : Developers are responsible for assigning appropriate ratings to their Apps. Inappropriate ratings my be changed/deleted by Apple.

2% Guideline 2.9: App that are “Beta”, “Demo”, “Trial”, or “Test” versions will be rejected.

I hope this will help you while submitting your new iOS App.

Wants to be in touch with us?

Email:  muzammil@triffort.com Skype: muz.iphonedev

Triffort_logo

Triffort Technologies Pvt Ltd
www.triffort.com

 

How to install CocoaPods and setup with your Xcode project

Sometimes we are using many Git libraries inside our app. Like JSONKit, AFNetworking,  MBProgressHUD, EGOTableViewPullRefresh, Facebook-iOS-SDK etc. But it is very boring to build all libraries or if you add the code in your project, it is tough to manage. Also, there are many disadvantages in this:

  • Code that could be somewhere else is stored in your repository, wasting space.
  • Sometimes, it’s hard to get a specific version of a library.
  • There’s no central place where you can see which libraries are available.
  • Finding a new version of a library and updating your project with it is time taking and sometimes, painful.
  • Downloading libraries manually creates a tendency to perhaps make some changes to the downloaded code.
  • Updation is harder.

The most simplest solution is to use CocoaPods.

CocoaPods is the dependency manager for Objective-C and Swift projects. It has thousands of libraries and can help you scale your projects elegantly. CocoaPods is built with Ruby and is installable with the default Ruby available on OS X.

Installation:

Before installing Pods make sure you have installed/updated command line tool in your Mac machine. You can check this by opening Xcode, navigating the menu to Xcode > Preferences > Downloads > Components, finding Command Line Tools and select install/update.

command-line-tools

Also, make sure Git is installed in your Mac machine.

Open terminal and run this command:

sudo gem install cocoapods

Enter admin password. This could take a while. After few minutes it will show green message is cocoa pods installed successfully in your mac machine.

If you are getting any error with XCode like developer path is missing. First run this command in terminal: sudo xcode-select -switch /Applications/Xcode.app (or your XCodeName.app)

Hurrah….You successfully installed CocoaPods in your mac machine. Now you can setup Pod with your Xcode project.

How to setup POD for your Xcode project:

1. Open Terminal

2. Change directory to your XCode project root directory (where your ProjectName.xcodeproj file is placed).

3. $ pod setup : (Setting up CocoaPods master repo)

If successful, it shows : Setup completed (read-only access). So, you setup everything. Now Lets do something which is more visible…Yes ! Lets install libraries in your Xcode project.

Steps to add-remove-update libraries in pod:

1. Open Terminal

2. Change directory to your XCode project root directory. If your terminal is already running then no need to do this, as you are already at same path.

3. $ touch podfile

4. $ open -e podfile (This should open a blank text file or you can use: open -a Xcode podfile to open this inside Xcode)

5. Add your library names in that text file. You can add new names (lib name), remove any name or change the version. If you are using CocoaPods 1.0 or above you also have to have a ‘target’ section in your Pod File.

target '<Your Target Name>' 
do 
 pod 'AFNetworking', '~> 3.0' 
 pod 'FBSDKCoreKit'
 pod 'JSONKit'
 pod 'MBProgressHUD'
end

NOTE: Use ( control + ” ) button to add single quote at both end of library name. It should be shown as straight vertical line. Without control button it shall be added as curly single quote which will give error while installation of file.

6. Save and close this text file. Now libraries are setup and you have to install/update it.

7. Go to your terminal again and run this command: $ pod install (to install/update these libraries in pod).

You should see output similar to the following:

Updating spec repo `master’
Installing AFNetworking (3.0)…
Generating support files
After successful downloading/installation of any single library, It will generate ProjectName.xcworkspace in your project root directory. From now use this workspace to open your project. When you open your project work space you will see Pod is also added as another Xcode project with your Xcode project. If you open Pod it will show all libraries.

For your next project your don’t need to install the cocoa pod again in your mac machine just open the terminal and setup the Pod in root directory of your Xcode project and always remember these 3 commands :

  • 1. $ touch podfile
  • 2. $ open -e podfile
  • 3. $ pod install
To update Pod libraries : $ pod update
To check POD version : $ pod --version
To update CocoaPods : $ gem install cocoapods 

or use sudo at start if getting error "You don't have write permissions for the /Library/Ruby/Gems/2.0.0 directory."

How to use Pod with Swift? Follow This.

Still facing any issue with Pod? Or want to be in touch with us? Contact us:

Email:  muzammil@triffort.com Skype: muz.iphonedev

Triffort_logo

Triffort Technologies Pvt Ltd
www.triffort.com

 

 

How to hire a great iPhone Developer ?

As the mobile market is overtaking the desktop market, the demand of highly experienced iPhone developers are increasing every day for iPhone app development and iOS programming. Every client want to hire a great iPhone developer for his job but don’t know who is most suitable candidate.

How To Start ?

When you’ve finally figured out what kind of app you’re building, you can start crafting the job requirements to begin your hunt. Write a detail document of your requirement. It would be better to add few screen shot or sketch drawings so developer can easily understand what exactly you needed. Better to have a designer with you or hire any designer also if you want to build something awesome. A developer can’t do all graphics work with excellence.

Developer must have idea about Photoshop and similar image editing software. So he can extract designer’s PSD files or create images from your design. This is not compulsory but better to have. It’s also important to note that not all apps are created equally either, even when you’re hiring someone with specific experience in iPhone app development. It all boils down to the type of app you want to produce.

Who is suitable for you ?

If you’re looking for someone who’s got more than a few apps under his or her belt, make sure Objective C is on the list and that he can do object-oriented programming. That basically means, He organized his code in a way that makes it easier for subsequent developers to pick it up and figure out what’s going on. Passion on the development team will make project managing your iPhone app all that much easier.

If your application is a game, you may not need a developer who works on apps exclusively. You can find a more game-focused developer who can code a game application in a frameworks like Cocos-2d, Unity 3D and OpenGL etc. Usability for games is unique and someone without that gaming background may not have as much to offer in this case. Games are also coded in Objective C, but you’ll have more of a pool of developers to pick from if you look beyond those who’ve just created mobile applications.

If you’re making a native app (an app built with Objective C), you’ll benefit from someone who’s been through the process a few times. A developer with some familiarity coding for an iPhone will have experience working around usability issues and have insights on what can arise when going through the approval process with Apple’s iPhone App store.

 

 

 

 

 

 

A good iPhone developer have a number of tips and tricks regarding submissions to the App Store, and this will save you time in the end. Every time a submission is rejected by Apple, you will have to go through the entire waiting process again. Each time that can be as much as 7-10 business days or more. So, developer should have experience in app submission also. This way, at least he knows what is going on on App Store.

 

 

 

 

What type of experience have you had hiring an iPhone app developer? Please share your stories below.

Author’s name : Muzammil Mohammad

Email : muzammil@triffort.com

Skype : muz.iphonedev

 

Our new app : Classic Board Pro

!! Official Pro release of Classic Board app !!

Classic Board is one the most simplest board app on App Store. It provides you a real time touch experience with Chalk and Duster.

Use stylus pen for best experience. You can also transform your iPhone/iPad screen into a presentation screen.
# Supporting New iPad (Retina) display.
# Supporting iPhone5.
# Option to change chalk color.
# Option to change chalk/duster width.
# 8 beautiful backgrounds that gives a different and classic look to your board.
# 3 nice border styles.
# Share your board via Facebook, Twitter and Email.

Download this pro version and go back in your childhood classroom.

!! Have fun !!

Classic Board

 

Download Classic Board Pro from App Store : https://itunes.apple.com/us/app/classic-board-pro/id568702868?ls=1&mt=8

Error 403 while getFollowers : Twitter iPhone MGTwitterEngine

I was trying to access the followers list from my twitter account by using MGTwitterEngine. But it is giving error. Here is all step what i have done to fixed it.

1. In MGTwitterEngine.m change #define TWITTER_DOMAIN @”twitter.com” To #define TWITTER_DOMAIN @”api.twitter.com/1″

and  #define USE_LIBXML 0 to #define USE_LIBXML 1 (Most of the people are not doing this and getting no response)

2. In your working class.h add #import “MGTwitterEngine.h” and add its delegate <MGTwitterEngineDelegate>

3. In your working class.m add these methods:

#pragma mark TwitterEngineDelegate
– (void) requestSucceeded: (NSString *) requestIdentifier {
NSLog(@”Request %@ succeeded”, requestIdentifier);
}
– (void) requestFailed: (NSString *) requestIdentifier withError: (NSError *) error {
NSLog(@”Request %@ failed with error: %@”, requestIdentifier, error);
}
– (void)statusesReceived:(NSArray *)statuses forRequest:(NSString *)connectionIdentifier {

}
– (void)receivedObject:(NSDictionary *)dictionary forRequest:(NSString *)connectionIdentifier {

NSLog(@”Recieved Object: %@”, dictionary);
}
– (void)directMessagesReceived:(NSArray *)messages forRequest:(NSString *)connectionIdentifier {

NSLog(@”Direct Messages Received: %@”, messages);
}
// This method will call when you received all your followers. I have used one NSMutableArray “friendsList” to store all followers information. You can modify this according to your need.
– (void)userInfoReceived:(NSArray *)userInfo forRequest:(NSString *)connectionIdentifier {

NSLog(@”User Info Received: %@”, userInfo);

friendsList = [[NSMutableArray alloc]init];

for (NSDictionary *u in userInfo ) {

NSDictionary *followersDic = [[NSDictionary alloc]initWithDictionary:u];
[friendsList addObject:followersDic];
[followersDic release];
}
[self.tableView reloadData];
}

This is all what i have added in my class and then calling this method: [[GetAppDelegate() facebook] requestWithGraphPath:@”me/friends” andDelegate:self]; And it return all my followers list.

I hope this code will help to those who have scratching his head from some couple of hours 😉

!! Enjoy !!