How to disable iOS 9 App Transport Security in Xcode 7, and fix ‘Could not connect to the server’ errors
Apple made a radical decision with iOS 9, disabling all unsecured HTTP traffic from iOS apps, as a part of App Transport Security.
Aqua Utopia|海の底で記憶を紡ぐ
h
YOU ARE THE REASON

izzy's playlists!

No title available
let's talk about Bridgerton tea, my ask is open

Discoholic 🪩
he wasn't even looking at me and he found me
we're not kids anymore.
Game of Thrones Daily
Stranger Things

PR's Tumblrdome
almost home

Kiana Khansmith
Sweet Seals For You, Always
$LAYYYTER
Monterey Bay Aquarium

⁂
hello vonnie
I'd rather be in outer space 🛸

seen from Saudi Arabia

seen from United States
seen from United States

seen from United States

seen from Malaysia

seen from United States

seen from Mexico

seen from United States

seen from Malaysia
seen from United States
seen from Kuwait

seen from Malaysia

seen from United States
seen from United States

seen from Kuwait

seen from Italy

seen from United States

seen from United States
seen from Chile
seen from Saudi Arabia
@iosdevtips
How to disable iOS 9 App Transport Security in Xcode 7, and fix ‘Could not connect to the server’ errors
Apple made a radical decision with iOS 9, disabling all unsecured HTTP traffic from iOS apps, as a part of App Transport Security.
Notes: The interesting things from WWDC, iOS 9, Swift 2
The WWDC keynote today was great, except for the part where it just wouldn't end. Tons of new stuff on the development front including Swift 2, iOS 9, CloudKit etc.
Here are some notes I gathered while browsing release notes, API diffs, feature pages and so on.
Tip: Avoid retain cycles without doing the strong to weak dance
Retain cycles. We’ve all likely been bitten by it at least once. Especially with the increasing role blocks/closures play in modern day iOS development. As you probably already know, referencing any object from inside a block captures a strong reference to it, and if that object copies/retains the block, it results in a retain cycle, that could cause a memory leak unless the block is manually nil’ed out.
How to easily inspect the return value of methods with breakpoints and Xcode’s debugger
I’m sure you’ve often wanted to inspect the return value of a method in Xcode’s debugger with breakpoints. But because you can’t put a breakpoint after the last line of a method, it becomes slightly tricky to figure out the return value. Thankfully, there’s an easy trick.
RJImageLoader Animation with CAShapeLayer
Michael Villar's excellent Motion Experiments post had a great image loading animation. RJImageLoader is a recreation of that animation in Objective-C for iOS.
If you want to know how it was implemented, read this tutorial on raywenderlich.com.
Fork/Clone/Pod/Contribute!
Replicating Twitter's bird zoom startup animation (in Swift!)
Twitter recently updated its iOS app with a really cool startup animation that transitions from the Default.png to the timeline view. The animation uses the Twitter bird as a window into the timeline view, and then zooms it in. Here's a demo:
Replicating UIScrollView's deceleration with Facebook Pop
Earlier this week Ole Begemann wrote a really great tutorial on how UIScrollViews work, and to explain it effectively, he even created a really simple scroll view, written from scratch.
The setup was quite simple: Use a UIPanGestureRecognizer, and change the bounds’ origin in response to translation of the pan gesture.
Extending Ole’s custom scroll view to incorporate UIScrollView’s inertial scrolling seemed like a natural extension, and with Facebook’s recent release of Pop, I thought it writing a decelerating custom scroll view would be an interesting weekend project.
Experimenting with Facebook's open source animation framework POP
Facebook today open sourced its highly-anticipated animation framework called Pop that powers the animations in the Paper for iOS app.
Pop's methods for defining animations resemble Apple's Core Animation API, so it should be quite easy to pick up if you've worked with CoreAnimation before. Even if you haven't, writing a basic animation with Pop is quite easy.
Xcode got updated to version 5.1.1 today. Release notes say there are a lot of bug and crash fixes. Hoping Xcode crashes lesser with this update.
The best Xcode plugins
There are a lot of Xcode plugins to augment the IDE with additional features, conveniences etc., but it is a pain to discover and install such plugins. Alcatraz is a really great package manager that makes it a breeze to install Xcode plugins. Here’s how it looks:
In Alcatraz, you’ll find plugins, color schemes and templates for code fragments. You can install it by visiting alcatraz.io.
Here are some of the best Xcode plugins available in Alcatraz to boost your productivity:
What happens when you call valueForKey on NSArray or NSSet
I’m slightly familiar with key value coding, but never really used it in any project. But I think I’ve found a good use for KVC, which I didn’t know about:
Calling valueForKey on a collections like NSArray or NSSet calls valueForKey on each member of the array or set.
What’s the use of this, you ask? Read on.
An example use case from our Dribbble app Design Shots — I have a User object and a Comment object. Each comment has a user property, and I have an array of such comments.
To get all the users who’ve commented, I’d normally have to do this:
NSMutableArray *users = [NSMutableArray array]; for (Comment *comment in self.comments) { [users addObject:comment.user]; }
But with KVC, I can do this in just one line:
NSArray *users = [self.comments valueForKey:@"user”];
Internally, valueForKey is called on each comment with the @“user” key, which returns a User object. These objects are then returned as an array in the users variable.
Have any feedback about this topic? I'm @r0unak on Twitter
This changes everything: Xcode 5.1 can now Quicklook preview, debug UIViews
One of the main reasons why Reveal is so useful is that it lets you see UIViews objects that are not visible on the screen. Xcode 5 added support for previewing UIImage objects, and Apple has extended QuickLook preview to UIViews as well, with Xcode 5.1.
To see this in action, just fire up any project, put a breakpoint at any line that has a UIView, and click on the eye icon, either in the debugger after clicking on a variable, or by hovering over a UIView object in your editor:
And this is what you see when you click:
This is going to be really great for one of those debugging sessions where the UIView exists, but it isn't partially or fully visible on the screen.
(Screenshot of Design Shots, a Dribbble iPhone app you should try!)
Have any feedback about this topic? I'm @r0unak on Twitter
Create your own custom loader UIActivityIndicatorView
Ever wanted to have your own custom loader view instead of iOS’ default spinning circle?
If what you want isn’t very complicated, you could probably achieve it very easily using UIImageView's animationImages property. The catch is that your animation should be easily expressible with images. If so, you do:
Xcode tip: See who committed a certain line in a file
Working on a project with multiple people and discovered a glaring bug? There's an easy way to see who was responsible for committing it using Xcode's advanced source control features.
Just right click on the line and click on "Show Blame for Line"
Once you click that, you should see the person who committed the line along with the commit message for further context:
From here you can see the diff between your working copy and the revision when that particular change was committed or see the "blame" for the entire file.
You can access the same view by long clicking the "Version Editor" button at the top-right in Xcode.
Monitor changes to an @property with this simple tip (And no extra code!)
Ever wanted to monitor changes to a property of a class? I would initially implement a custom setter for the property and then add a breakpoint in that function, but there’s an easier way.
Just put a breakpoint on the line you’ve declared your @property:
Now when the value of this property is being changed, control would come to this breakpoint, and give you a stack trace so that you know where the value change is happening:
Really neat right?
Happy debugging!
Search for methods easily in a file or project
Finding methods in a huge file can be a tough task, especially if you use the usual Find option and have to jump over all the method calls to finally arrive at the method definition. Fortunately, there's a simple way to do this.
Find methods within a file
You might have seen the dropdown that lists all the functions in a file. It is accessible from the "breadcrumb" bar at the top:
When you click on the rightmost element, you'll get all the functions in your current file:
But it's difficult to discover that you can also search within this list of functions names. To do so, simply start typing the first few letters of the method name you want to find and the search box should automatically appear:
Find methods within a project
There might also be cases where you don't know where a method is declared or defined. In such situations, you can use the the "Open Quickly" search box, which can be opened by pressing ⌘ + Shift + O. Just start typing in the method name, and it should start giving you suggestions, narrowing down the results as you type. (Note that your results will also contain files.
Painless, easy UIImage debugging
If you've tried to create a UIImage instance from data fetched over the network, you know the errors that could come up. To easily verify if your image has been initialised correctly, you can use this simple tip.
Set a breakpoint one line after you've initialised your UIImage object.
When the control halts at that line, hover over your UIImage object, and you should see a popover like this:
Click on the eye icon beside the "i" icon, and you'll see a quicklook popover that should contain your image. (If everything is done right.)
As you can imagine, this is a much better debugging technique than creating a temporary UIImageView just to show the image. (Unless of course, you need the UIImageView in your app.)
(Screenshots from Pinterest's "Pin It" demo project.)