{"id":16061240,"url":"https://github.com/krzyzanowskim/sttextkitplus","last_synced_at":"2025-03-18T05:30:33.463Z","repository":{"id":201218460,"uuid":"707182538","full_name":"krzyzanowskim/STTextKitPlus","owner":"krzyzanowskim","description":"Collection of TextKit 2 helpers used to build STTextView.","archived":false,"fork":false,"pushed_at":"2024-04-06T11:40:26.000Z","size":24,"stargazers_count":15,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-04-14T07:11:18.713Z","etag":null,"topics":["sttextview","textkit","textkit2"],"latest_commit_sha":null,"homepage":"https://github.com/krzyzanowskim/STTextView","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/krzyzanowskim.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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}},"created_at":"2023-10-19T11:39:24.000Z","updated_at":"2024-04-06T12:54:04.000Z","dependencies_parsed_at":"2024-04-12T10:07:51.270Z","dependency_job_id":null,"html_url":"https://github.com/krzyzanowskim/STTextKitPlus","commit_stats":{"total_commits":5,"total_committers":1,"mean_commits":5.0,"dds":0.0,"last_synced_commit":"a57a2081e364c71b11e521ed8800481e8da300ac"},"previous_names":["krzyzanowskim/sttextkitplus"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krzyzanowskim%2FSTTextKitPlus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krzyzanowskim%2FSTTextKitPlus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krzyzanowskim%2FSTTextKitPlus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krzyzanowskim%2FSTTextKitPlus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/krzyzanowskim","download_url":"https://codeload.github.com/krzyzanowskim/STTextKitPlus/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244164546,"owners_count":20408952,"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":["sttextview","textkit","textkit2"],"created_at":"2024-10-09T04:08:17.506Z","updated_at":"2025-03-18T05:30:33.003Z","avatar_url":"https://github.com/krzyzanowskim.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Collection of useful [TextKit 2](https://developer.apple.com/documentation/appkit/textkit) helpers.\n\nCollection of TextKit 2 helpers used to build [STTextView](https://github.com/krzyzanowskim/STTextView).\n\n## Usage\n\n### NSRange Additions\n\n```swift\nNSRange.notFound\nNSRange.isEmpty\nNSRange.nsValue\n\nNSRange(_ textRange: NSTextRange, in textContentManager: NSTextContentManager)\nNSRange(_ textLocation: NSTextLocation, in textContentManager: NSTextContentManager)\n``` \n\n### NSTextRange Additions\n\n```swift\nNSTextRange(_ nsRange: NSRange, in textContentManager: NSTextContentManager)\n\nfunc length(in textContentManager: NSTextContentManager) -\u003e Int\nfunc clamped(to textRange: NSTextRange) -\u003e NSTextRange?\n```\n\n### NSTextContentManager Additions\n\n```swift\nfunc location(at offset: Int) -\u003e NSTextLocation?\nfunc location(line lineIdx: Int, character characterIdx: Int? = 0) -\u003e NSTextLocation?\n\nfunc position(_ location: NSTextLocation) -\u003e (row: Int, column: Int)?\n\nfunc attributedString(in range: NSTextRange?) -\u003e NSAttributedString?\n```\n\n### NSTextLayoutManager Additions\n\n```swift\nfunc textLineFragment(at location: NSTextLocation) -\u003e NSTextLineFragment?\nfunc textLineFragment(at point: CGPoint) -\u003e NSTextLineFragment?\n\nfunc extraLineTextLayoutFragment() -\u003e NSTextLayoutFragment?\nfunc extraLineTextLineFragment() -\u003e NSTextLineFragment?\n\nfunc location(interactingAt point: CGPoint, inContainerAt containerLocation: NSTextLocation) -\u003e NSTextLocation?\n\nfunc textSegmentFrame(at location: NSTextLocation, type: NSTextLayoutManager.SegmentType, options: SegmentOptions = [.upstreamAffinity]) -\u003e CGRect?\nfunc textSegmentFrame(in textRange: NSTextRange, type: NSTextLayoutManager.SegmentType, options: SegmentOptions = [.upstreamAffinity, .rangeNotRequired]) -\u003e CGRect?\n\nfunc typographicBounds(in textRange: NSTextRange) -\u003e CGRect?\n\nfunc enumerateTextLayoutFragments(in range: NSTextRange, options: NSTextLayoutFragment.EnumerationOptions = [], using block: (NSTextLayoutFragment) -\u003e Bool) -\u003e NSTextLocation?\n\nvar insertionPointLocations: [NSTextLocation]\nvar insertionPointSelections: [NSTextSelection]\n```\n\n### NSTextLayoutFragment Additions\n\n```swift\nvar isExtraLineFragment: Bool\n\nfunc textLineFragment(at location: NSTextLocation, in textContentManager: NSTextContentManager? = nil) -\u003e NSTextLineFragment?\nfunc textLineFragment(at location: CGPoint, in textContentManager: NSTextContentManager? = nil) -\u003e NSTextLineFragment?\n```\n\n### NSTextLineFragment Additions\n\n```swift\ntextRange(in textLayoutFragment: NSTextLayoutFragment) -\u003e NSTextRange?\n\nvar isExtraLineFragment: Bool\n```\n\n### NSTextLocation Addition\n\n```swift\nstatic func == (lhs: Self, rhs: Self) -\u003e Bool\nstatic func != (lhs: Self, rhs: Self) -\u003e Bool\nstatic func \u003c (lhs: Self, rhs: Self) -\u003e Bool\nstatic func \u003c= (lhs: Self, rhs: Self) -\u003e Bool\nstatic func \u003e (lhs: Self, rhs: Self) -\u003e Bool\nstatic func \u003e= (lhs: Self, rhs: Self) -\u003e Bool\nstatic func ~= (lhs: Self, rhs: Self) -\u003e Bool\n```\n\n## Contributing and Collaboration\n\nI'd love to hear from you! Get in touch via an issue or pull request.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkrzyzanowskim%2Fsttextkitplus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkrzyzanowskim%2Fsttextkitplus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkrzyzanowskim%2Fsttextkitplus/lists"}