{"id":15037874,"url":"https://github.com/jharsh1202/xylophone-ios","last_synced_at":"2026-02-01T01:02:22.520Z","repository":{"id":186285451,"uuid":"367691428","full_name":"jharsh1202/Xylophone-iOS","owner":"jharsh1202","description":"Musical instrument! A xylophone.","archived":false,"fork":false,"pushed_at":"2021-06-22T04:18:06.000Z","size":3518,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-13T13:13:42.928Z","etag":null,"topics":["apple-documentation","avfoundation","beginner","ios","ios-app","ios-swift","ios14","iosapp","iosdevelopment","swift","swift4","swift5","uikit","xylophone"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jharsh1202.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-05-15T17:25:05.000Z","updated_at":"2023-07-04T10:39:02.000Z","dependencies_parsed_at":null,"dependency_job_id":"3b7fd07e-7f99-4d34-9bf1-dda599810e88","html_url":"https://github.com/jharsh1202/Xylophone-iOS","commit_stats":null,"previous_names":["jharsh1202/xylophone-ios"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jharsh1202%2FXylophone-iOS","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jharsh1202%2FXylophone-iOS/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jharsh1202%2FXylophone-iOS/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jharsh1202%2FXylophone-iOS/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jharsh1202","download_url":"https://codeload.github.com/jharsh1202/Xylophone-iOS/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jharsh1202%2FXylophone-iOS/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259088508,"owners_count":22803651,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["apple-documentation","avfoundation","beginner","ios","ios-app","ios-swift","ios14","iosapp","iosdevelopment","swift","swift4","swift5","uikit","xylophone"],"created_at":"2024-09-24T20:36:10.399Z","updated_at":"2026-02-01T01:02:22.471Z","avatar_url":"https://github.com/jharsh1202.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Xylophone\n\n## Our Goal\n\nThe goal of this tutorial is to dive into a simple iOS recipe - how to play sound and use an Apple library called AVFoundation.\n\n## What you will create\n\nYou will be making your first musical instrument! A xylphone.\n\n## What you will learn\n\n* How to play sound using AVFoundation and AVAudioPlayer.\n* Understand Apple documentation and how to use StackOverflow.\n* Functions and methods in Swift. \n* Data types.\n* Swift loops.\n* Variable scope.\n* The ViewController lifecycle.\n* Error handling in Swift.\n* Code refactoring.\n* Basic debugging.\n\n## Replacement Code\n\n```\nimport UIKit\nimport AVFoundation\n\nclass ViewController: UIViewController {\n    \n    var player: AVAudioPlayer!\n\n    override func viewDidLoad() {\n        super.viewDidLoad()\n    }\n\n    @IBAction func keyPressed(_ sender: UIButton) {\n        playSound()\n    }\n    \n    func playSound() {\n        let url = Bundle.main.url(forResource: \"C\", withExtension: \"wav\")\n        player = try! AVAudioPlayer(contentsOf: url!)\n        player.play()\n                \n    }\n}\n```\n\n# Xylophone\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjharsh1202%2Fxylophone-ios","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjharsh1202%2Fxylophone-ios","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjharsh1202%2Fxylophone-ios/lists"}