10 Best Design Principles of iOS app development?

In the ever-evolving world of mobile app development, creating an iOS app that not only functions flawlessly but must also provide an exceptional user experience.

Users have come to expect intuitive and aesthetically pleasing interfaces, making design principles a fundamental aspect of iOS app development.

In this blog post, we will explore the key design principles that can help developers create user-friendly iOS apps that users love to interact with.

  1. Simplicity is Key

“Simplicity is the ultimate sophistication.” – Leonardo da Vinci

When it comes to app design, simplicity reigns supreme. Users should be able to navigate your app with ease, and clutter-free interfaces are more inviting.

Avoid overwhelming users with excessive features and elements. Keep the user interface clean, uncluttered, and intuitive.

Every screen should have a clear purpose, and the app’s functionality should be readily apparent.

  1. Consistency for a Familiar Experience

Consistency is the backbone of good design. Users should feel at home when using your app. Maintain a consistent design language throughout the app, including color schemes, typography, and layout.

Use standard navigation patterns like tab bars, navigation bars, and modal views to provide a familiar and intuitive user experience.

  1. Intuitive Navigation

Navigation is a critical aspect of an app’s design. Users should never feel lost or confused when moving through your app.

Implement clear and logical navigation paths, and ensure that users can easily return to previous screens.

iOS provides well-established navigation components, so make sure to use them effectively.

  1. Feedback and Responsiveness

Users need feedback to understand their actions’ outcomes. Implement immediate and meaningful feedback mechanisms, such as animations, tooltips, or progress indicators.

This helps users understand the system’s response to their interactions and reduces uncertainty.

  1. Accessibility for All

Accessibility is not just a design principle; it’s a legal requirement and a moral obligation. Make your app accessible to everyone, including users with disabilities.

Use accessible design elements, provide alternative text for images, and support VoiceOver for visually impaired users.

  1. Touch Targets and Usability

Design touch targets (buttons, links, etc.) with an appropriate size to accommodate different screen sizes and finger sizes.

A minimum tap target size of 44 x 44 points is recommended.

Ensure that the app’s elements are spaced adequately to prevent accidental taps and enhance usability.

  1. Loading and Performance Optimization

Users expect apps to be responsive and fast. Optimize loading times and overall iOS app performance.

Minimize unnecessary animations and use lazy loading for content. A snappy and efficient app is more likely to retain users.

  1. Error Handling and Clarity

Errors are bound to happen. When they do, your app’s error messages should be clear and helpful.

Guide users on how to resolve issues and avoid using technical jargon in error messages. Keep user frustration to a minimum.

  1. Orientation and Layout

Ensure that your app works seamlessly in both portrait and landscape orientations.

Design responsive layouts that adapt to different screen sizes and orientations, providing a consistent experience in all situations.

  1. User Testing and Iteration

Finally, no design is perfect from the get-go. Conduct user testing and gather feedback to identify pain points and areas for improvement.

Regularly iterate on your app’s design based on user feedback, evolving it to meet changing user expectations.

Top Technologies Used to Develop iOS Apps

Developing apps requires a specific set of technologies and tools to ensure compatibility with Apple’s ecosystem.

Here are some of the top technologies and tools commonly used in app development:

  1. Swift:
    Swift programming is the preferred language for iOS app development. It’s known for its speed, safety, and readability, making it an excellent choice for building apps.
  2. Objective-C:
    While Swift is the modern choice, Objective-C is still used for maintaining and updating legacy apps. It’s also helpful for integrating older codebases with new Swift projects.
  3. Xcode:
    Xcode is Apple’s integrated development environment (IDE) for iOS app development. It provides tools for coding, debugging, testing, and deploying apps. It’s essential for any iOS developer.
  4. UIKit:
    UIKit framework provides the building blocks for creating user interfaces in apps. It includes components like buttons, labels, views, and controllers.
  5. SwiftUI:
    SwiftUI framework simplifies the process of creating user interfaces in Swift. It offers a more declarative and interactive approach to UI design.
  6. Cocoa Touch:
    Cocoa Touch framework extends the Cocoa framework for macOS to iOS. It provides libraries for developing iOS-specific features like multi-touch gestures and UI elements.
  7. Core Data:
    Core Data is a framework for managing the model layer of an app. It’s used for data storage, retrieval, and management, making it crucial for database-driven apps.
  8. Core Animation:
    Core Animation allows developers to create smooth animations and transitions in apps. It’s essential for creating visually appealing user interfaces.
  9. ARKit:
    Apple’s augmented reality ARKit framework, which enables developers to create immersive AR experiences within iOS apps.
  10. Core Location:
    Core Location is used for integrating location-based services, such as GPS, into apps. It’s essential for apps that rely on location data.
  11. Firebase:
    Firebase is a mobile and web application development platform provided by Google. It offers a range of services, including real-time database, authentication, cloud storage, and analytics, which can be integrated into iOS apps.
  12. CocoaPods and Carthage:
    These are dependency managers for iOS development. They allow developers to easily add third-party libraries and frameworks to their projects.
  13. TestFlight:
    TestFlight is Apple’s beta testing platform that allows developers to distribute pre-release versions of their apps to testers for feedback and testing.
  14. GitHub:
    While not exclusive to iOS development, GitHub is a popular version control platform where developers can collaborate, manage code repositories, and track changes in their projects.
  15. Swift Package Manager:
    Swift Package Manager is a dependency management tool integrated into Swift that allows developers to easily add and manage dependencies within their projects.
  16. In-App Purchase and StoreKit:
    For monetization, iOS developers often use In-App Purchase and StoreKit to enable users to buy digital products, subscriptions, or services within their apps.

These technologies and tools form the foundation for iOS app development. The choice of which to use depends on project requirements, the specific features you want to implement, and your personal preferences as a developer.

Now, let’s explore the top things to consider when choosing an iPhone app development company.

Top Things to Consider When Choosing a iOS App Development Company

Best Design Principles of iOS app development

Choosing the right development company is a critical decision for your project’s success. Here are the top things to consider when selecting an iOS app development company:

  1. Experience and Expertise:

