Slide 1

Slide 1 text

FRAMEWORK ORIENTED PROGRAMMING @PEPIBUMUR / [email protected]

Slide 2

Slide 2 text

No content

Slide 3

Slide 3 text

CZEŚĆ! ! Pedro IOS DEVELOPER AT SOUNDCLOUD @PEPIBUMUR TWITTER/GITHUB WWW.PPINERA.ES

Slide 4

Slide 4 text

FRAMEWORK ORIENTED PROGRAMMING

Slide 5

Slide 5 text

CONTEXT HOW TIPS DOWNSIDES

Slide 6

Slide 6 text

No content

Slide 7

Slide 7 text

BOX

Slide 8

Slide 8 text

THINGS WITH SOMETHING IN COMMON

Slide 9

Slide 9 text

!"#

Slide 10

Slide 10 text

No content

Slide 11

Slide 11 text

No content

Slide 12

Slide 12 text

BOXES FRAMEWORKS

Slide 13

Slide 13 text

In computer science, a framework is a collection of implementations of behavior, written in terms of a language, that has a well-defined interface by which the behavior is invoked Wikipedia

Slide 14

Slide 14 text

EXTERNAL FRAMEWORKS

Slide 15

Slide 15 text

No content

Slide 16

Slide 16 text

inhibit_all_warnings! use_frameworks! target 'MyApp' do pod "PureLayout" pod 'FLEX' pod 'DateTools' pod 'Reachability' pod 'RxSwift' pod 'SDWebImage' pod "SDVersion" pod 'BlocksKit' pod 'CTFeedback' pod 'TOWebViewController' pod '1PasswordExtension' pod 'SlackTextViewController' pod 'FeedbackMe' pod 'Localize-Swift' pod 'Smooch' pod 'Fabric' pod 'Crashlytics' pod 'CWStatusBarNotification' pod "ImagePickerSheetController" pod 'KYNavigationProgress' end

Slide 17

Slide 17 text

! 1 APP TARGET + X EXTERNAL FRAMEWORKS

Slide 18

Slide 18 text

SIMPLE PROJECTS

Slide 19

Slide 19 text

SMALL TEAMS (and not distributed)

Slide 20

Slide 20 text

ONLY 1-2 PLATFORMS ! "

Slide 21

Slide 21 text

!

Slide 22

Slide 22 text

NEW PLATFORMS !"⌚$

Slide 23

Slide 23 text

No content

Slide 24

Slide 24 text

No content

Slide 25

Slide 25 text

No content

Slide 26

Slide 26 text

No content

Slide 27

Slide 27 text

No content

Slide 28

Slide 28 text

No content

Slide 29

Slide 29 text

No content

Slide 30

Slide 30 text

No content

Slide 31

Slide 31 text

No content

Slide 32

Slide 32 text

No content

Slide 33

Slide 33 text

SIMPLE COMPLEX PROJECTS

Slide 34

Slide 34 text

COULDN'T REUSE CODE SCALE EASILY

Slide 35

Slide 35 text

BIGGER PROJECTS BIGGER TEAMS (and also distributed)

Slide 36

Slide 36 text

CONFLICTS BETWEEN TEAMS (Interdependencies)

Slide 37

Slide 37 text

No content

Slide 38

Slide 38 text

No content

Slide 39

Slide 39 text

No content

Slide 40

Slide 40 text

No content

Slide 41

Slide 41 text

No content

Slide 42

Slide 42 text

No content

Slide 43

Slide 43 text

No content

Slide 44

Slide 44 text

!

Slide 45

Slide 45 text

!

Slide 46

Slide 46 text

FRAMEWORK ORIENTED PROGRAMMING

Slide 47

Slide 47 text

Architectural Approach MODULARIZING YOUR APPS CODE BASES IN LOCAL AND MULTIPLATFORM FRAMEWORKS THAT EXPOSE A HOOKABLE INTERFACE.

Slide 48

Slide 48 text

NEW PLATFORMS/TARGETS GLUING

Slide 49

Slide 49 text

No content

Slide 50

Slide 50 text

ATOMIC TEAMS THAT OWN FRAMEWORKS

Slide 51

Slide 51 text

No content

Slide 52

Slide 52 text

DECIDE ABOUT PERSISTENCE DECIDE ABOUT PATTERNS DECIDE ABOUT ARCHITECTURE DECIDE ABOUT LANGUAGE

Slide 53

Slide 53 text

FRAMEWORK EXPOSES AN API

Slide 54

Slide 54 text

No content

Slide 55

Slide 55 text

FEWER INTERDEPENDENCIES FEWER CONFLICTS FEWER BUGS

Slide 56

Slide 56 text

