Updating to latest version of CocoaPods?

Execute the following on your terminal to get the latest stable version: sudo gem install cocoapods Add –pre to get the latest pre release: sudo gem install cocoapods –pre If you originally installed the cocoapods gem using sudo, you should use that command again. Later on, when you’re actively using CocoaPods by installing pods, you … Read more

Codesign error: Provisioning profile cannot be found after deleting expired profile

Sometimes your Xcode project file gets messed up, especially if you have an old project and first created it with an older version of Xcode/iPhone SDK. What you need to do is open up the project file in a text editor, search for the ‘long string’ from your error and manually erase that line. In … Read more

How can I set the title of a UIButton as left-aligned?

Set the contentHorizontalAlignment: // Swift emailBtn.contentHorizontalAlignment = .left; // Objective-C emailBtn.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft; You might also want to adjust the content left inset otherwise the text will touch the left border: // Swift 3 and up: emailBtn.contentEdgeInsets = UIEdgeInsets(top: 0, left: 10, bottom: 0, right: 0); // Objective-C emailBtn.contentEdgeInsets = UIEdgeInsetsMake(0, 10, 0, 0);

Xcode Project vs. Xcode Workspace – Differences

I think there are three key items you need to understand regarding project structure: Targets, projects, and workspaces. Targets specify in detail how a product/binary (i.e., an application or library) is built. They include build settings, such as compiler and linker flags, and they define which files (source code and resources) actually belong to a … Read more

How to install Xcode Command Line Tools

Xcode 5.1 and OSX 10.9. (also works with Xcode 5.1.1 + OSX 10.10) xcode-select –install worked with version 2333, failed with version 2003. So, try xcode-select –install and if that does not work download as described below. In early February 2014 xcode-select –install has been reporting that “Can’t install the software because it is not … Read more

How to update Xcode from command line

What you are actually using is the command to install the Xcode command line tools – xcode-select –install. Hence the error message you got – the tools are already installed. The command you need to update Xcode is softwareupdate command [args …]. You can use softwareupdate –list to see what’s available and then softwareupdate –install … Read more

How to remove CocoaPods from a project?

Removing CocoaPods from a project is possible, but not currently automated by the CLI. First thing, if the only issue you have is not being able to use an xcworkspace you can use CocoaPods with just xcodeprojs by using the –no-integrate flag which will produce the Pods.xcodeproj but not a workspace. Then you can add … Read more