{"id":2738,"url":"https://github.com/tdscientist/ShelfView-iOS","last_synced_at":"2025-08-06T16:31:49.503Z","repository":{"id":62455281,"uuid":"104583433","full_name":"tdscientist/ShelfView-iOS","owner":"tdscientist","description":"iOS custom view to display books on shelf","archived":false,"fork":false,"pushed_at":"2019-01-01T02:06:13.000Z","size":3819,"stargazers_count":268,"open_issues_count":0,"forks_count":31,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-07-20T09:39:15.555Z","etag":null,"topics":["customview","shelf","shelfview"],"latest_commit_sha":null,"homepage":null,"language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tdscientist.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-09-23T16:51:56.000Z","updated_at":"2024-06-06T23:23:10.000Z","dependencies_parsed_at":"2022-11-01T23:33:42.147Z","dependency_job_id":null,"html_url":"https://github.com/tdscientist/ShelfView-iOS","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/tdscientist/ShelfView-iOS","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tdscientist%2FShelfView-iOS","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tdscientist%2FShelfView-iOS/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tdscientist%2FShelfView-iOS/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tdscientist%2FShelfView-iOS/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tdscientist","download_url":"https://codeload.github.com/tdscientist/ShelfView-iOS/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tdscientist%2FShelfView-iOS/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269112561,"owners_count":24361999,"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","status":"online","status_checked_at":"2025-08-06T02:00:09.910Z","response_time":99,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["customview","shelf","shelfview"],"created_at":"2024-01-05T20:16:21.533Z","updated_at":"2025-08-06T16:31:49.048Z","avatar_url":"https://github.com/tdscientist.png","language":"Swift","readme":"## ShelfView (iOS) ##\n\n*iOS custom view to display books on shelf* `     ` **([Android version is available here](https://github.com/tdscientist/ShelfView))** \n\n\u003cimg src=\"iphone.png\" width=\"300\"\u003e \u003cimg src=\"ipad.png\" width=\"565\"\u003e\n\nRequirements\n--------\n\n* iOS 10.0+\n* Swift 4.2\n\n\nInstallation\n--------\n\n`ShelfView` is available through [CocoaPods](https://cocoapods.org/). To install\nit, simply add the following line to your Podfile:\n\n```ruby\npod 'ShelfView'\n```\n\n\n**Note**\n--------\nBecause of book covers whose URLs are `http`, update your `info.plist` as follows:\n\n* add `App Transport Security Settings` to the list\n* add `Allow Arbitrary Loads` to the security settings added above; set it to `YES`.\n\n\u003cimg src=\"note.png\" width=\"550\"\u003e\n\nPlain Shelf\n--------\n\n```swift\nimport ShelfView\n\nclass PlainShelfController: UIViewController, PlainShelfViewDelegate {\n    var shelfView: PlainShelfView!\n\n    override func viewDidLoad() {\n        super.viewDidLoad()\n        \n        let books = [\n            BookModel(bookCoverSource: \"https://files.kerching.raywenderlich.com/covers/d5693015-46b6-44f8-bf7b-7a222b28d9fe.png\",\n                      bookId: \"0\",\n                      bookTitle: \"Realm: Building Modern Swift Apps with Realm\"),\n            BookModel(bookCoverSource: \"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTYEkCQ_wu8HoGJzzs_gUH_FVusgI2RhntBKQ-WkmqnDJZnriwY6Q\",\n                      bookId: \"1\",\n                      bookTitle: \"iOS 10 by Tutorials: Learning the new iOS APIs with Swift 3\")\n        ]        \n        \n        shelfView = PlainShelfView(frame: CGRect(x: 0, y: 0, width: 350, height: 500),\n                                   bookModel: books, bookSource: PlainShelfView.BOOK_SOURCE_URL)\n\n        shelfView.delegate = self\n        self.view.addSubview(shelfView)\n    }\n\n    func onBookClicked(_ shelfView: PlainShelfView, index: Int, bookId: String, bookTitle: String) {\n        print(\"I just clicked \\\"\\(bookTitle)\\\" with bookId \\(bookId), at index \\(index)\")\n    }\n\n}\n```\n\n\n\nSection Shelf\n--------\n\n```swift\nimport ShelfView\n\nclass SectionShelfController: UIViewController, SectionShelfViewDelegate {\n    var shelfView: SectionShelfView!\n\n    override func viewDidLoad() {\n        super.viewDidLoad()\n\n        let books = [\n            BookModel(bookCoverSource: \"https://files.kerching.raywenderlich.com/covers/d5693015-46b6-44f8-bf7b-7a222b28d9fe.png\",\n                      bookId: \"0\",\n                      bookTitle: \"Realm: Building Modern Swift Apps with Realm\"),\n            BookModel(bookCoverSource: \"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTYEkCQ_wu8HoGJzzs_gUH_FVusgI2RhntBKQ-WkmqnDJZnriwY6Q\",\n                      bookId: \"1\",\n                      bookTitle: \"iOS 10 by Tutorials: Learning the new iOS APIs with Swift 3\")\n        ]\n        let bookModelSectionArray = [BookModelSection(sectionName: \"RAYWENDERLICH\",\n                                                      sectionId: \"0\",\n                                                      sectionBooks: books)]\n\n        shelfView = SectionShelfView(frame: CGRect(x: 0, y: 0, width: 350, height: 500),\n                                     bookModelSection: bookModelSectionArray,\n                                     bookSource: SectionShelfView.BOOK_SOURCE_URL)\n\n        shelfView.delegate = self\n        self.view.addSubview(shelfView)\n    }\n\n    func onBookClicked(_ shelfView: SectionShelfView, section: Int, index: Int,\n                       sectionId: String, sectionTitle: String, bookId: String,\n                       bookTitle: String) {\n        print(\"I just clicked \\\"\\(bookTitle)\\\" with bookId \\(bookId), at index \\(index). Section details --\u003e section \\(section), sectionId \\(sectionId), sectionTitle \\(sectionTitle)\")\n    }\n\n}\n```\n\n**Add more books to ShelfView**\n* Plain Shelf\n```swift\naddBooks(bookModel: [BookModel])\n```\n* Section Shelf\n```swift\naddBooks(bookModelSection: [BookModelSection])\n```\n\n**Reload books on ShelfView**\n* Plain Shelf\n```swift\nreloadBooks(bookModel: [BookModel])\n```\n* Section Shelf\n```swift\nreloadBooks(bookModelSection: [BookModelSection])\n```\n\n\n\n**Loading book covers from other sources**\n\n* iPhone/iPad document directory\n\n```swift\nlet books = [\n    BookModel(bookCoverSource: \"bookcover0.png\", bookId: \"0\", bookTitle: \"Book Title 0\"),\n    BookModel(bookCoverSource: \"bookcover1.png\", bookId: \"1\", bookTitle: \"Book Title 1\")\n        ]\nshelfView = PlainShelfView(frame: CGRect(x: 0, y: 0, width: 350, height: 500),\n                           bookModel: books, bookSource: PlainShelfView.BOOK_SOURCE_DEVICE_DOCUMENTS)\n``` \n\n\n\n* iPhone/iPad library directory\n\n```swift\nlet books = [\n    BookModel(bookCoverSource: \"bookcover0.png\", bookId: \"0\", bookTitle: \"Book Title 0\"),\n    BookModel(bookCoverSource: \"bookcover1.png\", bookId: \"1\", bookTitle: \"Book Title 1\")\n        ]\nshelfView = PlainShelfView(frame: CGRect(x: 0, y: 0, width: 350, height: 500),\n                           bookModel: books, bookSource: PlainShelfView.BOOK_SOURCE_DEVICE_LIBRARY)\n```\n\n* iPhone/iPad cache directory\n\n```swift\nlet books = [\n    BookModel(bookCoverSource: \"bookcover0.png\", bookId: \"0\", bookTitle: \"Book Title 0\"),\n    BookModel(bookCoverSource: \"bookcover1.png\", bookId: \"1\", bookTitle: \"Book Title 1\")\n        ]\nshelfView = PlainShelfView(frame: CGRect(x: 0, y: 0, width: 350, height: 500),\n                           bookModel: books, bookSource: PlainShelfView.BOOK_SOURCE_DEVICE_CACHE)\n``` \n\n* Directly from your project's source code\n\n```swift\nlet books = [\n    BookModel(bookCoverSource: \"bookcover0.png\", bookId: \"0\", bookTitle: \"Book Title 0\"),\n    BookModel(bookCoverSource: \"bookcover1.png\", bookId: \"1\", bookTitle: \"Book Title 1\")\n        ]\nshelfView = PlainShelfView(frame: CGRect(x: 0, y: 0, width: 350, height: 500),\n                           bookModel: books, bookSource: PlainShelfView.BOOK_SOURCE_RAW)\n``` \n\n\nLicense\n--------\n\n`ShelfView` is available under the MIT license. See the LICENSE file for more info.\n\nAuthor\n--------\n\nAdeyinka Adediji _(tdscientist@gmail.com)_\n\n\nContributions \u0026 Bug Reporting\n--------\n\ntdscientist@gmail.com \n\nCredits \n--------\n\n* [Kingfisher](https://github.com/onevcat/Kingfisher)\n\n","funding_links":[],"categories":["UI","Libs","CollectionView","UI [🔝](#readme)"],"sub_categories":["ScrollView","UI","Other free courses"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftdscientist%2FShelfView-iOS","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftdscientist%2FShelfView-iOS","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftdscientist%2FShelfView-iOS/lists"}