Skip to content

byvf/FactoryMethod

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

FactoryMethod

Factory Method (Examples)

Simple Example

Code Implementation

enum FactoryMethod {
    static func create(for productType: ProductType) -> Product {
        switch productType {
            case .product1: return CreateFactoryFirst().factoryMethod()
            case .product2: return CreateFactoryFirst().factoryMethod()
        }
    }
}

About

Factory Method (Examples)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages