Fast UI creation with MonoTouch.Dialog, Nic Wise

39
Nic Wise Fastchicken [email protected] @fastchicken Fast UI Creation with MonoTouch.Dialog

Transcript of Fast UI creation with MonoTouch.Dialog, Nic Wise

Page 1: Fast UI creation with MonoTouch.Dialog, Nic Wise

Nic WiseFastchicken

[email protected]@fastchicken

Fast UI Creationwith

MonoTouch.Dialog

Page 2: Fast UI creation with MonoTouch.Dialog, Nic Wise

Nic Wise

e. [email protected]/a. @fastchickenb. http://fastchicken.co.nzg. https://github.com/nicwise

Full source and slides are on GitHub.

Page 3: Fast UI creation with MonoTouch.Dialog, Nic Wise

Overview

Overview - what are we trying to solve here?

The iOS way

The easy way

The pretty way

••••

Page 4: Fast UI creation with MonoTouch.Dialog, Nic Wise

Lists

Page 5: Fast UI creation with MonoTouch.Dialog, Nic Wise
Page 6: Fast UI creation with MonoTouch.Dialog, Nic Wise
Page 7: Fast UI creation with MonoTouch.Dialog, Nic Wise

Lists are the core mobileinteraction

Page 8: Fast UI creation with MonoTouch.Dialog, Nic Wise

UITableView(Controller)

SectionSection header

Section footer

Cell

Navigation Bar

Page 9: Fast UI creation with MonoTouch.Dialog, Nic Wise
Page 10: Fast UI creation with MonoTouch.Dialog, Nic Wise

UITableView

Based around a datasource / delegate model

“How many sections do you have”

“Give me cell 4 for section 2”

You have to maintain your own model

A cell is just a view container

Cells are recycled

•••

•••

Page 11: Fast UI creation with MonoTouch.Dialog, Nic Wise

Seriously powerful.A little tedious to work with.

Page 12: Fast UI creation with MonoTouch.Dialog, Nic Wise

That’s all a bit repetitive...

“Although the widget is pretty powerful, creating UIs with it isa chore and a pain to maintain.

... my fingers developed calluses, and at night I kept thinkingthat there should be a better way.”

Miguel de Icazahttp://tirania.org/blog/archive/2010/Feb-23.html

Page 13: Fast UI creation with MonoTouch.Dialog, Nic Wise

MonoTouch.Dialog

Make it easy to create forms and list-based views

Make it flexible enough to do anything that UITableView can do

Flip the API model from callback to model-driven

•••

Page 14: Fast UI creation with MonoTouch.Dialog, Nic Wise

Concepts

DialogViewController

Element

RootElement

Section

••••

Page 15: Fast UI creation with MonoTouch.Dialog, Nic Wise

Building with Elements

The RootElement is at the top of the tree, it contains...

... Section(s), which contain ...

... Elements (which wrap cells)

•••

Page 16: Fast UI creation with MonoTouch.Dialog, Nic Wise

MonoTouch.Dialog

Section Element

RootElement

Element

Section Element

Section ElementElement

Page 17: Fast UI creation with MonoTouch.Dialog, Nic Wise

So, how do we put this alltogether?

Page 18: Fast UI creation with MonoTouch.Dialog, Nic Wise

Manually building a form

Page 19: Fast UI creation with MonoTouch.Dialog, Nic Wise

Reflection API

Page 20: Fast UI creation with MonoTouch.Dialog, Nic Wise

Lists

Page 21: Fast UI creation with MonoTouch.Dialog, Nic Wise

LINQ API

Page 22: Fast UI creation with MonoTouch.Dialog, Nic Wise

Mix and MatchThis is an && decision, not an ||

Page 23: Fast UI creation with MonoTouch.Dialog, Nic Wise

The RootElement tree is Mutable

Page 24: Fast UI creation with MonoTouch.Dialog, Nic Wise

Elements

Page 25: Fast UI creation with MonoTouch.Dialog, Nic Wise

Building custom elements is easy

Page 26: Fast UI creation with MonoTouch.Dialog, Nic Wise

Building Custom Elements

Customize an existing Element

Use UIViewElement

Easy! Not as resource friendly

Use a UITableViewCell descendant

Slightly harder. Total control.

•••

••

Page 27: Fast UI creation with MonoTouch.Dialog, Nic Wise

Custom Elements

Page 28: Fast UI creation with MonoTouch.Dialog, Nic Wise

Deep Customization

Changing the background image for all Grouped cells

May require a change to the base MonoTouch.Dialog source

How / where

•••

Page 29: Fast UI creation with MonoTouch.Dialog, Nic Wise

Inspiration

pttrns.com; behance.com; dribbble.com;pinterest.com

Page 30: Fast UI creation with MonoTouch.Dialog, Nic Wise

Maintaining your own version

Avoid it if you can (makes life a lot easier)

Try to pull + merge as frequently as possible

Absolutely get the code down and look at it - understand how theframework works

•••

Page 31: Fast UI creation with MonoTouch.Dialog, Nic Wise

MonoTouch.Dialog

You can build anything with it you can do with a UITableView

Very quick to understand and use

Very mature, still maintained, ships with Xamarin.iOS

Full customization of any part of the table if you are prepared to messwith the source a little

••••

Page 32: Fast UI creation with MonoTouch.Dialog, Nic Wise

UICollectionView

Page 33: Fast UI creation with MonoTouch.Dialog, Nic Wise
Page 34: Fast UI creation with MonoTouch.Dialog, Nic Wise

Q&A

Page 35: Fast UI creation with MonoTouch.Dialog, Nic Wise

THANK YOU

Page 36: Fast UI creation with MonoTouch.Dialog, Nic Wise

Resources

Code and sides:

https://github.com/nicwise/EvolveMonoTouchDialog

MonoTouch.Dialog:

https://github.com/migueldeicaza/MonoTouch.Dialog

••

••

Page 37: Fast UI creation with MonoTouch.Dialog, Nic Wise

UICollectionView Resources

http://docs.xamarin.com/guides/ios/user_interface/introduction_to_collection_views

https://github.com/mpospese/CircleLayout

https://github.com/slodge/RotatingCollectionView

https://github.com/chiahsien/UICollectionViewWaterfallLayout

https://github.com/schwa/Coverflow

••••

Page 38: Fast UI creation with MonoTouch.Dialog, Nic Wise

Design Inspiration

http://www.mobiledesignpatterngallery.com

http://pttrns.com

http://dribbble.com

http://behance.com

••••

Page 39: Fast UI creation with MonoTouch.Dialog, Nic Wise