Thứ Năm, 26 tháng 3, 2015

Asia Unites Against Poaching

Representatives from 13 Asian countries committed to immediate action to stamp out poaching at the conclusion of a four-day symposium hosted by the Nepal government in Kathmandu from February 2-6, 2015.

The Symposium: Towards Zero Poaching in Asia adopted five recommendations:

  • Swift and decisive action to elevate the importance and effectiveness of antipoaching initiatives and cooperation among all relevant ministries, departments and agencies within their borders, while at the same time strengthening international cooperation in the face of this serious criminal activity.
  • Adoption of the Zero Poaching Tool Kit and assessment of current antipoaching responses to determine improvements and close serious gaps.
  • Increase and improve collaboration as a successful antipoaching response is critically dependant on effectively engaging a diverse number of shareholders
  • Improve standards, training and support for rangers, other frontline staff and prosecutors.
  • Commit to identifying a Zero Poaching national contact point to effectively coordinate transboundary efforts to stop poaching.

Tika Ram Adhikari, Director General of Nepal’s Department of Wildlife Conservation and Soil Conservation, said: “Nepal was proud to host this vital conversation in Asia because we recognize that poaching is robbing us of our wildlife wealth, which includes tigers, rhinos and elephants. We cannot allow wildlife crime to continue to wrap its tentacles deeper into the region. Our individual efforts may win us a few battles, but we can only win the war if Asia presents a united front to stop the poaching, end the trafficking and wipe out demand.”

Mike Baltzer, Leader, WWF Tigers Alive Initiative, said: “This is the beginning of the end for poaching across Asia. WWF is proud to have supported this landmark meeting and is committed to be part of the new determined movement for Zero Poaching in Asia.”

Nepal was the natural host for the symposium having achieved zero poaching for two years in the past four years. At the symposium, representatives from local communities, protected areas as well as enforcement agencies shared their lessons lea

At the closing ceremony, Nepal’s legendary Chitwan National Park (CNP) also became the first global site to be accredited as Conservation Assured Tiger Standard (CA|TS).Despite the threats that CNP faces, the protected area has seen an increasingly effective management and protection regime. This further demonstrates the commitment of Nepal towards zero poaching.

Thirteen Asian countries participated in the symposium: Bangladesh, Cambodia, China, Viet Nam, Malaysia, Russia, Indonesia, Myanmar, Thailand, Nepal, India, Bhutan, and Lao PDR. Partner NGOs and other organisations included IUCN, TRAFFIC, CITES, UN Office on Drugs and Crime, US Department of Justice, SMART Partnership and Southern African Wildlife College.

WWF co-hosted the symposium with Global Tiger Forum, National Trust for Nature Conservation and the South Asian Wildlife Enforcement Network.

The symposium provides valuable direction on tackling poaching in advance of the Kasane Conference on the Illegal Wildlife Trade to be hosted by the Botswana government on 25th March 2015. This meeting follows the London Conference on the Illegal Wildlife Trade hosted by the UK government in February 2014, where 41 governments committed to taking “decisive and urgent action….” through the agreed declaration.

Thứ Tư, 25 tháng 3, 2015

iOS 8.3 Beta 4 Released, New Version & Possibly Jailbreak Coming Soon

83update

Even though Apple just recently released iOS 8.2 to go public a new firmware has been receiving a great deal of attention. Today, iOS 8.3 beta 4 was released to developers indicating that it could be going public in the near future. iOS versions usually have a great effect on when jailbreaks are released and it is most likely that nothing new will come out until 8.3 has gone public.

iOS 8.3 will offer many new features including CarPlay support, a whole new customization emoji system,  and expansions to previous features like Apple Pay. If you are a developer you can download it now via the dev center or an OTA on a device running iOS 8.3

iOS-83-beta-4-dev-center

Source : jailbreaknation[dot]com
post from sitemap

iOS 8.3 Beta 4 Released to Developers & Public Beta Users for Testing