Look for a company with a proven track record in iOS app development. Check their portfolio and client testimonials to gauge their experience.

  1. Technical Proficiency:

Ensure the company’s developers are proficient in Swift and Objective-C, the primary programming languages for app development.

Verify their knowledge of frameworks and tools, including Xcode, UIKit, and Core Data.

  1. Portfolio and References:

Review their portfolio to assess the quality and diversity of their previous iOS apps. Contact their past clients for references and feedback on their work.

  1. Design Capabilities:

Good design is crucial for apps. Assess their design skills, including user interface (UI) and user experience (UX) design capabilities.

  1. Development Process:

Inquire about their development process. A well-defined and transparent process ensures better project management and on-time delivery.

  1. Project Management:

Understand how they manage projects. Effective communication and project management tools are essential for keeping you updated on progress.

  1. Team Composition:

Learn about the team working on your project, including the roles of developers, designers, QA testers, and project managers. Ensure they have a well-rounded team.

  1. Communication:

Effective communication is vital for a successful partnership. Ensure they are responsive and can communicate in your preferred language and time zone.

  1. Client Reviews and Testimonials:

Read client reviews and testimonials to get insights into their clients’ experiences and satisfaction with their services.

  1. Transparency and Pricing:

Understand their pricing structure and payment terms. A transparent pricing model is essential to avoid unexpected costs.

  1. Maintenance and Support:

Inquire about their post-launch support and maintenance services. A good company should provide ongoing support and updates.

  1. Security and Data Privacy:

Ensure that the company follows best practices for app security and data privacy, especially if your app deals with sensitive user data.

  1. App Store Submission Experience:

Ask about their experience with submitting apps to the Apple App Store. Familiarity with the submission process can prevent delays and rejections.

  1. NDA and Intellectual Property:

Discuss non-disclosure agreements (NDAs) and intellectual property rights to protect your app idea and its assets.

  1. Scalability:

Consider the company’s ability to scale with your project if it grows. Ensure they have the resources and flexibility to accommodate your needs.

  1. Location:

Decide whether you prefer a local, offshore, or remote development team based on your project’s requirements and your comfort level with remote collaboration.

  1. Compliance and Regulations:

If your app involves specific industries or regulations (e.g., healthcare, finance), check if the company has experience complying with relevant standards and regulations.

  1. Post-Launch Services:

Beyond development, evaluate their ability to help you market and maintain the app post-launch, including user acquisition and updates.

By carefully considering these factors, you can choose an iOS app development company that aligns with your project’s goals and ensures a successful partnership.

What are the Top Strategies to Monetize iOS Apps

Monetizing iOS apps can be achieved through various strategies, depending on your app’s nature and target audience. Here are some top strategies to consider when monetizing iOS apps:

  1. Paid Apps:
    Users purchase your app from the App Store for a one-time fee. This model is straightforward but requires a compelling value proposition to justify the cost.
  2. In-App Purchases (IAPs):
    Offer additional content, features, or virtual goods within your app that users can buy. This model works well for freemium apps where the initial download is free.
  3. Subscriptions:
    Provide access to premium content, services, or features on a recurring basis. Subscriptions can be monthly, yearly, or at other intervals. This model can create a steady revenue stream.
  4. Freemium Model:
    Offer a basic version of your app for free and upsell premium features or content. This model encourages users to try the app before committing to a purchase.
  5. Ads:
    Implement advertisements within your app, such as banner ads, interstitials, or rewarded video ads. You can earn revenue based on ad impressions, clicks, or user interactions.
  6. Affiliate Marketing:
    Promote affiliate products or services within your app and earn a commission for each sale or action generated through your app’s referrals.
  7. Sponsorships and Partnerships:
    Partner with other companies or brands to promote their products or services within your app in exchange for sponsorship or affiliate fees.
  8. Sell Data or Insights:
    If your app collects valuable user data (while complying with privacy regulations), consider selling aggregated and anonymized data or insights to interested parties, such as marketers or researchers.
  9. Crowdfunding:
    Use platforms like Patreon or Kickstarter to secure financial support from your app’s most dedicated users. In return, offer exclusive content or benefits.
  10. E-commerce Integration:
    If your app has a shopping or marketplace component, earn a commission on sales made through your platform.
  11. Merchandise and Physical Goods:
    Sell branded merchandise, physical products, or services related to your app’s content or theme.
  12. Cross-Promotion:
    Promote your other apps or products within your existing apps to increase visibility and user engagement across your portfolio.
  13. Event Ticketing:
    If your app is related to events or entertainment, you can sell event tickets or access through your platform and earn a commission on sales.
  14. Donations:
    Allow users to make voluntary donations to support your app. Some users may appreciate the opportunity to contribute to a free or ad-free experience.
  15. Licensing Content:
    If you produce valuable content (e.g., images, music, videos), licence it to other apps or platforms for a fee.
  16. Pay-Per-Use:
    Charge users for specific actions or transactions within the app, such as advanced analytics, document conversions, or premium support.
  17. White-Labelling:
    Offer a white-label version of your app to other businesses or organizations, allowing them to customize and use it for their purposes.
  18. Limited-Time Sales and Discounts:
    Occasionally offer discounts or sales on in-app purchases or subscriptions to encourage more purchases during specific periods.
  19. Referral Programs:
    Reward users for referring friends or other users to download and use your app.
  20. Educational Content:
    If your app offers educational or training content, create premium courses or materials for which users can pay.

Successful monetization often involves a combination of these strategies. Consider your app’s target audience, niche, and unique features when deciding which monetization methods are most suitable.

Additionally, continuously analyze user feedback and adapt your monetization strategy to meet changing market trends and user preferences.

FAQs

  1. What is the typical iOS app development process?

The iOS app development process involves concept and planning, design, development, testing, deployment, and ongoing maintenance and updates.

  1. How long does it take to develop an iOS app?

The development timeline varies depending on the complexity of the app and the team’s experience. Simple apps may take a few months, while more complex projects can take a year or more.

  1. How can I publish my iOS app on the Apple App Store?

To publish your iOS app on the App Store, you’ll need to create an Apple Developer account, adhere to Apple’s guidelines, and submit your app for review.

Conclusion

Mastering these design principles in iOS app development is essential for creating user-friendly experiences that stand out in the crowded app market.

By prioritizing simplicity, consistency, and usability while keeping accessibility and performance in mind, you can build iOS apps that users will enjoy and recommend to others.

Remember, good design is an ongoing process, so stay committed to refining your app’s design to meet evolving user needs and expectations.

Top iOS App Development Trends to Look For in 2023

iOS app development is the most rapidly evolving technology with new trends popping up every year. More and more companies are developing new and disruptive apps that are taking the market by storm.

The impact of artificial intelligence and machine learning has paved a new direction for iOS app development, the iOS app development has moved into a new renaissance.

According to recent statistics published by grandviewresearch the global mobile app development market has reached nearly $240 billion in 2023 which is growing at the rate of 13%.

iOS developers need to keep themselves updated with the latest development trends to deliver modern apps to their customers. Business owners should also be aware of the latest development trends so that they can ideate the right app for their business.

Top 8 iOS App Development Statistics and Trends

  • Number of iOS App Store Apps:
    As of September 2023, the Apple App Store hosted over 2.24 million apps.
  • iOS App Revenue:
    In 2023, iOS app revenue reached approximately $86 billion, and it is projected to grow in the coming years. 
  • iOS App Downloads:
    In 2023, the total number of iOS app downloads surpassed $142 billion.
  • Swift Programming Language Adoption:
    Swift, Apple’s programming language for iOS app development, has gained significant popularity since its introduction in 2014. As of September 2022, it was the 10th most popular programming language globally. 
  • ARKit Adoption:
    ARKit, Apple’s augmented reality framework, has been embraced by developers to create AR experiences. By 2023, more than 5,000 apps on the App Store were using ARKit.
  • iOS App Update Frequency:
    On average, iOS apps are updated every 30 to 45 days to improve performance, fix bugs, and introduce new features. 
  • User Retention Rate:
    The average mobile app retention rate for iOS apps after 90 days is approximately 21%, indicating the challenges in retaining users over time. 
  • In-App Purchases:
    As of 2022, in-app purchases accounted for over 50% of all mobile app revenue, indicating the importance of monetization strategies within iOS apps.

We have researched the top iOS development trends and have prepared this list. Read on to learn the new technology trend in iOS development that you can implement in 2023.

Augmented Reality (AR) and Mixed Reality (MR)

AR and MR technologies will continue to redefine user experiences in 2023. These technologies blend digital elements with the physical environment, enhancing interactions and engagement. 

From AR-based gaming experiences to AR-powered shopping and navigation apps, the possibilities are limitless. 

iOS app developers will leverage ARKit and other frameworks to create captivating and interactive apps that bridge the gap between the real and virtual realms.

AI and Machine Learning

AI and ML are two rapidly developing technologies that are transforming the way humans interact with technology.

Because AI and ML are more accessible and affordable for developers, it makes it easier for them to include advanced AI driven features such as personal assistants, chat bots, image recognition, etc into iOS apps.

2023 is the year of AI-based programs. We can expect to see more AI-based apps being developed for enterprises. Apple has a Core ML framework that enables developers to integrate machine learning models into iOS apps.

Never miss an update from us. Join 10,000+ marketers and leaders.

This framework enables developers to add AI-driven features such as image recognition and natural language processing. These features can also help improve the user experience and user engagement.

Privacy and User Consent Features

In response to Apple’s push for user privacy, iOS app developers will implement features like App Tracking Transparency (ATT) to seek user consent before collecting and using personal data. 

This trend will reinforce user trust and encourage developers to adopt more transparent data practices. Apps that prioritize user privacy will likely enjoy increased user loyalty and retention.

IoT (Internet of Things)

IoT or Internet of Things is all about connecting physical objects such as home appliances, automobiles, and other electronic devices to a central computer system for intra-communication. It creates a more wholesome connected space enabling them to communicate with each other as well as transfer data.

IoT provides consumers the ability to remotely control their smart home devices though iPhones. Consumers can remotely operate devices such as lights, security systems, thermostats, vehicles, etc.

In 2022 usage of IoT devices increased by 18% which amounts to a total of approximately 14 billion.

Apps For Wearables

The popularity of smartwatches, fitness trackers and other wearable devices is rapidly growing. It is estimated that between 2023 to 2030 wearable technology will grow by 14%.

Wearable devices such as fitness trackers and smartwatches let users track their heart rate, get weather notification, view and send messages, play music and much more. These apps can enable users to get fast access to important information and functions.

Mobile Wallets

Mobile wallet is the one of the newest types of apps for iOS app development. It is quickly becoming popular for their ease of use and rewards such as loyalty points, wallet coins, with credit and debit functions.

Mobile-first countries such as India and China are fueling the growth of mobile wallets. These countries have truly revolutionised the way customers use mobile wallets because of their high smartphone penetration rate.

Mobile wallets also enable banks to reach a wider customer base. It is forecasted that by 2026 the number of mobile wallet users will exceed over 5 billion global users. Some of the most popular mobile wallets services are PayPal, ApplePay, GooglePay and AmazonPay who are taking the market by storm.

Chatbots

Chatbots have been in the trend for a while. Many businesses, especially customer support teams already employ chatbots to increase customer satisfaction and retention.

Online businesses use chatbots as virtual assistants who provide helpful information to customer queries. Moreover, chatbots can provide curated information on common queries.

A recent article on AI found that nearly 40% of consumers prefer to interact with businesses through chatbots and customer support if it can address their queries promptly and accurately.

Are you looking for a iOS developer

Contact Us

Businesses have also invested heavily on chatbots as an alternative way to interact with customers which not only saves them time and money but also reduces human errors and resource utilisation.

Today, chatbots have become highly effective and are able to provide information in a more human way.

Cloud Integration

Both developers and end-users are increasingly using cloud platforms to develop apps and services. Cloud services are quickly becoming the norm for storing files and documents. The trend will only continue to increase in 2023 and 2024.

Some commonly used cloud-apps available today are GoogleDrive, DropBox and Microsoft Office 365.

