# Swift program to get all keys and values of a dictionary Swift dictionary is used to hold key-value pairs. Using a key, we can get the value of a specific dictionary key-value pair. Similarly, we can also modify or delete dictionary values using its key.

This tutorial will show you how to get all keys and values of a swift dictionary. Swift dictionary provides two instance properties keys and values that returns a collection containing all keys or values.

## keys :

This instance property is defined as below :

``var keys: Dictionary<Key, Value>.Keys { get }``

It returns one collection containing all the keys of the dictionary.

### Example :

``````var given_dict = ["one": 1, "two": 2, "three": 3]

print(given_dict.keys)``````

It will print :

``["two", "one", "three"]``

## values :

This instance property is defined as below :

``var values: Dictionary<Key, Value>.Values { get set }``

It returns one collection containing all the values of the dictionary.

### Example :

``````var given_dict = ["one": 1, "two": 2, "three": 3]

print(given_dict.values)``````

It will print:

``[1, 3, 2]``
{"ft_lang_label":"__label__en","ft_lang_prob":0.61367404,"math_prob":0.96172917,"size":981,"snap":"2022-27-2022-33","text_gpt3_token_len":232,"char_repetition_ratio":0.14943705,"word_repetition_ratio":0.25316456,"special_character_ratio":0.25993884,"punctuation_ratio":0.1969697,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9536663,"pos_list":[0,1,2],"im_url_duplicate_count":[null,null,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2022-08-17T13:08:24Z\",\"WARC-Record-ID\":\"<urn:uuid:002d0f73-8f53-492d-a967-d298b1f6d5a7>\",\"Content-Length\":\"73991\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:b909b692-57e3-438b-8e00-8d16adb9dd46>\",\"WARC-Concurrent-To\":\"<urn:uuid:828f5e17-9521-49d8-b373-d5388f8bf79c>\",\"WARC-IP-Address\":\"18.232.245.187\",\"WARC-Target-URI\":\"https://www.codevscolor.com/swift-get-all-key-value-of-dictionary\",\"WARC-Payload-Digest\":\"sha1:WGBAETXDBOLZP27YKREQ4GWFCX733LCW\",\"WARC-Block-Digest\":\"sha1:SRGX6Z6IUZ2BYMHCI4PMLPGKYM2UPKR3\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2022/CC-MAIN-2022-33/CC-MAIN-2022-33_segments_1659882572908.71_warc_CC-MAIN-20220817122626-20220817152626-00795.warc.gz\"}"}