• Stars
    star
    1,522
  • Rank 30,777 (Top 0.7 %)
  • Language
    Objective-C
  • Created over 14 years ago
  • Updated almost 8 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A flexible, advanced split-view controller for iPad developers.

MGSplitViewController

MGSplitViewController is a replacement for UISplitViewController, with various useful enhancements.

Donations

I wrote MGSplitViewController for my own use, but I'm making it available (as usual) for the benefit of the iOS developer community.

If you find it useful, a Paypal donation (or something from my Amazon.co.uk Wishlist) would be very much appreciated. Appropriate links can be found here: http://mattgemmell.com/source

Features

Please note that, since split-views are commonly used for "Master-Detail" interfaces, I call the first sub-view the "master" and the second sub-view the "detail".

  • By default, MGSplitViewController mimics the appearance and (complete) behaviour of UISplitViewController, including its delegate API. It accepts two UIViewControllers (or subclasses thereof).
  • Allows toggling the visibility of the master view in either interface-orientation; i.e. you can have master-detail or detail-only in either landscape and/or portrait orientations (independently, and/or interactively).
  • Allows choosing whether the split orientation is vertical (i.e. left/right, like UISplitViewController), or horizontal (master above, and detail below). You can toggle between modes interactively, with animation.
  • Allows choosing whether the master view is before (above, or to left of) the detail view, or after it (below, or to the right).
  • Allows you to choose (and change) the position of the split, i.e. the relative sizes of the master and detail views.
  • Allows you to enable dragging of the split/divider between the master and detail views, with optional constraining via a delegate method.
  • Allows you to choose the width of the split between the master and detail views.
  • Preset "divider styles": one for non-draggable UISplitViewController-like dividers, and one for draggable, thicker style with a grip-strip.
  • Allows you to substitute your own divider-view (an MGSplitDividerView subclass), used to draw the split between the master and detail views.

How to use

The "MGSplitViewController.h" header file (and the sample project) should be self-explanatory. It's recommended that you use the project as a reference.

Interface Builder support

At time of writing, MGSplitViewController cannot be quite as elegantly visually configured like UISplitViewController using Interface Builder.

You can, however, (and it is recommended that you do) create an instance of it in a xib, and connect the masterViewController and detailViewController outlets to the required view-controllers.

License and Warranty

The license for the code is included with the project; it's basically a BSD license with attribution.

You're welcome to use it in commercial, closed-source, open source, free or any other kind of software, as long as you credit me appropriately.

The MGSplitViewController code comes with no warranty of any kind. I hope it'll be useful to you (it certainly is to me), but I make no guarantees regarding its functionality or otherwise.

Support / Contact / Bugs / Features

I can't answer any questions about how to use the code, but I always welcome emails telling me that you're using it, or just saying thanks.

If you create an app which uses the code, I'd also love to hear about it. You can find my contact details on my web site, listed below.

Likewise, if you want to submit a feature request or bug report, feel free to get in touch. Better yet, fork the code and implement the feature/fix yourself, then submit a pull request.

Enjoy the code!

Cheers,
Matt Legend Gemmell

Writing: http://mattgemmell.com/
Contact: http://mattgemmell.com/about
Twitter: http://twitter.com/mattgemmell
Hire Me: http://instinctivecode.com/

More Repositories

1

MGTwitterEngine

Objective-C Twitter integration library for Mac OS X and iPhone. Official repository.
Objective-C
1,137
star
2

MGTileMenu

Tile-based contextual menu for iPad and iPhone developers.
Objective-C
887
star
3

MGImageUtilities

Useful UIImage categories for iPhone/iPad developers.
Objective-C
827
star
4

MGTemplateEngine

Cocoa system to generate output based on templates and data, like Smarty etc.
Objective-C
483
star
5

MGWordCounter

Live word-counting for NSTextView on OS X and UITextView on iOS.
148
star
6

Shady

Dim your Mac's screen more than is normally possible, to soothe tired eyes.
Objective-C
82
star
7

footnotes-popover

Javascript to present HTML footnotes as a popover.
JavaScript
44
star
8

Jekyll-Multipage

Jekyll plugin to split posts across multiple pages, with extensive configuration options.
Ruby
43
star
9

author-marks

JavaScript to toggle highlighting HTML5 'mark' tags, to emphasise content.
JavaScript
40
star
10

TaskPaperRuby

Create and edit TaskPaper files in Ruby. Export to HTML and CSS, with Less-based auto-conversion of your TaskPaper theme.
Ruby
38
star
11

MGScopeBar

A flexible scope-bar control for OS X
Objective-C
22
star
12

Jekyll-Staging

A Ruby gem that stages and unstages draft posts for Jekyll's internal server
Ruby
12
star
13

Referrers

A Ruby script that reads Apache/NCSA-combined server logs and produces a report showing referring URLs.
Ruby
12
star
14

Jekyll-Posts-Word-Count

Jekyll plugin to give you the total, average, and longest word-count across all your posts.
Ruby
12
star
15

DOT-MGTextEntry

Text-entry menu plugin for the Raspberry Pi's Display-O-Tron HAT
Python
10
star
16

Calendar

Ruby script to show a monthly calendar, like `cal`, but with configurable output including command-line, HTML/CSS, and more.
Ruby
8
star
17

SkinnableApp

Demo of how to skin/style an OS X app using a WebView and CSS.
Objective-C
7
star
18

mgicon

OS X command-line tool to generate PNGs of the icons of specified files, or of generic file-extensions.
Objective-C
6
star
19

Liquid-Thousands-Separated-Filter

Liquid filter that adds thousands-separators to a number
Ruby
5
star
20

TouchTest

Interactive demo of how many simultaneous touches an iPad can track.
Objective-C
5
star
21

FolderSweep

Recursively traverse a folder-hierarchy quickly
Objective-C
4
star
22

jekyll-collection-toc

Jekyll include which makes a hierarchical linked table of contents (i.e. HTML list) for a given collection.
HTML
3
star
23

LiquidSpanClassBlock

A Liquid/Jekyll block-type tag that generates SPAN tags with CSS class(es) and optional TITLE attributes
Ruby
1
star
24

zmk-config

1
star
25

SourceLicense

My own source license, which is a permissive attribution license.
1
star
26

ExampleLiquidBlock

A basic example of a Liquid/Jekyll block-type tag
Ruby
1
star