Swift Dev Journal

October 19th, 2018

Filed under: Blog | Be the first to comment!

I want to let you know about a new site I launched, Swift Dev Journal. Swift Dev Journal has articles to help iOS and Mac developers create apps in Swift.

None of the blog posts here are moving. Regarding future writing, longer articles and tutorials about iOS and Mac development will be on Swift Dev Journal. This blog will contain tips and shorter articles, such as the changes in new versions of Xcode, as well as articles that wouldn’t fit at Swift Dev Journal.


Xcode 10: Projects Use New Build System

October 1st, 2018

Filed under: Xcode | Be the first to comment!

In Xcode 10 projects use the new build system by default. If you want to use the legacy build system in a project, choose File > Project Settings. Choose Legacy Build System from the Build System menu.


Xcode 10: See Changed Code in Editor

September 27th, 2018

Filed under: Version Control, Xcode | Be the first to comment!

If your Xcode project is under version control, Xcode’s editor highlights the changes you make to the code. When you add or change code, Xcode places a blue bar on the left edge of the editor.

Xcode10VersionControlChangesInEditorHighlighted

Clicking the blue bar opens a popover to discard the change. For some reason you can’t commit changes from the editor. You can only discard changes.

If you remove code, there may be a blue dot instead of a blue bar in the editor. Click the dot to discard the change and restore the code you removed.

Other Bar Colors

The blue bar on the left side of the editor window is the most common color you’ll see. But Xcode also has the following color bars for source control changes:

  • A gray bar indicates changes you committed locally but did not push to a remote repository.
  • A blue outline indicates upstream changes, changes someone else working on the project made.
  • A red bar indicates the changes you made conflict with upsream changes.

Troubleshooting

If you do not see colored bars on the left side of the editor, you may need to turn on showing source control changes from Xcode’s Source Control preferences.

Xcode10SourceControlPreferences

Make sure the Show Source Control changes checkbox is selected. Select the Include upstream changes checkbox to see upstream changes in the editor.


Xcode 10: Improved Bitbucket and GitLab support

September 20th, 2018

Filed under: Version Control, Xcode | Be the first to comment!

Xcode 10 improves version control support for Bitbucket and GitLab. You can add your Bitbucket and GitLab accounts to Xcode from Xcode’s Accounts preferences.

XcodeAccountsPreferencesHighlighted

Click the Add button to add an account. A sheet opens.

Xcode10AddBitbucketAccount

Choose Bitbucket Cloud to add your Bitbucket account. Choose GitLab.com to add your GitLab account.

Starting in Xcode 10 you can add your Xcode project to Bitbucket or GitLab from Xcode. Open the Source Control navigator by choosing View > Navigators > Show Source Control Navigator. Select the Remotes folder, control-click, and choose Create Remote. A sheet opens.

Xcode10AddBitbucketRepoHighlighted

Choose your account from the Account menu. Click the Create button to add your project to Bitbucket or GitLab.


Xcode 10: Library Moved to Toolbar

September 17th, 2018

Filed under: Xcode | Be the first to comment!

In Xcode 10 the Library, where you access things like code snippets and user interface elements, is no longer in the lower right portion of the project window. The button to access the Library has been moved to the right side of the toolbar, next to the buttons to show the various editors.

Xcode10LibraryButtonHighlighted

Click the Library button to open the Library in a separate window. Option-clicking the Library button keeps the window open, which helps a lot when you’re building your app’s user interface.

The specific library that opens depends on the file you’re currently viewing/editing. If you’re in a source code file, clicking the Library button will open the code snippets library. If you’re in a xib file or storyboard, clicking the Library button will open the object library that contains the UI elements.