Cloud integration brings with it several other benefits such as file sharing, file security, flexibility, disaster recovery etc. which can be easily implemented and integrated while developing cloud-based apps.

Cloud integration is an essential part of any iphone application. It can solve different problems, such as:

Swift UI

SwiftUI is a modern and declarative framework for building user interfaces for various Apple platforms. It was introduced in 2019 and since then SwiftUI has only grown in popularity in developing intuitive and use-engaging interfaces for iphone devices.

The SwiftUI framework provides simple syntax for building user interfaces which makes it easier for developers to understand and use.

SwiftUI’s straightforward approach makes it easier to predict and debug the layout of the user interface which also makes it a great development technology for building both complex and dynamic user interfaces. Developers can take advantage of the SwiftUI to create truly native apps for Apple’s devices.

Camera-Focused Apps

The demand for camera-focused apps have skyrocketed in recent years. Mobile phone cameras are getting more and more powerful with each iteration.

2023 has witnessed an increase in usage of AI-driven camera apps for photography, video conferencing, remote communication and collaboration. It is also an important factor in encouraging more social media shares.

Apps like Instagram, Facebook, video reels leverage the camera to enable users to create stunning images and videos to be shared with their users thereby reaching a wider customer base.

5G Integration

The widespread adoption of 5G networks will transform the iOS app development landscape in 2023. With lightning-fast speeds and minimal latency, 5G integration will unlock new possibilities for app developers. 

Expect apps to load faster, deliver smoother streaming experiences, and facilitate real-time data processing. This technology will be particularly beneficial for apps that rely on augmented reality (AR), virtual reality (VR), and immersive gaming experiences.

Conclusion

The iphone development trends keep evolving in the market, today’s developers are quickly adopting these latest trends to develop more and more engaging apps for the users.

Moreover with the increasing awareness of these trends among customers, the demand for modern apps is getting higher making it paramount for iOS developers to keep up with the latest development trends.

 

Frequently Asked Question

  • What are the potential impacts of Apple’s new hardware and software updates on iOS app development in 2023?

Potential impact of Apple’s new hardware and software updates on iOS app development in 2023 includes improved performance and capabilities. This will require developers to optimize apps for new devices and software features. It may also introduce new opportunities for AR/VR integration and machine learning applications, shaping future app development trends.

  • What are the key factors to consider for iOS app developers targeting Gen Z and younger demographics in 2023?

Key factors for iOS app developers targeting Gen Z and younger demographics in 2023 would involve creating personalized and interactive experiences. Developers will leverage social media integration, prioritize short-form content, and address privacy concerns. Inclusive design and sustainability values will also resonate with this tech-savvy generation.

  • What are the top user experience (UX) trends to consider in iOS app development for 2023?

Top user experience (UX) trends for iOS app development in 2023 will revolve around voice-based interfaces, multi-device experiences, gesture-based interactions, dark mode support, and AI-driven personalized content. Developers must prioritize intuitive navigation and optimize app performance to enhance overall user satisfaction.

  • How will app monetization strategies evolve for iOS developers in 2023?

App monetization strategies for iOS developers in 2023 may shift towards subscription-based models, in-app purchases, and ad-supported free apps. Developers may also explore NFTs and tokenization for unique app features or digital goods, as well as user data privacy as a premium offering.

  • Will blockchain technology find applications in iOS app development trends in 2023?

While blockchain technology shows potential in enhancing security and decentralization, its direct application in iOS app development trends in 2023 remains uncertain. However, it could influence secure payment systems, digital identity verification, and token-based loyalty programs, depending on regulatory and adoption factors.

Guide To Display Images In Grid View On IPhone

In some iOS apps, displaying images in a single view would make the UI lose its uniformity. It would be difficult to manage images of different resolution and impossible to keep track of thousand of images without using Grid View in iPhone.

This is just like a “Grid View” application. Here we will explore how to display images, programmatically in “Grid view” on an iPhone.

Here We Go…

Step 1:

  • Open Xcode
  • Create a View base applicationGridview-123
  • Give the application name “ImageGrid”.

Step 2:

The directory structure is automatically created by the Xcode which also adds up essential frameworks to it. Now, explore the directory structure to check out the contents of the directory.

Step 3:

Here you need to add one ‘NSObject’ class to the project.

  • Select  project -> New File -> Cocoa Touch -> Objective-C class
  • Give the class name “Images”.

Step 4:

Then add an image to the project and give the image name “icon.png”.

Step 5:

  • Open “ImageGridViewController” file and add ‘UITableViewDelegate’ and ‘UITableViewDataSource’
  • Define ‘UITableView’ and ‘NSMutableArray’ classes as well as the buttonPressed: method
  • Import the ‘Image.h’ class and make the following changes.

[sourcecode]#import <UIKit/UIKit.h>
#import "Image.h"
@interface ImageGridViewController:UIViewController <UITableViewDelegate, UITableViewDataSource> {
IBOutlet UITableView *tableView;
NSMutableArray  *sections;
}
@property (nonatomic, retain) UITableView *tableView;
@property (nonatomic, retain) NSMutableArray *sections;
-(IBAction)buttonPressed:(id)sender;
@end[/sourcecode]

Step 6:

  • Double click the ‘ImageGridViewController.xib’ file and open it in the Interface Builder.
  • First drag the ‘TableView’ from the library and place it in the view window.
  • Select ‘tableview’ from the view window and bring up connection inspector and connect ‘dataSource’ to the ‘File’s Owner’ and delegate to the ‘File’s Owner’ icon.
  • Now save the .xib file and go back to Xcode.

Step 7:

In the ‘ImageGridViewController.m’ file, make the following changes:

[sourcecode]#import "ImageGridViewController.h"
#import "Item.h" @implementation ImageGridViewController
@synthesize tableView,sections;

-(void)loadView{

[super loadView];
sections = [[NSMutableArray alloc] init];

for(int s=0;s<1;s++) { // 4 sections
NSMutableArray *section = [[NSMutableArray alloc] init];

for(int i=0;i<12;i++) {// 12 items in each section
Image *item = [[ Image alloc] init];
item.link=@"New Screen";
item.title=[NSString stringWithFormat:@"Item %d", i];
item.image=@"icon2.png";

[section addObject:item];
}
[sections addObject:section];
}
}

