Friday 24 October 2014

Is Apple's Watch in jeopardy? Crisis at firm making sapphire screen for wearable deepens


  • GT Advanced Technologies has been working with Apple on sapphire glass plant      
  • Filed for bankruptcy last week     
  • Apple says it will 'continue to evaluate the firm' but admits it is looking at other options to source screen  

The company that was due to make the scratchproof sapphire glass screen for the Apple Watch it still in crisis and may be forced to shut down, it has been revealed. 
GT Advanced Technologies, a former stock market darling and supplier to Apple, filed for bankruptcy on Oct 6 in a stunning turn of events for a company whose fortunes looked bright only a few months ago.
Apple said on Thursday that GT's 'ambitious' vision of sapphire manufacturing was ultimately not quite ready for primetime.

Few details have emerged since the bankruptcy filing, which wiped out most of GT's market value and triggered speculation over what may have soured its relationship with Apple.
But on Thursday, Apple, which had backed the development with GT of a sapphire-manufacturing plant in Arizona, said it will keep an eye on GT's advances, holding open the possibility of doing business with it in future.
'Apple put a lot of effort into an ambitious new sapphire manufacturing process with GTAT which is not ready for production. 
'We're going to continue evaluating GTAT's progress on larger sapphire boule development, as well as consider other options for the facility,' spokeswoman Kristin Huguet said, referring to raw cylinders of the material.
At the heart of GT's bankruptcy filing was a deal struck with Apple in November 2013. 
GT Advanced was to have used the Arizona plant to make scratch-resistant sapphire exclusively for Apple. 
That sapphire was to have eventually found its way into future mobile devices, such as iPhones - where it's already in use in their fingerprint sensors - or the upcoming Apple Watch.

Saturday 18 October 2014

iPad mini 3 release date, features, specs, UK price: Apple unveils iPad mini 3, kicks off orders



