---
title: Hiding Code from a Playground Page
framework: Swift Playgrounds
role: article
role_heading: Article
path: swift-playgrounds/hiding-code-from-a-playground-page
---

# Hiding Code from a Playground Page

Use special Swift comments to hide code from display but continue to run it.

## Overview

Overview You can hide code that’s unrelated to the main content of a playground page, like calls to page setup functions, code for assessing the learner’s progress, and functions in editable examples. Hidden code is still executed when the learner runs the playground. Place code you want to hide between the hidden-code and end-hidden-code delimiters.

The following shows the raw syntax for a playground page with hidden code. //#-hidden-code import UIKit import PlaygroundSupport let viewRect = CGRect(x: 0, y: 0, width: 100 , height: 400) let theView = CustomView(frame: viewRect) PlaygroundPage.current.liveView = theView //#-end-hidden-code //#-editable-code theView.markColor = UIColor.darkGray theView.isChecked = true //#-end-editable-code The following shows how the previous code appears when it’s rendered in the playground page source editor. theView.markColor = UIColor.darkGray theView.isChecked = true

## See Also

### Annotations

- [Writing Prose for a Playground Page](swift-playgrounds/writing-prose-for-a-playground-page.md)
- [Specifying Editable Regions in a Playground Page](swift-playgrounds/specifying-editable-regions-in-a-playground-page.md)
- [Customizing the Completions in the Shortcut Bar](swift-playgrounds/customizing-the-completions-in-the-shortcut-bar.md)
- [Localizing Code Comments and String Literals](swift-playgrounds/localizing-code-comments-and-string-literals.md)