– (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return [sections count];
}

– (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return 1;
}

– (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath*)indexPath {
NSMutableArray *sectionItems = [sections objectAtIndex:indexPath.section];
int numRows = [sectionItems count]/4;
return numRows * 80.0;
}

-(NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section {

NSString *sectionTitle = [NSString stringWithFormat:@"Section  %d", section];
return sectionTitle;
}

– (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

static    NSString *hlCellID = @"hlCellID";

UITableViewCell *hlcell = [tableView dequeueReusableCellWithIdentifier:hlCellID];
if(hlcell == nil) {
hlcell = [[[UITableViewCell alloc]
initWithStyle:UITableViewCellStyleDefault reuseIdentifier:hlCellID] autorelease];
hlcell.accessoryType = UITableViewCellAccessoryNone;
hlcell.selectionStyle = UITableViewCellSelectionStyleNone;
}

int section = indexPath.section;
NSMutableArray *sectionItems = [sections objectAtIndex:section];

int n = [sectionItems count];
int i=0,i1=0;

while(i<n){
int yy = 4 +i1*74;
int j=0;
for(j=0; j<4;j++){

if (i>=n) break;
Image *item = [sectionItems objectAtIndex:i];
CGRect rect  = CGRectMake(18+80*j, yy, 40, 40);
UIButton *buttonImage=[[UIButton alloc] initWithFrame:rect];
[buttonImage setFrame:rect];
UIImage *buttonImageNormal=[UIImage imageNamed:item.image];
[buttonImage setBackgroundImage:buttonImageNormal forState:UIControlStateNormal];
[buttonImage setContentMode:UIViewContentModeCenter];
NSString *tagValue = [NSString stringWithFormat:@"%d%d", indexPath.section+1, i];
buttonImage.tag = [tagValue intValue];
//NSLog(@tag….%d", button.tag);
[buttonImage addTarget:self
action:@selector(buttonPressed:)forControlEvents:UIControlEventTouchUpInside];
hlcell.contentView addSubview:buttonImage];
[buttonImage release];

UILabel *label = [[[UILabel alloc]initWithFrame:CGRectMake((80*j)-4,                 yy+44, 80, 12)] autorelease];
label.text = item.title;
label.textColor = [UIColor blackColor];
label.backgroundColor = [UIColor clearColor];
label.textAlignment = UITextAlignmentCenter;
label.font = [UIFont fontWithName:@"ArialMT" size:12];
[hlcell.contentView addSubview:label];
i++;
}
i1 = i1+1;
}
return hlcell;
}
-(IBAction)buttonPressed:(id)sender {
int tagId = [sender tag];
int divNum = 0;
if(tagId<100)
divNum=10;
else
divNum=100;
int section = [sender tag]/divNum;
section -=1;// we had incremented at tag assigning time
int itemId = [sender tag]%divNum;
NSLog(@"…section = %d, item = %d", section, itemId);
NSMutableArray*sectionItems = [sections objectAtIndex:section];
Image    *item    =    [sectionItems objectAtIndex:itemId];
NSLog(@"Image selected…..%@, %@", item.title, item.link);

}

-(void)viewDidLoad{
[super viewDidLoad];
}

-(void)didReceiveMemoryWarning{
[super didReceiveMemoryWarning];
}

-(void)viewDidUnload{
// Release any retained subviews of the main view.
// e.g. self.myOutlet = nil;
}

-(void)dealloc{
[super dealloc];
}
@end[/sourcecode]

Step 8:

Open the ‘Image.h’ file and make the following changes:

[sourcecode]#import <Foundation/Foundation.h>
@interface Image:NSObject{
NSString*title;
NSString*link;
NSString*image;
}
@property(nonatomic, copy)NSString*title;
@property(nonatomic, copy)NSString*link;
@property(nonatomic, copy)NSString*image;
@end[/sourcecode]

Step 9:

Make the changes in the ‘Item.m’ file:

[sourcecode]#import "Image.h"
@implementation Item
@synthesize title, link, image;
@end[/sourcecode]

Step 10:

Now save it and compile it in the Simulator.

It would be smart to use Grid View to display a number of images in a single view because it enables to manage multiple images efficiently. Users are also facilitated to keep track of their images. It becomes eye soothing and looks great on the iPhone mobile devices.

Keep visiting regularly to Andolasoft blog to know our upcoming article about the process to show your android Smartphone captured images dynamically in “Grid View” Layout.

How Do I Implement Localization In IOS Apps?

We know that, all the apps in the Apple App Store are English-speaking, i.e. the menu, information, settings and everything else is in English. However, the apps become almost useless for the consumers from non native English speaking countries. Hence, it becomes essential for the developers to release apps with multiple language support. This is where internationalization and localization comes in handy which facilitates the iOS application developers to support numerous native languages that greatly increase the global user experience.

What Exactly Is Internationalization And Localization?

  • Internationalization and localization means adapting the software product to different languages, regional differences and technical requirements of a targeted market.
  • Internationalization is the process of designing a software application, so that it can be adapted to various languages and regions without engineering changes.
  • Localization is the process of accommodating internationalized software product for a specific region or language by adding locale-specific components and translating text.

Here Is An Example To Help You Grasp The Concept:

Let’s say there is an iPhone/iPad application made for Brazilian client and he needs to localize that product to Portuguese language so that every users of Brazil can use it.

Each and every application must contain some hardcoded strings. We need to pull all of these hardcoded strings into a separate file so that we can localize them.

To do this, create a “.strings” file in the Xcode to contain all of the strings that your project needs. Then the hardcoded strings should be replaced with a function call to look up the appropriate string from the “.strings” file based on the current language.

For example:

To create a “.string” file, follow below mentioned steps

  • Select the Project group in Xcode, and navigate to File >>New >>New File.
  • Choose iOS >>Resource >>Strings File, and click Next, as shown in the below snapshot.
  • Name the new file Localizable.strings, and then click Save.