iOS 8

Apple has released the fourth beta release of iOS 8.3 to those registered with the iOS developer program, or who are participating in the iOS Public Beta. The build is versioned as 12F5061 and is available now for compatible iPhone, iPad, and iPod touch devices.


The simplest way to install iOS 8.3 beta 4 is through the Over-the-Air software update mechanism on the iOS device. This is accessible through Settings > General > Software Update. As always, back up the device before updating system software, this is particularly important when that iOS software is a beta version. Additionally, it is not advised to run beta software on a primary device.

iOS 8.3 beta install

The new beta build IPSW can also be downloaded from the iOS Dev Center for those registered with Apple.

iOS 8.3 continues to focus on improvements, bug fixes, and feature enhancements, and the version is expected to include new diverse Emoji icons, wireless CarPlay connectivity, Apple Pay improvements, new languages for Siri, and Google 2-factor authentication support.

While this is the fourth beta of iOS 8.3 overall, this is the second release available to Public Beta users of iOS. There is no known timeline for iOS 8.3 being released to the general public, but one could reasonably expect a final version to arrive before Apple Watch debuts.

Separately, Apple has also made Xcode 6.3 beta 4 available to iOS developers.

Source : osxdaily[dot]com
post from sitemap

Thứ Hai, 23 tháng 3, 2015

Layout: Instagram’s New Collage App

UWIpFk6

Today Instagram released a new app to create collages named layout. The app is supplemental to the popular photo social networking service owned by Faceboook. Last year, the company produced Hyperlapse which allowed people to take high quality time lapses on their phones. Layout is another app which uses Instagram at its core but adds new functionality for anyone that wants to download the separate app. It makes sense that Instagram would create a collage app as the App Store has been flooded with 3rd party alternatives.

The app can also detect which of your photos have faces in them in case you want to avoid food / object only content.

 

Instagram Layout highlights:

  • Re-mix up to 9 of your photos at a time to create fun, personalized layouts.
  • Use the Faces tab to quickly find photos with people in them.
  • Capture the moment in Photo Booth mode with quick, spontaneous shots.
  • Save your layouts to your camera roll and share them seamlessly to Instagram or other networks.
  • Easily see the last 30 photos you’ve selected in the Recents tab.
  • Pair your layouts with Instagram’s filters and creative tools afterwards to make them stand out even more.
  • Download and start creating immediately. No signup or account required—and no clutter breaking up your flow.
Source : jailbreaknation[dot]com
post from sitemap

Introduction to Custom View Controller Transitions and Animations

8 Flares 8 Flares ×

Looking at the built in apps from Apple on your iOS device, you will notice the various animated transitions as you move from one view to another for example the way view controllers are presented in master-detail views with a swipe that slides the detail view controller over the master view controller as seen in the Messages app or Settings app and the various transitions that represent a segue to another view controller.

iOS 7 introduced custom view controller transitions which make it possible for developers to create their own animated transitions from one view controller to the next in their apps. In this tutorial, we’ll take a look at how to do this. We’ll also look at how to create gesture driven transitions called interactive transitions. To follow along, download the starter project which we’ll be using throughout the tutorial.

custom-view-transition

Getting Started

To create custom transitions you have to follow three steps:

  • Create a class that implements the UIViewControllerAnimatedTransitioning protocol. Here you will write code that performs the animation. This class is referred to as the animation controller.
  • Before presenting a view controller, set a class as its transitioning delegate. The delegate will get a callback for the animation controller to be used when presenting the view controller.
  • Implement the callback method to return an instance of the animation controller from the first step.

Run the starter project and you will be presented with a table view of a list of items. There is an Action button on the navigation bar and when you tap it you’ll be presented with another view that appears in the usual modal style of sliding up from the bottom. We will write a custom transition for this view.

custom view controller animation

Custom Present Transition

The first thing to do as stated previously, is to create the animation controller. Create a new class called CustomPresentAnimationController and make it a subclass of NSObject. Change its declaration as shown.

1
class CustomPresentAnimationController: NSObject, UIViewControllerAnimatedTransitioning {

UIViewControllerAnimatedTransitioning protocol has two required methods which we’ll add next. Add the following methods to the class.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
func transitionDuration(transitionContext: UIViewControllerContextTransitioning) -> NSTimeInterval {
    return 2.5
}
   
func animateTransition(transitionContext: UIViewControllerContextTransitioning) {
       
    let fromViewController = transitionContext.viewControllerForKey(UITransitionContextFromViewControllerKey)!
    let toViewController = transitionContext.viewControllerForKey(UITransitionContextToViewControllerKey)!
    let finalFrameForVC = transitionContext.finalFrameForViewController(toViewController)
    let containerView = transitionContext.containerView()
    let bounds = UIScreen.mainScreen().bounds
    toViewController.view.frame = CGRectOffset(finalFrameForVC, 0, bounds.size.height)
    containerView.addSubview(toViewController.view)
       
    UIView.animateWithDuration(transitionDuration(transitionContext), delay: 0.0, usingSpringWithDamping: 0.5, initialSpringVelocity: 0.0, options: .CurveLinear, animations: {
        fromViewController.view.alpha = 0.5
        toViewController.view.frame = finalFrameForVC
        }, completion: {
            finished in
            transitionContext.completeTransition(true)
            fromViewController.view.alpha = 1.0
    })
}

The first method specifies the length of the transition animation. For the demo app we’ve set it at 2.5 seconds, but you probably should set it to a smaller number in a real app.

In the second method we use the transitionContext to get the view controller we are navigating from, to, the final frame the transition context should have after the animation completes and the container view which houses the views corresponding to the to and from view controllers.

We then position the to view just below the bottom of the screen. Then we add the to view to the container view and in the animate closure, we animate the to view by setting its final frame to the location given by the transition context. We also animate the from view‘s alpha value so that as the to view is sliding up the screen over the from view, the from view will be faded out. The duration of the animation used is the one set in transitionDuration(transitionContext:). In the completion closure, we notify the transition context when the animation completes and then change the from view‘s alpha back to normal. The framework will then remove the from view from the container.

With the animation controller completed, we need to link it to a storyboard segue.

Open the ItemsTableViewController.swift file and change the class declaration as shown.

1
class ItemsTableViewController: UITableViewController, UIViewControllerTransitioningDelegate {

UIViewController has a property named transitionDelegate that supports custom transitions. When transitioning to a view controller, the framework checks this property to see if a custom transition should be used. UIViewControllerTransitioningDelegate supplies custom transitions.

Open Main.storyboard and select the Present modally segue to Action View Controller and in the Attributes Inspector, set its Identifier to showAction.

Custom View Controller Animation

Back in ItemsTableViewController add the following to the class.

1
2
3
4
5
6
7
8
9
let customPresentAnimationController = CustomPresentAnimationController()

override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
       