Apple unveiled the iPad mini 3 on 16 October (if you blinked you'd probably have missed it), alongside the new iPad Air 2, introducing a new gold colour option, the Touch ID fingerprint sensor beneath the Home button. Here, we bring you the latest iPad mini 3 release date information, as well as the iPad mini 3 price so you'll know how much the iPad mini 3 will cost.

iPad mini 3 vs iPad mini 2: What's the difference?  The big question for potential iPad mini customers is going to be: What's the difference between the iPad mini 3 and iPad mini 2? Disappointingly, it's largely similar, with the same screen, the same camera, the same design apart from the new gold colour and even the same specs.  Yep, that's right, the iPad mini 3 doesn't even have the new A8 processor found in the in the iPhone 6 and iPhone 6 Plus, or the A8x processor found in the iPad Air.

iPad mini 3: Release date

Apple has kicked off pre-orders for the iPad mini 3, ahead of its release alongside the new iPad Air 2 next week. Strangely, there's no actual release date yet for the iPad mini 3, with Apple simply saying that it will be available "Starting later next week."
At time of writing, you can order the iPad mini 3 from the Apple Online Store, and it'll be dispatched within 2-4 days, so you could get it delivered to you as soon as 22 October. There's no word yet about whenthe iPad mini 3 will be available in store, but it looks like there'll be no early opening and giant queue outside Apple Stores like there usually is, which is a bit of a departure for the company.

iPad mini 3: Price

As expected, the iPad mini 3 starts at £319, like the iPad mini 2 did before it. There are three configurations available: 16GB, 64GB and 128GB.
Apple is continuing to sell the iPad mini 2 with a new price tag of £239, and two configurations: 16GB or 32GB. The original iPad is now Apple's cheapest iPad ever at £199.

Friday 17 October 2014

Understand How an App Extension Works



An app extension is not an app. It implements a specific, well scoped task that adheres to the policies defined by a particular extension point.

An App Extension’s Life Cycle

Because an app extension is not an app, its life cycle and environment are different. In most cases, an extension launches when a user chooses it from an app’s UI or from a presented activity view controller. An app that a user employs to choose an app extension is called a host app. A host app defines the context provided to the extension and kicks off the extension life cycle when it sends a request in response to a user action. An extension typically terminates soon after it completes the request it received from the host app.

For example, imagine that a user selects some text in an OS X host app, activates the Share button, and chooses an app extension from the sharing list to help them post the text to a social sharing website. The host app responds to the user’s choice by issuing to the extension a request that contains the selected text. A generalized version of this situation is pictured in step 1 of Figure 2-1.

In step 2 of Figure 2-1, the system instantiates the app extension identified in the host app’s request and sets up a communication channel between them. The extension displays its view within the context of the host app and then uses the items it received in the host app’s request to perform its task (in this example, the extension receives the selected text).

In step 3 of Figure 2-1, the user performs or cancels the task in the app extension and dismisses it. In response to this action, the extension completes the host app’s request by immediately performing the user’s task or, if necessary, initiating a background process to perform it. The host app tears down the extension’s view and the user returns to their previous context within the host app. When the extension’s task is finished, whether immediately or later, a result may be returned to the host app.

Shortly after the app extension performs its task (or starts a background session to perform it), the system terminates the extension, as shown in step 4.

How an App Extension Communicates

An app extension communicates primarily with its host app, and does so in terms reminiscent of transaction processing: There is a request from the host and a response from the extension. Figure 2-2 shows a simplified view of the relationship between a running extension, the host app that launched it, and the containing app.

App Extensions Increase Your Impact




Starting in iOS 8.0 and OS X v10.10, an app extension lets you extend custom functionality and content beyond your app and make it available to users while they’re using other apps or the system. You create an app extension to enable a specific task; after users get your extension, they can use it to perform that task in a variety of contexts. For example, if you provide an extension that enables sharing to your social sharing website, users can use it to post a remark while surfing the web. Or if you provide an extension that displays current sports scores, users can put it in Notification Center so that they can get the latest scores when they open the Today view. You can even create an extension that provides a custom keyboard that users can use in place of the iOS system keyboard.

There Are Several Types of App Extensions

iOS and OS X define several types of app extensions, each of which is tied to an area of the system, such as sharing, Notification Center, and the iOS keyboard. A system area that supports extensions is called an extension point. Each extension point defines usage policies and provides APIs that you use when you create an extension for that area. You choose an extension point to use based on the functionality you want to provide.

Table 1-1 lists the extension points in iOS and OS X and gives an example of tasks you might enable in an app extension for each extension point.

Table 1-1Extension points in iOS and OS X
Extension point
Typical app extension functionality
Today (iOS and OS X)
Get a quick update or perform a quick task in the Today view of Notification Center
(A Today extension is called a widget)
Share (iOS and OS X)
Post to a sharing website or share content with others
Action (iOS and OS X; UI and non-UI variants)
Manipulate or view content originating in a host app
Photo Editing (iOS)
Edit a photo or video within the Photos app
Finder Sync (OS X)
Present information about file sync state directly in Finder.
Document Provider (iOS; UI and non-UI variants)
Provide access to and manage a repository of files.
Custom Keyboard (iOS)
Replace the iOS system keyboard with a custom keyboard for use in all apps
Because the system defines specific areas for app extensions, it’s important to choose the area that best matches the functionality you want to deliver. For example, if you want to create an extension that enables a sharing experience, use the Share extension point, starting with the Share Extension Xcode template.

IMPORTANT

Each app extension you create matches exactly one of the extension points listed in Table 1-1. You don’t create a generic extension that matches more than one extension point.

Xcode and the App Store Help You Create and Deliver App Extensions

An app extension is different from an app. Although you must use an app to contain and deliver your extensions, each extension is a separate binary that runs independent of the app used to deliver it.

You create an app extension by adding a new target to an app. As with any target, an extension target specifies settings and files that combine to build a product within your app project. You can add multiple extension targets to a single app (an app that contains one or more extensions is called a containing app).

The best way to start developing an app extension is to use one of the templates that Xcode provides for each extension point on both platforms. Each template includes extension point–specific implementation files and settings, and produces a separate binary that gets added to your containing app’s bundle.

To distribute app extensions to users, you submit a containing app to the App Store. When a user installs your containing app, the extensions it contains are also installed.

After installing an app extension, a user must take action to enable it. Often, users can enable an extension within the context of their current task. If your extension is a Today widget, for example, users can edit the Today view in Notification Center to enable your extension. In other cases, users can use Settings (in iOS) or System Preferences (in OS X) to enable and manage the extensions they install.

Users Experience App Extensions in Different Contexts

Although each type of app extension enables a different type of task, there are some parts of the user experience that are common to most extensions. As you think about designing an extension, it’s important to understand the user experience that’s intended by the extension point you choose. At a high level, the best user experience for all extensions is quick, streamlined, and focused on a single task.

Users open your app extension by interacting with some system-provided user interface (UI). For example, a user accesses a Share extension by activating the system-provided Share button in an app and choosing the extension from the list that’s displayed.

Although most app extensions provide at least some custom UI elements, users don’t see your custom UI until they enter your extension. When users enter your extension, your custom UI can help to show them that they’re shifting into a new context. Because users can distinguish your extension from the current app, they can appreciate the unique functionality that you provide. Users’ awareness of extensions as separate entities also means that they can identify and remove extensions that misbehave or don’t perform well.

To give users a smooth transition into your app extension, you generally want to balance your custom design with the UI that’s associated with the extension point. For example, it’s a good idea to make your widget look like it belongs in the Today view. Similarly, in your Photo Editing extension, it works well to create a UI that harmonizes with Photos in iOS.

NOTE

Even if your app extension doesn’t display any custom UI (other than an icon), users still understand that your extension is different from the current app because they took a specific action to activate it.

Source:  https://developer.apple.com/library/ios/documentation/General/Conceptual/ExtensibilityPG/index.html

Tuesday 18 March 2014

uiwebview Rotation Problem

Best solution: Set constraints on the UIWebView. When the View rotated, the space constraints should automatically adjust.

Wednesday 5 March 2014

Setting custom UITableViewCells height

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    return 30;
}






 