Note that the “Localizable.strings” is the default filename; iOS looks for when dealing with localized text. If you rename the file, you’ll need to specify the name of the .strings file every time.

The format for the strings file is:

[sourcecode]"KEY" = "CONTENT";[/sourcecode]

For our ‘Account’ text add in:

[sourcecode]"TITLE" = "Account";[/sourcecode]

Now switch to “ViewController.m”, and find the “viewDidLoad” method. Now you can set the text as below:

[sourcecode]self.titleLabel.text = @"Account";[/sourcecode]

We want it to read from our “.strings” file. For this, you need to change the current line to use a macro called “NSLocalizedString” as shown below:

[sourcecode]self.titleLabel.text = NSLocalizedString(@"TITLE", nil);[/sourcecode]

Adding A Portuguese Localization

Steps to add a Portuguese localization are as follows:

  • You need to select “Localizable.strings”, and open the Info pane.
  • You can do this by selecting the 3rd tab in the top toolbar of the View section, and selecting the 1st tab in the top section, as shown in the below screenshot.

To add support for another language execute following steps:

  • You need to simply click on the ‘+’ (Plus) in that ‘Localization’ pane on the right of the view.
  • At first it will create localization for English.
  • If the “Localizable.Strings” deselect after your click then select the “Localizable.Strings” again. After the “Localizable.Strings” selected click the ‘+’ button once again and choose ‘Portuguese(pt)’ from the dropdown.

Now, Xcode has set up some directories containing a separate version of “Localizable.strings” for each language that you selected, behind the scenes. To view this for yourself, go to your project folder in Finder and open it. There you’ll get the following:

  • ‘en.lproj’ and ‘pt.lproj’ contain language-specific versions of files.
  • ‘en’ is the localization code for English, whereas ‘pt’ is for Portuguese.

To change the text for Portuguese, select ‘Localizable.strings (Portuguese)’ and change the text as follows:

[sourcecode]"TITLE" = "Conta";
“Back” = “Voltar”;
etc.
[/sourcecode]

It’s all about how to localize a string. But you also need to localize the UI, as the text length for a button may vary in different languages.

How To Adjust UI Elements:

Let’s discuss about how to localize the button text.

  • For Portuguese let’s say the button text is ‘MODIFICAR’.
  • The problem is that you need your button border to be relatively tight around the text. This isn’t a problem for title label because there is no constraint on its width, but here you’ll need to adjust the size of the button to make it look perfect.
  • If you simply change the text in “viewDidLoad” it will look odd, as the text of that button may or may not fit into it.

So you need to add localization to your “xib” and make the button bigger in Portuguese.

  • Go to “ViewController.xib” and in the info pane on the right of the view, click the ‘+’ button to add a Localization and choose Portuguese.
  • Note you may need to scroll down in the Info pane as it has some Interface Builder content in that side.
  • Now we have copy of “ViewController.xib” in our Portuguese folder (pt.lproj).
  • Select “ViewController.xib (Portuguese)”, and edit the button text in that version to say ‘MODIFICAR’.
  • It will resize the button by default.

Once, all the set up is done perfectly, delete the application from simulator/device and select Project>>Clean to get a fresh build and install. Then build and run your app.

How To Apply Localization For Images:

If you have text in your image you need to localize it.Follow the steps mentioned below.

  • Select the .jpg file and add localization for Portuguese.
  • Check out the project folder.
  • The ‘.jpg’ image file has been added to the English folder (en.lproj) and then copied to the Portuguse folder (pt.lproj).
  • To make a different image for the Portuguese version, you need to overwrite the image in the Portuguese folder.
  • Rebuild and get the final result!

Benefits:

It is better to have localization in your iOS apps to target the global users. The app will display the contents according to the visitor’s language.

  • Same information can be shared across the world.
  • Great user experience.

How To Draw Smooth Lines In IOS Apps?

One of the most common issues in drawing apps is that the polylines appears jagged when drawn quickly. Such flaws create unfavorable impact on the application as well developers. Apps developed for IPhone, which is one of the premium devices in the world; must encompass all the development aspects, may it be a major bug as in Apple Map or as simple as jagged polylines in drawing apps.

Drawing lines are one of the most common features in iOS apps. It can be used for numerous purposes such as putting a signature in PDFs and images, drawing line graphs, preparing presentations with sketches and many more. Most of the iOS applications generate jaggy lines when drawn quickly. On the other hand, smooth lines facilitate uses with the convenience to draw quickly and without affecting the practicality of the application.

Below are the steps to follow how to draw smooth lines in iOS apps.

1. Add UIImage View

First of all we need to add UIImageView to a UIView.

[sourcecode]SmoothLineViewController.h:
@property (nonatomic, readwrite, retain) IBOutlet UIImageView *imageView;
Then we’ll @synthesize this property in SmoothLineViewController.m:
@synthesize imageView=imageView_;
[/sourcecode]

Finally, we’ll use the Interface Builder to add the UIImageView component to SmoothLineViewControllerr.xib

2. Handling Touches

Now we are ready to write code for handle touches and draw polylines. We’ll need to declare the following member variables in the header:

[sourcecode]CGPoint previousPoint;
NSMutableArray *drawnPoints;
UIImage *cleanImage;
add the method to the class:
/** This method draws a line to an image and returns the resulting image */
– (UIImage *)drawLineFromPoint:(CGPoint)from_Point toPoint:(CGPoint)to_Point image:(UIImage *)image
{
CGSize sizeOf_Screen = self.view.frame.size;
UIGraphicsBeginImageContext(sizeOf_Screen);
CGContextRef current_Context = UIGraphicsGetCurrentContext();
[image drawInRect:CGRectMake(0, 0, sizeOf_Screen.width, sizeOf_Screen.height)];

CGContextSetLineCap(current_Context, kCGLineCapRound);
CGContextSetLineWidth(current_Context, 1.0);
CGContextSetRGBStrokeColor(current_Context, 1, 0, 0, 1);
CGContextBeginPath(current_Context);
CGContextMoveToPoint(current_Context, from_Point.x, from_Point.y);
CGContextAddLineToPoint(current_Context, to_Point.x, to_Point.y);
CGContextStrokePath(current_Context);

UIImage *rect = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return rect;
}
drawLineFromPoint:to_Point:image is a simple utility method that draws a line over a UIImage and returns the resulting UIImage.
Now UIResponder‘s touch handling methods will be overridden:
– (void)touchesBegan:(NSSet *)_touches withEvent:(UIEvent *)_event
{
// retrieve the touch point
UITouch *_touch = [_touches anyObject];
CGPoint current_Point = [_touch locationInView:self.view];

// Its record the touch points to use as input to our line smoothing algorithm
drawn_Points = [[NSMutableArray arrayWithObject:[NSValue valueWithCGPoint:current_Point]] retain];

previous_Point = current_Point;

// we need to save the unmodified image to replace the jagged polylines with the smooth polylines
clean_Image = [imageView_.image retain];
}

