{"id":20440364,"url":"https://github.com/smakeev/someinnerview","last_synced_at":"2025-04-12T23:09:41.883Z","repository":{"id":62455789,"uuid":"247320536","full_name":"smakeev/SomeInnerView","owner":"smakeev","description":null,"archived":false,"fork":false,"pushed_at":"2020-03-21T12:13:31.000Z","size":35428,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-26T17:11:21.273Z","etag":null,"topics":[],"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/smakeev.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":"2020-03-14T17:18:47.000Z","updated_at":"2020-11-25T12:22:54.000Z","dependencies_parsed_at":"2022-11-02T00:16:45.641Z","dependency_job_id":null,"html_url":"https://github.com/smakeev/SomeInnerView","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smakeev%2FSomeInnerView","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smakeev%2FSomeInnerView/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smakeev%2FSomeInnerView/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smakeev%2FSomeInnerView/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/smakeev","download_url":"https://codeload.github.com/smakeev/SomeInnerView/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248643004,"owners_count":21138355,"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-11-15T09:23:50.958Z","updated_at":"2025-04-12T23:09:41.851Z","avatar_url":"https://github.com/smakeev.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SomeInnerView\n![Farmers Market Finder Demo](demo/demo.gif)\n\nSimeInnerView is a UIView allows you to select a part of an image using a part of another image.\nAs in example this could be the same image.\nIn example I jus added blur effect view above the background image and when the selection part is an image without any effects.\nThe resalt of a selection is stored in properties x, y, right, bottom.\nThey present rectangle of coordinates (from 0 to 1) \n\n```swift\n\t\tinnerView = InnerView()\n\t\tinnerView.backgroundColor = .black\n\t\tinnerView.translatesAutoresizingMaskIntoConstraints = false\n\t\tself.view.addSubview(innerView)\n\t\tinnerView.leadingAnchor.constraint (equalTo: self.view.leadingAnchor).isActive  = true\n\t\tinnerView.trailingAnchor.constraint(equalTo: self.view.trailingAnchor).isActive = true\n\t\tinnerView.topAnchor.constraint(equalTo: self.view.topAnchor).isActive           = true\n\t\tinnerView.bottomAnchor.constraint(equalTo: self.view.bottomAnchor).isActive     = true\n\t\t\n\t\tguard let sourceImage = UIImage(named: \"image\") else { return }\n\t\n\n\t\tinnerView.mainImage = sourceImage\n\t\tinnerView.background.backgroundColor = .red\n\t\t\n\t\tlet blurEffect = UIBlurEffect(style: UIBlurEffect.Style.dark)\n\t\tlet blurEffectView = UIVisualEffectView(effect: blurEffect)\n\t\t\n\t\tblurEffectView.translatesAutoresizingMaskIntoConstraints = false\n\t\tinnerView.background.addSubview(blurEffectView)\n\t\t\n\t\tblurEffectView.leadingAnchor.constraint(equalTo: innerView.background.leadingAnchor).isActive = true\n\t\tblurEffectView.trailingAnchor.constraint(equalTo: innerView.background.trailingAnchor).isActive = true\n\t\tblurEffectView.topAnchor.constraint(equalTo: innerView.background.topAnchor).isActive = true\n\t\tblurEffectView.bottomAnchor.constraint(equalTo: innerView.background.bottomAnchor).isActive = true\n\t\t\n\t\t\n\t\tinnerView.selectionView.backgroundColor = .white\n\t\tinnerView.secondaryImage = sourceImage\n\t\n\t\tinnerView.x = 0.25\n\t\tinnerView.y = 0.25\n\t\tinnerView.bottom = 0.7\n\t\tinnerView.right  = 0.7\n\t\tinnerView.isSelectionInitialized = true\n\t\t\n\t\tinnerView.selectionView.layer.cornerRadius = 45\n\t\tinnerView.selectionView.layer.masksToBounds = true\n```\n\nTo show the selection view you need to set some visible rectangle and call\n```swift\n  innerView.isSelectionInitialized = true\n```\nsetting this to false will hide the selection view\n\nYou may move the selection by setting properties x, y, bottom, right.\nTo allow user interaction with selection view:\n```swift\n  innerView.selectionView.isUserInteractionEnabled = true\n```\n\nto fix the selection view on part of an image\n```swift\ninnerView.isSelectionFixed = true\n```\n\n# How to use:\n```\npod \"SomeInnerView\"\t\n```\n\n```swift\nimport SomeInnerView\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmakeev%2Fsomeinnerview","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsmakeev%2Fsomeinnerview","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmakeev%2Fsomeinnerview/lists"}