How to change font size of a row in tableview (iOS Developer)

    cell.textLabel.font = [UIFont systemFontOfSize:12];

How to add separator line to UITableView Section


UITableViewHeaderFooterView *header = (UITableViewHeaderFooterView *)view; CGRect sepFrame = CGRectMake(0, view.frame.size.height-1, 320, 1); UIView *seperatorView =[[UIView alloc] initWithFrame:sepFrame]; seperatorView.backgroundColor = [UIColor colorWithWhite:224.0/255.0 alpha:1.0]; [header addSubview:seperatorView];





Tuesday 4 March 2014

UITableView - change section header color iOS 6 and up

- (void)tableView:(UITableView *)tableView willDisplayHeaderView:(UIView *)view forSection:(NSInteger)section

{
    view.tintColor = [UIColor clearColor];
   
    UITableViewHeaderFooterView *header = (UITableViewHeaderFooterView *)view;
    [header.textLabel setTextColor:[UIColor whiteColor]];
   

}

UITableView with Multiple Sections


 - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
      return 2 ;
 }

 - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
      if (section==0)
      {
             return [array1 count];
      }
      else{
             return [array2 count];
      }
 }

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

 if(section == 0)
      return @"Section 1";
 if(section == 1)
      return @"Section 2";
 }

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

      static NSString *CellIdentifier = @"Cell";

      UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
     if (cell == nil) {
      cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier];
      }

 if (indexPath.section==0) {
     ObjectData *theCellData = [array1 objectAtIndex:indexPath.row];

Monday 3 March 2014

Using fontawesome for objective-C iOS Developer

If you like to use fontawesome in your objective C App, I have find a perfect project on github, this is the link:

https://github.com/alexdrone/ios-fontawesome


FontAwesome+iOS

Font awesome is an iconic font. Read more about it on http://fortawesome.github.com/Font-Awesome/
This category brings this great iconic font on iOS.

Usage

First, make sure you have FontAwesome.ttf bundled in your project and that UIAppFonts key in the project's plist file contains a String item named FontAwesome.ttf Then add the NSString+FontAwesome category to the project.
UILabel *label = [...]
label.font = [UIFont fontWithName:kFontAwesomeFamilyName size:20];
You can now use enums for all the different iconic characters
label.text = [NSString fontAwesomeIconStringForEnum:FAGithub];
or you can reference them by using the class identifiers listed here http://fortawesome.github.com/Font-Awesome/#all-icons
label.text = [NSString fontAwesomeIconStringForIconIdentifier:@"fa-github"];
That's it! For further information have a look to the small demo project!

FAImageView

FAImageView is now extended and contains a new property called defaultView that is shown when the image is set to nil. It is possible to use one the font-awesome icon as a default placeholder for an image view.
FAImageView *imageView = [[FAImageView alloc] initWithFrame:CGRectMake(0.f, 0.f, 100.f, 100.f)];
imageView.image = nil;
[imageView setDefaultIconIdentifier:@"fa-github"];

License

This project uses the FontAwesome fix made by Pit Garbe that you can find at https://github.com/leberwurstsaft/FontAwesome-for-iOS Version 2.0 of the Font Awesome font, CSS, and LESS files are licensed under CC BY 3.0: http://creativecommons.org/licenses/by/3.0/ A mention of 'Font Awesome - http://fortawesome.github.com/Font-Awesome' in human-readable source code is considered acceptable attribution (most common on the web). If human readable source code is not available to the end user, a mention in an 'About' or 'Credits' screen is considered acceptable (most common in desktop or mobile software)

UIFont Class Reference

Overview

The UIFont class provides the interface for getting and setting font information. The class provides you with access to the font’s characteristics and also provides the system with access to the font’s glyph information, which is used during layout. You use font objects by passing them to methods that accept them as a parameter.
You do not create UIFont objects using the alloc and init methods. Instead, you use class methods of UIFont, such as preferredFontForTextStyle:, to look up and retrieve the desired font object. These methods check for an existing font object with the specified characteristics and return it if it exists. Otherwise, they create a new font object based on the desired font characteristics.
Font objects are immutable and so it is safe to use them from multiple threads in your app.

Read more: https://developer.apple.com/library/ios/documentation/uikit/reference/UIFont_Class/Reference/Reference.html

Selected Cell Text Color ios code

   
cell.textLabel.highlightedTextColor = [UIColor blackColor];

Sunday 2 March 2014

Expanding and Collapsing table view cells in ios

Find a great code for expanding and collapsing table view on apple developer webiste. This is the link:
https://developer.apple.com/library/ios/samplecode/TableViewUpdates/Introduction/Intro.html


"TableViewUpdates" demonstrates how you can use animated updates to open and close sections of a table view for viewing, where each section represents a play, and each row contains a quotation from the play. It also uses gesture recognizers to respond to user input: * A UITapGestureRecognizer to allow tapping on the section headers to expand the section; * A UIPinchGestureRecognizer to allow dynamic changes to the height of table view rows; and * A UILongPressGestureRecognizer to allow press-and-hold on table view cells to initiate an email of the quotation.

Change cell color when selected ios code

    cell.selectedBackgroundView = [[UIView alloc] initWithFrame:cell.bounds] ;
    cell.selectedBackgroundView.backgroundColor = [UIColor lightGrayColor] ;



Setup font for the whole app - iOS Developer

 Article Source Link: http://codewithchris.com/common-mistakes-with-adding-custom-fonts-to-your-ios-app/

Step 1: Include your fonts in your XCode project
Most commonly, you’ll have a TTF or OTF font that you’ll want to use with all of your UILabels or UITextViews in your app. Well, the first step is to include these fonts into your XCode project.

I commonly keep all of my app resources such as images or fonts in their own directory called “Resources”. I find that this helps me stay organized as projects get much more complex and there are a lot of files. Whatever your case may be, either drag and drop your font file(s) into your XCode file tree or right click and “Add Files To…” to select your fonts.

Adding Custom Fonts to XCode Dialog Box
Make sure that the target you want to use your font in is checked!


Step 2: Make sure that they’re included in the target
The next thing to do is to make sure that they’re resources and included in your build target that you want to use the fonts in.

Checking That Your Custom Font Is Included In Your Target
Make sure that the target you want to use your font in is checked under “Target Membership”


Step 3: Double check that your fonts are included as Resources in your bundle
This should not be a problem but sometimes when you’re having trouble getting your font face to show up, this can be a source of headache so let’s double check now to rule it out as a potential pitfall.

this can be a source of headache

Go to your project Build Phases pane by highlighting the XCode project file in your solution explorer and on the right hand side, select “Build Phases”. You’ll see that one of the sections you can expand is “Copy Bundle Resources”. Open that list and make sure that your fonts are included in that list.

Checking That Your iOS Custom Font Is a Resource In The Bundle
Ensure that your fonts are in the “Copy Bundle Resources” list


Step 4: Include your iOS custom fonts in your application plist
The next thing to do is to modify your app’s plist to include these font faces. By default, your plist will be named something like [appname]-Info.plist and will reside in the “Supporting Files” folder if you haven’t moved it.

Open it and add a new row called “Fonts provided by application” which will be an array that you need to add all the filenames of the fonts you want to use. In my case, it was three of the Neutraface 2 Display fonts as you can see in the screenshot below. Be careful to include the extension and make sure that you don’t perform any typos here. That’s another common problem, as simple as it may seem.

Adding Your Custom iOS Fonts To Your App Plist
See the above screenshot on the key that you need to add, followed by the filenames of the fonts you want to include in your iOS app

…make sure that you don’t perform any typos here. That’s another common problem


Step 5: Find the name of the font
This is a common pitfall for many people trying to include custom fonts into their iOS app. This was something that eluded me before as well and it’s the fact that when you specify which font you want to use, you’re not specifying the file name but rather, the font name. The tricky part is that the font name may not be what you expect. It could be very different than any of the visible font names that you can see.

So in order to easily find the name of the font that you want to use, you can output something to the console window and see for yourself.

The tricky part is that the font name may not be what you expect

Add this snippet of code to log all the fonts available to your app in the console.

1
2
3
4
5
6
7
8
9
for (NSString* family in [UIFont familyNames])
{
    NSLog(@"%@", family);
       
    for (NSString* name in [UIFont fontNamesForFamilyName: family])
    {
        NSLog(@"  %@", name);
    }
}
Once you run your app, you’ll get the list of fonts displayed in your console log. Then its just a matter of finding your custom font in the list and getting the font names.

Finding The Font Names For Your Custom Fonts
Logging all fonts and finding the font names for your custom font

In the screenshot above, as you can see the font name I needed was Neutraface2Display-Bold. This font name was no where to be found in the font properties or from the OSX font viewer. Remember to get rid of that code snippet after you find the font name that you need!


Step 6: Use UIFont and specify the name of the font
And finally, you can simply display your custom font using UIFont and whatever UILabel or text view you want.

1
2
3
4
UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, 60)];
label.textAlignment = NSTextAlignmentCenter;
label.text = @"Using Custom Fonts";
label.font = [UIFont fontWithName:@"Neutraface2Display-Titling" size:20];
Sample of Displaying The Custom Font in the iOS Simulator
Sample of using custom fonts in your iOS App!