– (void)touchesMoved:(NSSet *)_touches withEvent:(UIEvent *)_event
{

UITouch *_touch = [_touches anyObject];
CGPoint current_Point = [_touch locationInView:self.view];

[drawnPoints addObject:[NSValue valueWithCGPoint:current_Point]];

imageView_.image = [self drawLineFromPoint:previous_Point toPoint:current_Point image:imageView_.image];

previous_Point = current_Point;
}
[/sourcecode]

3. Simply Polyline

We need to find a similar polyline, but with fewer vertices. This is necessary because we cannot interpolate between vertices to generate a nice smooth polyline if they are placed too close to each other. I use the “Ramer–Douglas–Peucker” algorithm for this. Alternatively, Lang’s simplification algorithm or any other polyline simplification algorithms would work.
We’ll begin by adding the following utility method:

[sourcecode]/** Draws a path to an image and returns the resulting image */
– (UIImage *)drawPathWithPoints:(NSArray *)points image:(UIImage *)image
{
CGSize screenSize = self.view.frame.size;
UIGraphicsBeginImageContext(screenSize);
CGContextRef currentContext = UIGraphicsGetCurrentContext();
[image drawInRect:CGRectMake(0, 0, screenSize.width, screenSize.height)];

CGContextSetLineCap(currentContext, kCGLineCapRound);
CGContextSetLineWidth(currentContext, 1.0);
CGContextSetRGBStrokeColor(currentContext, 0, 0, 1, 1);
CGContextBeginPath(currentContext);

int count = [points count];
CGPoint point = [[points objectAtIndex:0] CGPointValue];
CGContextMoveToPoint(currentContext, point.x, point.y);
for(int i = 1; i < count; i++) {
point = [[points objectAtIndex:i] CGPointValue];
CGContextAddLineToPoint(currentContext, point.x, point.y);
}
CGContextStrokePath(currentContext);

UIImage *ret = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return ret;
}
[/sourcecode]

drawPathWithPoints:image is similar to our line drawing method above, except it draws a polyline, given an array of vertices.
We’ll also add an Objective-C implementation of Wikipedia’s pseudo code for the Ramer–Douglas–Peucker algorithm:

[sourcecode]- (NSArray *)douglasPeucker:(NSArray *)points epsilon:(float)epsilon
{
int count = [points count];
if(count < 3) {
return points;
}

//Find the point with the maximum distance
float dmax = 0;
int index = 0;
for(int i = 1; i < count – 1; i++) {
CGPoint point = [[points objectAtIndex:i] CGPointValue];
CGPoint lineA = [[points objectAtIndex:0] CGPointValue];
CGPoint lineB = [[points objectAtIndex:count – 1] CGPointValue];
float d = [self perpendicularDistance:point lineA:lineA lineB:lineB];
if(d > dmax) {
index = i;
dmax = d;
}
}

//If max distance is greater than epsilon, recursively simplify
NSArray *resultList;
if(dmax > epsilon) {
NSArray *recResults1 = [self douglasPeucker:[points subarrayWithRange:NSMakeRange(0, index + 1)] epsilon:epsilon];

NSArray *recResults2 = [self douglasPeucker:[points subarrayWithRange:NSMakeRange(index, count – index)] epsilon:epsilon];

NSMutableArray *tmpList = [NSMutableArray arrayWithArray:recResults1];
[tmpList removeLastObject];
[tmpList addObjectsFromArray:recResults2];
resultList = tmpList;
} else {
resultList = [NSArray arrayWithObjects:[points objectAtIndex:0],
[points objectAtIndex:count – 1],nil];
}

return resultList;
}

– (float)perpendicularDistance:(CGPoint)point lineA:(CGPoint)lineA lineB:(CGPoint)lineB
{
CGPoint v1 = CGPointMake(lineB.x – lineA.x, lineB.y – lineA.y);
CGPoint v2 = CGPointMake(point.x – lineA.x, point.y – lineA.y);
float lenV1 = sqrt(v1.x * v1.x + v1.y * v1.y);
float lenV2 = sqrt(v2.x * v2.x + v2.y * v2.y);
float angle = acos((v1.x * v2.x + v1.y * v2.y) / (lenV1 * lenV2));
return sin(angle) * lenV2;
}
[/sourcecode]

CGPoint v1 = CGPointMake(lineB.x – lineA.x, lineB.y – lineA.y);
If you have difficulty for understanding the code above, refer to Wikipedia’s explanation and pseudo code of the algorithm. Now we’ll also override UIResponder‘stouchesEnded:withEvent method to add post-processing instructions for our polyline:

[sourcecode]- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
{
NSArray *generalizedPoints = [self douglasPeucker:drawnPoints epsilon:2];
imageView_.image = [self drawPathWithPoints:generalizedPoints image:cleanImage];
[drawnPoints release];
[cleanImage release];
}
[/sourcecode]

The method computes a simplified polyline, using our recorded touch points, drawn Points, as the input to Ramer–Douglas–Peucker algorithm, and replaces the jaggy polyline with the simplified polyline.

Also Read; How To Use Service Oriented Architecture In IOS Swift

If you try running the app now, you would see your polylines being replaced by more jaggy polylines. That’s expected.

4. Smooth Polyline

Now that we have a simplified polyline, we are ready to interpolate the points between the vertices for a nice smooth curve. Add the following method to the class:

