{"id":18463919,"url":"https://github.com/badchoice/rvcalendarweekview","last_synced_at":"2025-04-08T08:30:51.147Z","repository":{"id":62452250,"uuid":"66301602","full_name":"BadChoice/RVCalendarWeekView","owner":"BadChoice","description":"Simple but powerful Calendar Week View for iOS ","archived":false,"fork":false,"pushed_at":"2019-05-06T14:22:44.000Z","size":3632,"stargazers_count":101,"open_issues_count":20,"forks_count":24,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-03-23T08:51:12.458Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Objective-C","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/BadChoice.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-08-22T19:24:10.000Z","updated_at":"2024-06-12T08:48:33.000Z","dependencies_parsed_at":"2022-11-01T23:45:47.510Z","dependency_job_id":null,"html_url":"https://github.com/BadChoice/RVCalendarWeekView","commit_stats":null,"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BadChoice%2FRVCalendarWeekView","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BadChoice%2FRVCalendarWeekView/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BadChoice%2FRVCalendarWeekView/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BadChoice%2FRVCalendarWeekView/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BadChoice","download_url":"https://codeload.github.com/BadChoice/RVCalendarWeekView/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247804303,"owners_count":20998943,"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-06T09:08:22.016Z","updated_at":"2025-04-08T08:30:50.511Z","avatar_url":"https://github.com/BadChoice.png","language":"Objective-C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RVCalendarWeekView\nSimple but powerful Calendar Week View for iOS With dragable events, infinte scroll and pinchable hours size\n\n\nFollowing the work from [MSCollectionView](https://github.com/erichoracek/MSCollectionViewCalendarLayout)\n\nI created this library simplifing its usage and adding some interesting features\n\n### Installation\n\n`pod 'RVCalendarWeekView'`\n\nor just copy the files inside the `lib` folder by now\n\n\n### Usage\nyou can now use storyboard to create a simple UIView extending the MSWeekView and then just do this:\n\n\n```\n    -(void)viewDidLoad{\n        MSEvent* event1 = [MSEvent make:NSDate.now\n        title:@\"Title\"\n        location:@\"Central perk\"];\n\n        MSEvent* event2 = [MSEvent make:[NSDate.now addMinutes:10]  //AddMinutes comes from EasyDate pod\n        duration:60*3\n        title:@\"Title 2\"\n        location:@\"Central perk\"];\n\n        _weekView.events = @[event1,event2];        \n    }\n```\n\nEasy right?\n\n### Features\nTo add features to the WeekView I'm using a decorator pattern, this way we can extend the `weekView` with diferent features without the need of multiple inhertance and to have a expressive modular design\nHowever, this adds the need to have a `strong` reference to the `decorator` that will hold the features.\n\nSo we can add features to the `weekView` with the following code:\n\n```\n    self.decoratedWeekView = [MSWeekViewDecoratorFactory make:self.weekView\n                                                     features:(MSDragableEventFeature|MSNewEventFeature|MSInfiniteFeature|MSChangeDurationFeature)\n                                                  andDelegate:self];\n```\n\nThis is the fast way where the delegate should have all the methods for each feature delegate (see below).\n\nThe long way is something more like the standard `decorator` pattern in case you need more flexibility.\n\n```\n    MSWeekView* decoratedView = baseView;\n    decoratedView = [MSWeekViewDecoratorInfinite makeWith:decoratedView andDelegate:infiniteDelegate];\n    decoratedView = [MSWeekViewDecoratorNewEvent makeWith:decoratedView andDelegate:newEventDelegate];\n    decoratedView = [MSWeekViewDecoratorDragable makeWith:decoratedView andDelegate:dragableDelegate];\n    decoratedView = [MSWeekViewDecoratorChangeDuration makeWith:decoratedView andDelegate:durationDelegate];\n\n```\n\nThere is a function to easily set the minutes precision to all decorators in case you need something diferent than the default 5 minutes.\n\n```\n    [MSWeekViewDecoratorFactory setMinutesPrecisionToAllDecorators:decoratedView minutesPrecision:15];\n```\n\n#### Drag and drop\nYou can get the feature to change the event duration with `MSDragableEventFeature`\n\nIt will fire the following functions on your `dragDelegate`\n\n``` \n    -(BOOL)weekView:(MSWeekView*)weekView canMoveEvent:(MSEvent*)event to:(NSDate*)date;\n\n    -(void)weekView:(MSWeekView*)weekView event:(MSEvent*)event moved:(NSDate*)date;\n\n```\n\n#### Change duration\nYou can get the feature to change the event duration with `MSChangeDurationFeature`\n\n```\n    -(BOOL)weekView:(MSWeekView*)weekView canChangeDuration:(MSEvent*)event startDate:(NSDate*)startDate endDate:(NSDate*)endDate;\n\n    -(void)weekView:(MSWeekView*)weekView event:(MSEvent*)event durationChanged:(NSDate*)startDate endDate:(NSDate*)endDate;\n```\n\n#### Create new event on long press\nit will fire the following functions on your `createEventDelegate`\n\n```\n    -(void)weekView:(MSWeekView*)weekView onLongPressAt:(NSDate*)date\n```\n\n#### Infinite scroll\nIt will fire the following functions on your `infiniteDelegate`\n\n```\n    -(BOOL)weekView:(MSWeekView*)weekView newDaysLoaded:(NSDate*)startDate to:(NSDate*)endDate;\n```\n\n#### Unavailable Hours\nThe standard `weekView` comes with an optional delegate function to display unavailable hours in gray (customizable class of course)\n\njust do something like this:\n\n\n```\n//This one is optional\n    -(NSArray*)weekView:(id)sender unavailableHoursPeriods:(NSDate*)date{\n        if(!unavailableHours){\n            unavailableHours = @[\n                [MSHourPerdiod make:@\"00:00\" end:@\"09:00\"],\n                [MSHourPerdiod make:@\"18:30\" end:@\"21:00\"],\n            ];\n        }\n        return unavailableHours;\n    }\n```\n\n\n#### Pinchable \n**This doesn't work really well yet**  \nYou just need to add the  `MSPinchableFeature` in the `[MSWeekViewDecoratorFactory  make:...]`\n\n\n#### Options\nYou can even customize some options (they all have defaults values so you just need to modify them if you want to work differently)\n\n```\n_weekView.weekFlowLayout.show24Hours    = YES; //Show All hours or just the min to cover all events\n_weekView.weekFlowLayout.hourHeight     = 50;  //Define the hour height\n_weekView.daysToShowOnScreen            = 7;   //How many days visible at the same time\n_weekView.daysToShow                    = 31;  //How many days to display (Ininite scroll feature pending)\n_weekView.weekFlowLayout.hourGridDivisionValue\t= MSHourGridDivision_15_Minutes; // Show hour division lines (at lower alpha) each X minutes, by default its NONE so they are not shown.\n```\n\n![full demo](https://github.com/BadChoice/RVCalendarWeekView/blob/master/readme_images/full_demo.gif?raw=true)   \n\n![iPhone](https://github.com/BadChoice/RVCalendarWeekView/blob/master/readme_images/iphone.png?raw=true)      \n\nThis is a complex example on how you can customize it.   \n- In this one we are displaying just one day, with each employee as worker.   \n- Unavailable hours class with pattern image background.   \n- Custom Event Cell.\n- Custom header section view   \n- Custom header background\n\n![complex](https://github.com/BadChoice/RVCalendarWeekView/blob/master/readme_images/complex.png?raw=true)\n\n\n### Issues\nFeel free to report any issue you find in github issues \n\n#### Masonry pod error\n\nlooks like this can solve it in your pods file\n\n```\n#To fix the masonry preprocessor definition\npost_install do |installer|\n    installer.pods_project.targets.each do |target|\n        target.build_configurations.each do |config|\n            config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= ['$(inherited)']\n            config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] \u003c\u003c 'MAS_SHORTHAND=1'\n        end\n    end\nend\n```\n\n### Contributors\n· Jordi Puigdellívol - https://github.com/badchoice   \n· Eric Horacek - https://github.com/erichoracek      \n· Kyle Fleming - https://github.com/kylefleming   \n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbadchoice%2Frvcalendarweekview","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbadchoice%2Frvcalendarweekview","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbadchoice%2Frvcalendarweekview/lists"}