{"id":888,"url":"https://github.com/olddonkey/ODUIThreadGuard","last_synced_at":"2025-07-30T19:33:05.882Z","repository":{"id":62449278,"uuid":"77204083","full_name":"olddonkey/ODUIThreadGuard","owner":"olddonkey","description":"A guard to help you check if you make UI changes not in main thread","archived":false,"fork":false,"pushed_at":"2017-06-06T00:46:19.000Z","size":752,"stargazers_count":682,"open_issues_count":2,"forks_count":24,"subscribers_count":8,"default_branch":"master","last_synced_at":"2024-12-01T22:03:39.829Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/olddonkey.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":"2016-12-23T06:38:51.000Z","updated_at":"2024-04-10T03:09:53.000Z","dependencies_parsed_at":"2022-11-01T23:17:30.953Z","dependency_job_id":null,"html_url":"https://github.com/olddonkey/ODUIThreadGuard","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olddonkey%2FODUIThreadGuard","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olddonkey%2FODUIThreadGuard/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olddonkey%2FODUIThreadGuard/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olddonkey%2FODUIThreadGuard/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/olddonkey","download_url":"https://codeload.github.com/olddonkey/ODUIThreadGuard/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228179013,"owners_count":17881123,"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":[],"created_at":"2024-01-05T20:15:33.960Z","updated_at":"2024-12-04T19:32:20.951Z","avatar_url":"https://github.com/olddonkey.png","language":"Swift","funding_links":[],"categories":["Code Quality","Swift"],"sub_categories":["Other free courses","Getting Started"],"readme":"# ODUIThreadGuard\n\u003eODUIThreadGuard is a guard to help check if you make UI changes not in main thread.\n\n\u003eAs Xcode 9 embedded this function into Xcode, there is no reason to maintain this project in the feature, Happy Coding.\n\n[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-brightgreen.svg)](https://github.com/Carthage/Carthage) \n![CocoaPods Support](https://img.shields.io/badge/Cocoapods-compatible-brightgreen.svg) \n![Swift Version](https://img.shields.io/badge/Swift-3.0-orange.svg) \n![License MIT](https://img.shields.io/badge/License-MIT-lightgrey.svg) \n\nODUIThreadGuard is a guard to help check if you make UI changes not in main thread.\nHighly recommend you add this file to your project as early as possible.\n\n![ScreenShot](DemoScreenShot.jpeg)\n\n## Features\n\n- [x] Passive implementation\n- [x] Throw an assertion if setNeedsDisplay, setNeedsLayout, or setNeedsDisplayInRect: is called for instantiation of any UIView\n- [x] Get the thread stack to help you locate where you make the mistake\n\n\n## Usage\n\nNo matter which way you use ODUIThreadGuard, no need to import any files, it is a extension of UIView, so it will work automatically.\n\n#### CocoaPods\nYou can use [CocoaPods](http://cocoapods.org/) to install `ODUIThreadGuard` by adding it to your `Podfile`:\n\n```ruby\nplatform :ios, '8.0'\nuse_frameworks!\npod 'ODUIThreadGuard'\n```\n\nThen drop ODUIThreadGuard.swift into your porject.\n\n#### Carthage\nCreate a `Cartfile` that lists the framework and run `carthage update`. Follow the [instructions](https://github.com/Carthage/Carthage#if-youre-building-for-ios) to add `$(SRCROOT)/Carthage/Build/iOS/YourLibrary.framework` to an iOS project.\n\n```\ngithub \"olddonkey/ODUIThreadGuard\"\n```\n#### Manually\n1. Download and drop ```ODUIThreadGuard.swift``` in your project.  \n2. Congratulations!  \n\nYou can change the pre compile flag to change the setting, in default, this only runs in DEBUG mode, so won't affect users in Release.\n\n## Requirements\n\n- iOS 8.0+\n- Swift 3\n\nThe main development of ODUIThreadGuard is based on Swift 3.\n\n### Contact\n\nFollow and contact me through email: olddonkeyblog@gmail.com. If you find an issue, just [open a ticket](https://github.com/olddonkey/ODUIThreadGuard/issues/new) on it. Pull requests are warmly welcome as well.\n\n### License\n\nODUIThreadGuard is released under the MIT license. See LICENSE for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Folddonkey%2FODUIThreadGuard","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Folddonkey%2FODUIThreadGuard","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Folddonkey%2FODUIThreadGuard/lists"}