[sourcecode]- (NSArray *)catmullRomSpline:(NSArray *)points segments:(int)segments
{
int count = [points count];
if(count < 4) {
return points;
}

float b[segments][4];
{
// precompute interpolation parameters
float t = 0.0f;
float dt = 1.0f/(float)segments;
for (int i = 0; i < segments; i++, t+=dt) {
float tt = t*t;
float ttt = tt * t;
b[i][0] = 0.5f * (-ttt + 2.0f*tt – t);
b[i][1] = 0.5f * (3.0f*ttt -5.0f*tt +2.0f);
b[i][2] = 0.5f * (-3.0f*ttt + 4.0f*tt + t);
b[i][3] = 0.5f * (ttt – tt);
}
}

NSMutableArray *resultArray = [NSMutableArray array];

{
int i = 0; // first control point
[resultArray addObject:[points objectAtIndex:0]];
for (int j = 1; j < segments; j++) {
CGPoint pointI = [[points objectAtIndex:i] CGPointValue];
CGPoint pointIp1 = [[points objectAtIndex:(i + 1)] CGPointValue];
CGPoint pointIp2 = [[points objectAtIndex:(i + 2)] CGPointValue];
float px = (b[j][0]+b[j][1])*pointI.x + b[j][2]*pointIp1.x + b[j][3]*pointIp2.x;
float py = (b[j][0]+b[j][1])*pointI.y + b[j][2]*pointIp1.y + b[j][3]*pointIp2.y;
[resultArray addObject:[NSValue valueWithCGPoint:CGPointMake(px, py)]];
}
}

for (int i = 1; i < count-2; i++) {
// the first interpolated point is always the original control point
[resultArray addObject:[points objectAtIndex:i]];
for (int j = 1; j < segments; j++) {
CGPoint pointIm1 = [[points objectAtIndex:(i – 1)] CGPointValue];
CGPoint pointI = [[points objectAtIndex:i] CGPointValue];
CGPoint pointIp1 = [[points objectAtIndex:(i + 1)] CGPointValue];
CGPoint pointIp2 = [[points objectAtIndex:(i + 2)] CGPointValue];
float px = b[j][0]*pointIm1.x + b[j][1]*pointI.x + b[j][2]*pointIp1.x + b[j][3]*pointIp2.x;
float py = b[j][0]*pointIm1.y + b[j][1]*pointI.y + b[j][2]*pointIp1.y + b[j][3]*pointIp2.y;
[resultArray addObject:[NSValue valueWithCGPoint:CGPointMake(px, py)]];
}
}

{
int i = count-2; // second to last control point
[resultArray addObject:[points objectAtIndex:i]];
for (int j = 1; j < segments; j++) {
CGPoint pointIm1 = [[points objectAtIndex:(i – 1)] CGPointValue];
CGPoint pointI = [[points objectAtIndex:i] CGPointValue];
CGPoint pointIp1 = [[points objectAtIndex:(i + 1)] CGPointValue];
float px = b[j][0]*pointIm1.x + b[j][1]*pointI.x + (b[j][2]+b[j][3])*pointIp1.x;
float py = b[j][0]*pointIm1.y + b[j][1]*pointI.y + (b[j][2]+b[j][3])*pointIp1.y;
[resultArray addObject:[NSValue valueWithCGPoint:CGPointMake(px, py)]];
}
}
// the very last interpolated point is the last control point
[resultArray addObject:[points objectAtIndex:(count – 1)]];

return resultArray;
}
[/sourcecode]

All credits go to supersg559 for the implementation Catmull-Rom Spline algorithm above. I merely modified it to use NSArrays instead of C-arrays. A good explanation of the algorithm can be found on “The Code Project”.
Finally, modify touchesEnded:withEvent: to use this algorithm:

[sourcecode]- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
{
NSArray *generalizedPoints = [self douglasPeucker:drawnPoints epsilon:2];
NSArray *splinePoints = [self catmullRomSpline:generalizedPoints segments:4];
imageView_.image = [self drawPathWithPoints:splinePoints image:cleanImage];
[drawnPoints release];
[cleanImage release];
}
[/sourcecode]

That’s it. You’re done!

It would facilitate them to put fine-looking signatures, draw beautiful sketches and make impressive presentations.

Have something to add to this topic? Share it in the comments.

At Andolasoft we have a team dedicated iOS app developer who has long expertise in implementation of Service Oriented Architecture. Our developers can help you in all your mobile app development issues. So don’t hesitate to communicate with them. Book a free consultation to access them directly.

Apple Promises To Fix The Security Exploit That Lets People Gain Access

In our previous post we had outlined some of the latest features of iOS 6.1 update, mentioning it to be a fix for its old mistakes. But it turns out that, it does have some security flaws which let the users bypass the locked iPhone devices.

Never miss an update from us. Join 10,000+ marketers and leaders.

This exploit was first spotted by a French user who later uploaded a video to YouTube, by demonstrating the procedure to unlock a pass-code protected iOS device.  Seeing this Apple has promised to release a fast fix to this security issue. In a statement, the company said “Apple takes user security very seriously, we are aware of this issue, and will deliver a fix in a future software update.”  But the company has neither offered a specific timeline for its next update nor any quick fix to the handle issue.

The video depicts a sequence of steps in which the French guy easily hacks the “locked” iPhone, that was running iOS 6.1. The process involved is somewhat weird, such as ending an emergency call, consecutive pressing of home button and etc. Below I have provided the exact steps as posted by the users, to unlock the iPhone.

First Part:

  • Go to emergency call, push down the power button and tap cancel.
  • Dial 112 and tap green and immediately red.
  • Go to lock screen.

Second Part:

  • Go to passcode screen.
  • Keep pushing down the power button …1…2…3…seconds and before showing the slider “turn off”…tap the emergency call button and …voilá!
  • Then without releasing the power button press the home button and ready…

The procedure allows the users to access contacts, photos and to make calls. But it doesn’t offer access to its home screen or any iOS apps that exists on the home screen. The iPhone lock screen hack seems to work on iPhone 4S, iPhone 4 too, if they are running iOS 6.1.