No content

Slide 57

Slide 57 text

No content

Slide 58

Slide 58 text

HOW TO SETUP THE PROJECT

Slide 59

Slide 59 text

USING COCOAPODS CREATE PODS LINK THE PROJECT AGAINST THEM

Slide 60

Slide 60 text

mkdir Frameworks; cd Frameworks; pod lib create Core pod lib create UI pod lib create Player pod lib create Offline

Slide 61

Slide 61 text

Pod::Spec.new do |s| s.name = 'Player' s.dependency 'Core' s.dependency 'UI' end

Slide 62

Slide 62 text

abstract_target 'Frameworks' do pod "Core", :path => "Frameworks/Core" pod "UI", :path => "Frameworks/UI" pod "Player", :path => "Frameworks/Player" pod "Offline", :path => "Frameworks/Offline" # Platforms target "MyApp" target "MyTVApp" target "MyWatchApp" end

Slide 63

Slide 63 text

MANUALLY CREATING/LINKING

Slide 64

Slide 64 text

WORKSPACE MULTIPLE FRAMEWORK PROJECTS LINKED/EMBEDDED

Slide 65

Slide 65 text

No content

Slide 66

Slide 66 text

No content

Slide 67

Slide 67 text

No content

Slide 68

Slide 68 text

MULTI-PLATFORM FRAMEWORK # Supported platforms SUPPORTED_PLATFORMS = iphoneos iphonesimulator appletvsimulator appletvos macosx watchsimulator watchos # Valid architectures VALID_ARCHS[sdk=macosx*] = x86_64 VALID_ARCHS[sdk=iphone*] = arm64 armv7 armv7s # Frameworks Search Path LD_RUNPATH_SEARCH_PATHS[sdk=iphone*] = $(inherited) @executable_path/Frameworks @loader_path/Frameworks LD_RUNPATH_SEARCH_PATHS[sdk=macosx*] = $(inherited) @executable_path/../Frameworks @loader_path/../Frameworks LD_RUNPATH_SEARCH_PATHS[sdk=watch*] = $(inherited) @executable_path/Frameworks @loader_path/Frameworks LD_RUNPATH_SEARCH_PATHS[sdk=appletv*] = $(inherited) @executable_path/Frameworks @loader_path/Frameworks

Slide 69

Slide 69 text

No content

Slide 70

Slide 70 text

TIPS

Slide 71

Slide 71 text

MINIMIZE EXTERNAL DEPENDENCIES (Do it by yourself)

Slide 72

Slide 72 text

HOW FRAMEWORKS ARE LINKED? SHOULD A FRAMEWORK BE EMBEDDED? CAN I LINK IT STATICALLY?

Slide 73

Slide 73 text

ANALYZE EXISTING TOOLS (e.g. CocoaPods)

Slide 74

Slide 74 text

No content

Slide 75

Slide 75 text

No content

Slide 76

Slide 76 text

FIND THE SETUP THAT WORKS FOR YOU

Slide 77

Slide 77 text

FREELANCE

Slide 78

Slide 78 text

FEATURE TEAMS

Slide 79

Slide 79 text

MULTI-PLATFORM APPS

Slide 80

Slide 80 text

DEFINE A PUBLIC CONTRACT AND COMMUNICATION PATTERNS

Slide 81

Slide 81 text

INTERNAL BY DEFAULT

Slide 82

Slide 82 text

MONOREPO UNIFIED VERSIONING

Slide 83

Slide 83 text

DOWNSIDES

Slide 84

Slide 84 text

DOCUMENTATION NOT GOOD ENOUGH

Slide 85

Slide 85 text

NO HOMOGENEITY APIS

Slide 86

Slide 86 text

MACROS #if !os(macOS) import AppKit typealias Image = NSImage #else import UIKit typealias Image = UIImage #end

Slide 87

Slide 87 text

XCODE HAS A LONG WAY TO GO ! "

Slide 88

Slide 88 text

CONCLUSSIONS ▸ Fewer conflicts in big teams. ▸ Easy multiplatfom apps. ▸ Aims good practices (API). DO IT IF ONLY IF YOUR PROJECT NEEDS IT

Slide 89

Slide 89 text

REFERENCES ▸ frameworkoriented.io ▸ Building Modern Frameworks ▸ How to create a Framework for iOS ▸ Framework vs Library ▸ Static and Dynamic libraries ▸ The Unofficial Guide to xcconfig files

Slide 90

Slide 90 text

THANKS QUESTIONS? @PEPIBUMUR / [email protected] PHOTOS FROM UNSPLASH SLIDES BIT.LY/FRAMEWORKORIENTED

Slide 91

Slide 91 text

No content