    if segue.identifier == "showAction" {
        let toViewController = segue.destinationViewController as UIViewController
        toViewController.transitioningDelegate = self
    }
}

Here we create an instance of our animation controller and then in the prepareForSegue() function, we detect the segue for the Action screen and set the transitionDelegate property of the destination view controller.

Add the following UIViewControllerTransitioningDelegate method to the class. This returns the instance of our custom animation controller.

1
2
3
func animationControllerForPresentedController(presented: UIViewController, presentingController presenting: UIViewController, sourceController source: UIViewController) -> UIViewControllerAnimatedTransitioning? {
    return customPresentAnimationController
}

Run the application and you should see the Action view slide up slowly from the screen and bounce a little before settling.

Custom View Controller Animation #3

If you want a slightly different effect, then change this statement in CustomPresentAnimationController.swift

1
toViewController.view.frame = CGRectOffset(finalFrameForVC, 0, bounds.size.height)

to the statement below, which changes the original position of the to view controller to be above the screen.

1
toViewController.view.frame = CGRectOffset(finalFrameForVC, 0, -bounds.size.height)

Run the app and the Action view should fall from above.

Custom View Controller

Custom Dismiss Transition

We’ve set a custom transition for presenting our view, but when it is dismissed, it uses the default transition set by Apple.

Custom View Controller #4

The UIViewControllerTransitioningDelegate also allows you to specify an animation controller to use when dismissing a view controller as well as when presenting one. We’ll create this next.

Create a class named CustomDismissAnimationController that is a subclass of NSObject. Modify its declaration as shown.

1
class CustomDismissAnimationController: NSObject, UIViewControllerAnimatedTransitioning {

Add the following to the class.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
func transitionDuration(transitionContext: UIViewControllerContextTransitioning) -> NSTimeInterval {
    return 2
}

func animateTransition(transitionContext: UIViewControllerContextTransitioning) {
    let fromViewController = transitionContext.viewControllerForKey(UITransitionContextFromViewControllerKey)!
    let toViewController = transitionContext.viewControllerForKey(UITransitionContextToViewControllerKey)!
    let finalFrameForVC = transitionContext.finalFrameForViewController(toViewController)
    let containerView = transitionContext.containerView()
    toViewController.view.frame = finalFrameForVC
    toViewController.view.alpha = 0.5
    containerView.addSubview(toViewController.view)
    containerView.sendSubviewToBack(toViewController.view)
   
    UIView.animateWithDuration(transitionDuration(transitionContext), animations: {
        fromViewController.view.frame = CGRectInset(fromViewController.view.frame, fromViewController.view.frame.size.width / 2, fromViewController.view.frame.size.height / 2)
        toViewController.view.alpha = 1.0
    }, completion: {
        finished in
        transitionContext.completeTransition(true)
    })
}

This is similar to the implementation of the presentation transition. In the animateTransition() function, we get the to and from view controllers. The to view controller here is the table view controller. We change its view’s alpha value so that it will start off as being faded when we start animating. We then add the view to the container and place it behind the from view controller’s view so that it won’t be visible just yet.

In the animation block, we animate the from view‘s size to have a width and height of 0, maintaining its center. This will have an effect of shrinking the from view to nothingness. We also animate the to view‘s alpha to being completely visible.

In ItemsTableViewController add the following property.

1
let customDismissAnimationController = CustomDismissAnimationController()

Add the following function to the class.

1
2
3
func animationControllerForDismissedController(dismissed: UIViewController) -> UIViewControllerAnimatedTransitioning? {
    return customDismissAnimationController
}

The UIViewControllerTransitioningDelegate protocol provides the above function which retrieves the animation controller of a dismissed view controller.

Run the app. You should see the following animation.

Custom View Animation #5

The animation isn’t what we expected. You can see the white frame of the from view shrinks as expected, but the image on the view doesn’t change in size. This is because changing the view’s frame doesn’t affect its children. We’ll fix this by using UIView snapshotting.

UIView snapshotting works by taking a snapshot of an existing UIView and rendering it into a lightweight UIView. We will then use this snapshot in out animation and not the actual view.

Replace the animateTransition() function with the following.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
func animateTransition(transitionContext: UIViewControllerContextTransitioning) {
    let fromViewController = transitionContext.viewControllerForKey(UITransitionContextFromViewControllerKey)!
    let toViewController = transitionContext.viewControllerForKey(UITransitionContextToViewControllerKey)!
    let finalFrameForVC = transitionContext.finalFrameForViewController(toViewController)
    let containerView = transitionContext.containerView()
    toViewController.view.frame = finalFrameForVC
    toViewController.view.alpha = 0.5
    containerView.addSubview(toViewController.view)
    containerView.sendSubviewToBack(toViewController.view)
       
    let snapshotView = fromViewController.view.snapshotViewAfterScreenUpdates(false)
    snapshotView.frame = fromViewController.view.frame
    containerView.addSubview(snapshotView)
       
    fromViewController.view.removeFromSuperview()
       
    UIView.animateWithDuration(transitionDuration(transitionContext), animations: {
        snapshotView.frame = CGRectInset(fromViewController.view.frame, fromViewController.view.frame.size.width / 2, fromViewController.view.frame.size.height / 2)
        toViewController.view.alpha = 1.0
    }, completion: {
        finished in
        snapshotView.removeFromSuperview()
        transitionContext.completeTransition(true)
    })  
}

Here, we create a snapshot of the from view controller‘s view, add it to the container and remove the from view from the container. We then shrink this snapshot in our animation and when the animation completes, we remove the snapshot view from the container.

Run it and the animation should now run smoothly.

Custom View Controller Animation

Navigation controller transitions

We’ve looked at adding a custom transition for modal view controller presentation where we added a transitioning delegate to the presenting view controller. However, setting a delegate on every view controller can get tiresome when working with a UITabBarController or UINavigationController.

These controllers give a simpler approach whereby the animation controller for a transition is supplied via the UITabBarControllerDelegate or UINavigationControllerDelegate.

We’ll see this in action by adding a custom transition to a navigation controller.

To start off, we create an animation controller. Create a class called CustomNavigationAnimationController, make it a subclass of NSObject and change its declaration as follows.

1
class CustomNavigationAnimationController: NSObject, UIViewControllerAnimatedTransitioning {

Add the following to the class. I use a simplified version of this cube animation for this animation controller. The animation controller is set up as usual just like we’ve seen with the previous two animation controllers. Notice the reverse class variable. We use this to determine the direction of the animation, depending on whether we are moving from master to detail view or vice versa.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
var reverse: Bool = false
   
func transitionDuration(transitionContext: UIViewControllerContextTransitioning) -> NSTimeInterval {
    return 1.5
}
   
func animateTransition(transitionContext: UIViewControllerContextTransitioning) {
    let containerView = transitionContext.containerView()
    let toViewController = transitionContext.viewControllerForKey(UITransitionContextToViewControllerKey)!
    let fromViewController = transitionContext.viewControllerForKey(UITransitionContextFromViewControllerKey)!
    let toView = toViewController.view
    let fromView = fromViewController.view
    let direction: CGFloat = reverse ? -1 : 1
    let const: CGFloat = -0.005
       
    toView.layer.anchorPoint = CGPointMake(direction == 1 ? 0 : 1, 0.5)
    fromView.layer.anchorPoint = CGPointMake(direction == 1 ? 1 : 0, 0.5)
       
    var viewFromTransform: CATransform3D = CATransform3DMakeRotation(direction * CGFloat(M_PI_2), 0.0, 1.0, 0.0)
    var viewToTransform: CATransform3D = CATransform3DMakeRotation(-direction * CGFloat(M_PI_2), 0.0, 1.0, 0.0)
    viewFromTransform.m34 = const
    viewToTransform.m34 = const
       
    containerView.transform = CGAffineTransformMakeTranslation(direction * containerView.frame.size.width / 2.0, 0)
    toView.layer.transform = viewToTransform
    containerView.addSubview(toView)
       
    UIView.animateWithDuration(transitionDuration(transitionContext), animations: {
        containerView.transform = CGAffineTransformMakeTranslation(-direction * containerView.frame.size.width / 2.0, 0)
        fromView.layer.transform = viewFromTransform
        toView.layer.transform = CATransform3DIdentity
    }, completion: {
        finished in
        containerView.transform = CGAffineTransformIdentity
        fromView.layer.transform = CATransform3DIdentity
        toView.layer.transform = CATransform3DIdentity
        fromView.layer.anchorPoint = CGPointMake(0.5, 0.5)
        toView.layer.anchorPoint = CGPointMake(0.5, 0.5)
   
        if (transitionContext.transitionWasCancelled()) {
            toView.removeFromSuperview()
        } else {
            fromView.removeFromSuperview()
        }
        transitionContext.completeTransition(!transitionContext.transitionWasCancelled())
    })        
}

Open ItemsTableViewController.swift and modify the class declaration as follows.

1
class ItemsTableViewController: UITableViewController, UIViewControllerTransitioningDelegate, UINavigationControllerDelegate {

UINavigationControllerDelegate supplies the animation controller.

Add the following property to the class.

1
let customNavigationAnimationController = CustomNavigationAnimationController()

Add the following at the end of viewDidLoad().

1
navigationController?.delegate = self

The above sets the host navigation controller’s delegate so that the new transition delegate methods can be received.

Then add the following to the class.

1
2
3
4
func navigationController(navigationController: UINavigationController, animationControllerForOperation operation: UINavigationControllerOperation, fromViewController fromVC: UIViewController, toViewController toVC: UIViewController) -> UIViewControllerAnimatedTransitioning? {
    customNavigationAnimationController.reverse = operation == .Pop
    return customNavigationAnimationController
}

The above function is called to request for an animation controller to navigate between the from and to view controllers and it returns an instance of our animation controller. The direction of the transition is based on whether this is a push or pop navigation operation.

Run the app. Select a table view cell and you should see the animation below.

Custom View Animation #7

Making it Interactive

We’ll make the above transition interactive, i.e. the user will be able to control the transition with gestures.

iOS built-in apps come with this feature. As an alternative to the back button, you can initiate a transition by swiping from the left side of the screen. You can use a short swipe to briefly view the master view and then cancel the transition. A long swipe initiates the pop navigation operation.

Custom View Animation #8

To get started, we need an interaction controller. Interactive controllers use the UIViewControllerInteractiveTransitioning protocol. The navigation controller delegate or the transitioning delegate requests for an optional interaction controller after requesting an animation controller.

Let’s create the interaction controller. Create a new class and name it CustomInteractionController and make it a subclass of UIPercentDrivenInteractiveTransition.

UIPercentDrivenInteractiveTransition implements the UIViewControllerInteractiveTransitioning protocol so we wont have to add that to our class.

To use UIPercentDrivenInteractiveTransition, your animation controller must use a single UIView animation, so that the animation will be able to be stopped, reversed and played.

Add the following to the class.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
var navigationController: UINavigationController!
var shouldCompleteTransition = false
var transitionInProgress = false
var completionSeed: CGFloat {
    return 1 - percentComplete
}
   
func attachToViewController(viewController: UIViewController) {
    navigationController = viewController.navigationController
    setupGestureRecognizer(viewController.view)
}
   
private func setupGestureRecognizer(view: UIView) {
        view.addGestureRecognizer(UIPanGestureRecognizer(target: self, action: "handlePanGesture:"))
}
   
func handlePanGesture(gestureRecognizer: UIPanGestureRecognizer) {
    let viewTranslation = gestureRecognizer.translationInView(gestureRecognizer.view!.superview!)
    switch gestureRecognizer.state {
    case .Began:
        transitionInProgress = true
        navigationController.popViewControllerAnimated(true)
    case .Changed:
        var const = CGFloat(fminf(fmaxf(Float(viewTranslation.x / 200.0), 0.0), 1.0))
        shouldCompleteTransition = const > 0.5
        updateInteractiveTransition(const)
    case .Cancelled, .Ended:
        transitionInProgress = false
        if !shouldCompleteTransition || gestureRecognizer.state == .Cancelled {
            cancelInteractiveTransition()
        } else {
            finishInteractiveTransition()
        }
    default:
        println("Swift switch must be exhaustive, thus the default")
    }
}

The attachToViewController() method is passed a reference of the navigation controller which it uses to initiate a pop transition when a gesture occurs. We then set up a gesture recognizer, which will call the handlePanGesture() method when a swipe is made. This checks the gesture recognizer state and does the following at each stage:

  • Began: It sets transitionInProgress to true and initiates a pop navigation.
  • Changed: Here the gesture is in progress, so it determines the percentage of the transition. A 200 point swipe will cause the transition to be 100% complete. It then determines if the transition should complete depending on where the gesture finishes. Here we check if the user swiped to at least half the screen before releasing.
  • Cancelled/Ended: Sets the transitionInProgress to false and cancels the transition if shouldCompleteTransition was set to false or if the gesture was cancelled. Otherwise, the transition is completed.

We used a computed property to determine the completion speed. completionSeed is a UIPercentDrivenInteractiveTransition property that informs the framework how much of the animation remains when a gesture completes. A larger number will make the view controller snap back quicker if the interaction is cancelled.

To use our interaction controller, open ItemsTableViewController.swift and add the following to the class.

1
let customInteractionController = CustomInteractionController()

Add the following at the beginning of the navigationController(_:animationControllerForOperation:
fromViewController:toViewController:)
function.

1
2
3
if operation == .Push {
    customInteractionController.attachToViewController(toVC)
}

This calls the CustomInteractionController’s attachToViewController() method and passes it a reference of the to view controller when it detects a push navigation operation.

Then add the following to the class.

1
2
3
func navigationController(navigationController: UINavigationController, interactionControllerForAnimationController animationController: UIViewControllerAnimatedTransitioning) -> UIViewControllerInteractiveTransitioning? {
    return customInteractionController.transitionInProgress ? customInteractionController : nil
}

After the framework asks for and gets an animation controller, it asks for an interaction controller using the method above. The above returns an instance of our interaction controller if a transition is in progress.

Run the app and you should see the transition shown.

Custom View Animation #9

Conclusion

We’ve looked at how to create custom view controller transitions and how to make a transition interactive. With these features, developers now have full control over the animations used in their application as it transitions from one view controller to the next and thus can build unique experiences to delight their users. You can download the completed project here.

Source : appcoda[dot]com
post from sitemap

Chủ Nhật, 22 tháng 3, 2015

How to Make Phone Calls from Mac Using iPhone

Making and Receiving Phone Calls from Mac with iPhone

If you have a Mac and an iPhone, you can now make phone calls from your Mac using that iPhone. The phone call will sound through the Mac speakers and use the Mac microphone, but the actual call itself routes through the iPhone. This is a part of the Continuity suite, which is really nice feature set in newer versions of iOS and OS X that allow for seamless transition between Macs and iPhones and iPads. Phone calling from the Mac is quite simple to use once you have it set up properly.

Requirements for Making Phone Calls from a Mac via iPhone

You do not need to have Bluetooth enabled to use this feature, but you must be on the same wi-fi network, the devices must be using the same iCloud account, and the feature must be enabled in OS X and iOS, both of which require a modern version to function (OS X 10.10.x or newer, and iOS 8.x or newer). This is basically the same set of requirements which is necessary for using HandOff, which is another Continuity feature.

How to Enable Phone Calls from Mac with iPhone

Before making phone calls from the iPhone using your Mac, you’ll need to enable the feature on both iPhone and OS X, this is easy:

  1. From the iPhone, open Settings and go to “FaceTime”
  2. Toggle the switch for “iPhone Cellular Calls” to the ON position, this may be turned off so be sure it is ON
  3. iPhone cellular calls setting

  4. From the Mac, open the “FaceTime” application and from the FaceTime menu, select “Preferences”
  5. Toggle the switch for “iPhone Cellular Calls” so that it is ON
  6. Enabling iPhone Cellular Calls on Mac

This is particularly important to double-check that settings are enabled and set properly because many users opted to turn off their Mac ringing with an inbound iPhone call after experiencing it once or a dozen times, which can be desired or annoying depending on the environment.

How to Make Phone Calls from the Mac Using the iPhone

Once configuration is complete and the devices are nearby on the same wireless network, making an outbound call from the Mac through an iPhone is really easy:

  1. Open the “Contacts” app on the Mac, and locate the personal or contact to make a call to
  2. Hover the cursor over the phone number in Contacts app to reveal a little phone icon, click on that phone icon to make the call

Making a Phone Call from Mac with iPhone

You’ll see a little notification like popup arrive in the top corner of the Mac screen as the call starts, you’ll have the option to mute and end calls using that screen, which remains active as long as the call is active.

Making a phone call from the Mac through an iPhone displays this window to interact with the call

You can also make phone calls from the Mac from the FaceTime app, though if you’re calling someone on another Mac or iPhone it is likely to get routed through the Apple VOIP FaceTime Audio protocol. Additionally, you can make phone calls from Safari by hovering over a number on the web.

Receiving Phone Calls from iPhone on the Mac

When calling is configured properly, you’ll also discover that the Mac will receive inbound calls as well. When an inbound call is coming through, a notification will display in OS X, the Mac will ring alongside the iPhone, and you can answer the call in OS X, which again will route through the Mac speaker and microphone (or a headset, if one is in use).

The Mac receiving a phone call from iPhone

While you can stop the Mac receiving calls, if you do so it will not be able to make calls too.

Can You Make Phone Calls from the Mac Without Receiving Them on the Mac?

At the moment there is no way to turn off the reception of phone calls on the Mac while maintaining the ability to make phone calls from the Mac, the only option is to change the ringtone on the Mac to a quiet or silent one. This is similar to other iPhones and iPads using the same Apple ID, where device ringing can be disabled too through iOS Settings but doing so will also remove the ability for the same device to make an outbound call.

Where is the Number Dialing Pad on the Mac for Making Calls?

Great question! Currently, OS X does not have a built-in dialing pad with numbers for making calls to new numbers. Hopefully that will change in the future, but for the time being, you’ll need to turn to the iPhone if you need to use a numerical dialing pad on the call.

If you like the ability to make and receive calls on the Mac, you’ll probably also like to be able to make and receive text messages from Mac OS X too, which can be setup with these instructions.

Source : osxdaily[dot]com
post from sitemap

Thứ Bảy, 21 tháng 3, 2015

How to Mark All iMessages as Read on iPhone & iPad Instantly

New Unread Messages badge

We’ve all experienced it, a huge number of texts and iMessages arriving on our iPhone or iPad, that you either know aren’t important or you already read on another devices Messages app. Or maybe the messages are coming from someone you’d just prefer to ignore, whatever the case, you can instantly mark all messages as read in iOS using a quick little known trick.


This is significantly faster than manually opening each individual thread, tapping back to the primary messages window, then repeating the same with each unread conversation to mark them manually.

Instantly Mark All iMessages as Read in Messages App for iOS

The next time you have a bunch of messages – iMessages or text messages – you want to mark as read in iOS, just do the following:

  1. Open the Messages app on the iPhone or iPad
  2. Tap the “Edit” button in the corner and then at the bottom of the Messages app tap on “Read All”

Read All Messages in iOS immediately

Simple, quick, and effective.

Marking All Messages as Read in iOS as demonstrated with iphone

This will remove all indicators of new messages, marking them as read; the blue icon that is alongside an unread thread, the number that is at the top of the Messages app screen, and the new/unread red badge icon with the number on it on the Messages app icon, at least until you get more messages that haven’t been read.

You can always opt to turn the red badges off entirely from any given app, Messages included, but that’s generally not recommended unless you’re really fed up with them, since without them you won’t have any obvious indicator there are new messages waiting to be read.

This is particularly helpful if you use an iPhone or iPad synced with another Mac or iOS device, where messages appear across the board on all devices, since often they don’t seem to register that a message has been read on one device. It’s also a great solution to when you pull an iOS device out of Do Not Disturb mode to find an onslaught of new message notifications that ultimately aren’t that important.

Similar tricks are available to mark all email as read on the iPhone and iPad, and do the same with Voice Mail on the iPhone too.

Source : osxdaily[dot]com
post from sitemap