{"id":18271413,"url":"https://github.com/andreyvit/SoloComponents-iOS","last_synced_at":"2025-04-05T01:31:33.649Z","repository":{"id":1359937,"uuid":"1308518","full_name":"andreyvit/SoloComponents-iOS","owner":"andreyvit","description":"Self-contained, two-file (.h/.m) iPhone/iPad components that are dead-easy to drop into your projects","archived":false,"fork":false,"pushed_at":"2012-01-05T16:16:35.000Z","size":1019,"stargazers_count":566,"open_issues_count":13,"forks_count":69,"subscribers_count":20,"default_branch":"master","last_synced_at":"2025-03-29T23:08:57.349Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Objective-C","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/andreyvit.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}},"created_at":"2011-01-30T09:53:45.000Z","updated_at":"2024-12-18T11:57:34.000Z","dependencies_parsed_at":"2022-07-29T10:39:46.330Z","dependency_job_id":null,"html_url":"https://github.com/andreyvit/SoloComponents-iOS","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andreyvit%2FSoloComponents-iOS","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andreyvit%2FSoloComponents-iOS/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andreyvit%2FSoloComponents-iOS/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andreyvit%2FSoloComponents-iOS/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andreyvit","download_url":"https://codeload.github.com/andreyvit/SoloComponents-iOS/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247276043,"owners_count":20912286,"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-05T11:39:17.509Z","updated_at":"2025-04-05T01:31:28.805Z","avatar_url":"https://github.com/andreyvit.png","language":"Objective-C","readme":"Self-Contained Components for iOS\n=================================\n\nTwo-file (.h / .m) useful components and utility classes that are dead-easy to drop into your iOS projects.\n\nLicense: MIT (free for any use, no attribution required).\n\nFollow us on twitter: [@SoloComponents](http://twitter.com/SoloComponents/).\n\nNote: I want to collect as many open-source components as possible,\nnot just publish my own ones. If you have a useful iOS class that does\nnot depend on anything, feel free to fork, add and send me a pull\nrequest!\n\n\nATPagingView\n------------\n\nATPagingView is a wrapper around UIScrollView in (horizontal) paging\nmode, with an API similar to UITableView.\n\nStatus: production-ready, used by at least one App Store app.\n\nYou provide the page views by implementing two delegate methods:\n\n    - (NSInteger)numberOfPagesInPagingView:(ATPagingView *)pagingView {\n        return 10;\n    }\n\n    - (UIView *)viewForPageInPagingView:(ATPagingView *)pagingView atIndex:(NSInteger)index {\n        UIView *view = [pagingView dequeueReusablePage];\n        if (view == nil) {\n            view = [[[DemoPageView alloc] init] autorelease];\n        }\n        return view;\n    }\n\nYou are also notified when the user navigates between pages:\n\n    - (void)currentPageDidChangeInPagingView:(ATPagingView *)pagingView {\n        self.navigationItem.title = [NSString stringWithFormat:@\"%d of %d\", pagingView.currentPageIndex+1, pagingView.pageCount];\n    }\n\nYou can use ATPagingView directly or derive your view controller from\nATPagingViewController.\n\nATPagingViewController is similar to UITableViewController and:\n\n* defines `loadView` to create ATPagingView automatically,\n* sets itself as a delegate of ATPagingView,\n* calls `reloadData` in `viewWillAppear:` if the paging view is empty,\n* additionally it forwards orientation events to the paging view (see below).\n\nIf you want to use ATPagingView without ATPagingViewController, you\nneed to:\n\n* provide your delegate object using the `delegate` property,\n* call `reloadData` to populate the view,\n* if you want to support rotation, you need to invoke\n  `willAnimateRotation` and `didRotate` methods from your view\n  controller:\n\n      - (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration {\n          [self.pagingView willAnimateRotation];\n      }\n\n      - (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation {\n          [self.pagingView didRotate];\n      }\n\n\nATArrayView\n-----------\n\nA container that arranges its items in rows and columns similar to the\nthumbnails screen in Photos.app, the API is modeled after UITableView.\n\nStatus: beta.\n\nEnjoy the familiar delegate methods:\n\n    - (NSInteger)numberOfItemsInArrayView:(ATArrayView *)arrayView {\n        return 97;\n    }\n\n    - (UIView *)viewForItemInArrayView:(ATArrayView *)arrayView atIndex:(NSInteger)index {\n        DemoItemView *itemView = (DemoItemView *) [arrayView dequeueReusableItem];\n        if (itemView == nil) {\n            itemView = [[[DemoItemView alloc] init] autorelease];\n        }\n        return itemView;\n    }\n\nThere's ATArrayViewController which further reduces the amount of\nboilerplate code you have to write. Similar to UITableViewController,\nit:\n\n* overrides `loadView` to create ATArrayView automatically,\n* sets itself as a delegate of the array view,\n* calls `reloadData` in `viewWillAppear:` if the array view is empty.\n\n\nATByteImage\n-----------\n\nAllows to easily use an image (CGImageRef) backed by a malloc'ed chunk\nof memory. This means you can read or manipulate image bytes directly.\n\nStatus: ready for production use.\n\nUsing ATByteImage:\n\n    ATByteImage *blurred = [[ATByteImage alloc] initWithSize:blurredSize];\n    [blurred clear];\n\n    ATByteImageContext *blurredContext = [blurred newContext];\n    CGContextSetBlendMode(blurredContext.CGContext, kCGBlendModeNormal);\n    ... draw using blurredContext.CGContext ...\n    [blurredContext release];\n\n      UIImage *myOverlay = [blurred extractImage];\n\nHere's another example. The following function is useful in background\nimage loading code:\n\n    // Returns an uncompressed (decoded) UIImage, optimized for drawing speed.\n    //\n    // This is a middle ground between [UIImage imageNamed:] and a plain\n    // [UIImage imageWithContentsOfFile:], as follows:\n    //\n    // * [UIImage imageWithContentsOfFile:] loads image data from disk and\n    //   decodes it each time you display the image.\n    //\n    //   If you are using CATiledLayer to display a large image (and you should,\n    //   since UIImageView is not recommended for images bigger than ~1024x1024),\n    //   the whole JPEG will decoded for EACH tile you display.\n    //\n    // * [UIImage imageNamed:@\"xxx\"] only ever decodes the image once, just as you\n    //   wanted. However it also caches the image and seems to sometimes (always?)\n    //   not release the data even after you release your UIImage.\n    //\n    //   An app that loads several large images via 'imageNamed' will thus crash\n    //   quite soon with unfamous \"error 0\".\n    //\n    //   Another undesired quality of 'imageNamed' is that the image is loaded and\n    //   decoded when it is displayed for the first time, which means you can't\n    //   really do the decoding in a background thread.\n    //\n    // * DecompressUIImage([UIImage imageWithContentsOfFile:@\"xx.jpg\"]) is the\n    //   sweet spot between the two — it returns a fully decoded image which can\n    //   be displayed quickly, and memory management is entirely up to you.\n    //\n    UIImage *DecompressUIImage(UIImage *image) {\n        ATByteImage *byteImage = [[[ATByteImage alloc] initWithImage:image] autorelease];\n        return [byteImage extractImage];\n    }\n\n","funding_links":[],"categories":["etc"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandreyvit%2FSoloComponents-iOS","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandreyvit%2FSoloComponents-iOS","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandreyvit%2FSoloComponents-iOS/lists"}