What’s new in Xcode10 for developers

xcode 10, interview, iOS , iOS app interview

What’s new in Xcode10 for developers

xcode 10, interview, iOS , iOS app interview

Have you been wondering what happened to the object/media library since you migrated to Xcode 10? Is the object browser annoying you by disappearing every time you use it? Interviewers are really excited to ask about Xcode 10 changes to you, Here are some quick Xcode 10 library tips to restore your calm.

In a nutshell:

  1. Dark mode
  2. Object library & Snippet library
  3. Editor Over-scroll
  4. Change highlighting
  5. Code folding ribbon
  6. Multiple cursor
  7. Source Control Integration with bitbucket, Gitlab (last year GitHub)
  8. Playgrounds Built for Machine Learning
  9. Parallel Testing: XCTest and XCUITest
  10. Xcode 10 new legacy build system

Lets start one by one and try to understand and remember these points.

1. Dark Mode Interface and Mac App Support

The Dark Mode is only available on macOS 10.14 Mojave.

Go to System Preferences > Generaland change the Appearance.

Dark mode

2. Object Library & Snippet Library

The new button is context-sensitive, so you’ll notice you can’t access code snippets when in Interface Builder, and you can’t access the Objects library when you’re in the text editor.

When using Interface Builder, you get a button that opens the object browser:

Object library button

In the source editor you get a button that opens the snippet editor:

Snippet library button

3. Editor Over-scroll

Over-scroll makes it easy to center the last lines of code in the middle of your screen.This feature provides simply extra space by default bottom the last code line inside the code editor and making last line at centre.

Over-scroll feature

4. Change highlighting

Changes in the local repository or upstream on a shared server are highlighted directly within the editor. At a glance, you’ll see:

  • Changes made in your code.
  • Changes not yet pushed to the shared repository.
  • Upstream changes others have made.
  • Conflicts you should address before committing.

5. Code folding ribbon

Code folding ribbon can now hide any code block surrounded by braces.

To enable it, open preferences under Text Editing > Editing and select Code folding ribbon.

6. Multiple cursor

Place multiple cursors in your code editor to make many changes at once.

To edit multiple instances of text within different sections of a document, you can use multi-cursor editing. This allows multiple cursors to be placed in different spots so text can be added, modified, or deleted.

The Xcode 10 Source Editor now supports multi-cursor editing allowing you to quickly edit multiple ranges of code at once.
  • shift + control + click
  • shift + control + ↑
  • shift + control + ↓
  • option + drag

Changing from main to global on dispatch queue on multiple lines

before changing:Multiple cursor
after changing: Multiple cursor

7. Source Control Integration with bitbucket, Gitlab (last year GitHub)

In addition to any default Git server Enhanced support for popular services

  • GitHub
  • Bitbucket
  • GitLab.com

Including self-hosted and enterprise versions

8.Playgrounds Built for Machine Learning

You can create your own models on Mac using Create ML and playgrounds in Xcode 10.

  • New REPL-like model reruns your existing playground code instantly.
  • Run your code up to any specific line, or type shift-return to run the code you just added.
  • Import the Create ML framework to interactively train new models, and then write code to test the model right in the playground. When finished, drag the model into your app.
Reference: developer.apple.com

9. Parallel Testing: XCTest and XCUITest

Xcode will spawn a collection of identical Simulators to take advantage of your multi-core Mac, and fan tests out to run in parallel, completing your test suite many times faster.

10. Xcode 10 new legacy build system

The new build system provides improved reliability and build performance, and it catches project configuration problems that the legacy build system does not. The legacy build system is still available in Xcode 10. To use the legacy build system, select it in the File > Project/Workspace Settings sheet.

Image result for Xcode 10 new legacy build system

References:

  1. https://developer.apple.com/xcode/whats-new/
  2. https://stackoverflow.com/questions/50696995/multi-cursor-editing-in-xcode-10
  3. https://developer.apple.com/machine-learning/