customize ui with protocols

Post on 23-Jan-2018

313 Views

Category:

Engineering

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Customize UI with Protocols

Pofat Tseng @Diuit

Protocol

• Mixin(Traits)

• Type Class

• ovrride

Customizing UI’s like…

CSS UI

Voila!

• UI

• UI

• UI

• extend UIKit protocol

Protocol MVC

• Model -> cache

• Controller->

• View -> Style

Remote Resource

For images

For JSON

Easier avatar

• class

• storyboard placeholder image)

• set mediaURL

Weather Widget

• (

1

2

3

3

Diuit Messaging API

FATAL ERROR!?

FATAL ERROR!?

ObjC!?

Why• [ProtocolType] [ClassType]

runtime error

• Class @objc Array ObjC

• protocol AnyObject-compatible

• NSArray bridge

Solution

1. map

2. protocol @objc compileruntime

3. Swift runtime library collection

Pofat Tseng

Protocol

Reference• https://github.com/pofat/demoProtocolUI ( )

• https://github.com/VojtaStavik/ProtocolUI

• https://www.captechconsulting.com/blogs/ios-9-tutorial-series-protocol-oriented-programming-with-uikit

• Diuit API

• http://api.diuit.com/

• https://github.com/Diuit/DUMessagingUIKit-iOS

• Pofat Tseng

top related