Tuesday 25 February 2014

View Controller Transitions iOS7


If you like to learn about animatedtransitioning this is the best blog that I have find, explains it very well: http://www.objc.io/issue-5/view-controller-transitions.html


View Controller Transitions
Issue #5 iOS 7, October 2013
By Chris Eidhof

One of the most exciting iOS 7 features for me is the new View Controller Transitioning API. Before iOS 7, I would also create custom transitions between view controllers, but doing this was not really supported, and a bit painful. Making those transitions interactive, however, was harder.

Before we continue with the article, I’d like to issue a warning: this is a very new API, and while we normally try to write about best practices, there are no clear best practices yet. It’ll probably take a few months, at least, to figure them out. This article is not so much a recommendation of best practices, but rather an exploration of a new feature. Please contact us if you find out better ways of using this API, so we can update this article.

Before we look at the API, note how the default behavior of navigation controllers in iOS 7 changed: the animation between two view controllers in a navigation controller looks slightly different, and it is interactive. For example, to pop a view controller, you can now pan from the left edge of the screen and interactively drag the current view controller to the right.

That said, let’s have a look at the API. What I found interesting is the heavy use of protocols and not concrete objects. While it felt a bit weird at first, I prefer this kind of API. It gives us as programmers much more flexibility. First, let’s try to do a very simple thing: having a custom animation when pushing a view controller in a navigation controller (the sample project for this article is on github). To do this, we have to implement one of the new UINavigationControllerDelegate methods:

- (id<UIViewControllerAnimatedTransitioning>)
                   navigationController:(UINavigationController *)navigationController
        animationControllerForOperation:(UINavigationControllerOperation)operation
                     fromViewController:(UIViewController*)fromVC
                       toViewController:(UIViewController*)toVC
{
    if (operation == UINavigationControllerOperationPush) {
        return self.animator;
    }
    return nil;
}

Read the rest of the article here : http://www.objc.io/issue-5/view-controller-transitions.html