├── .swift-version ├── Assets └── Screen1.png ├── SRViewExample ├── SRViewExample │ ├── Assets.xcassets │ │ ├── Contents.json │ │ └── AppIcon.appiconset │ │ │ └── Contents.json │ ├── ViewController.swift │ ├── AppDelegate.swift │ ├── Info.plist │ └── Base.lproj │ │ └── LaunchScreen.storyboard └── SRViewExample.xcodeproj │ ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist │ └── project.pbxproj ├── Sources ├── SRView+Extensions.swift ├── UIView+Extensions.swift ├── SRVOptions.swift └── SRView.swift ├── SRView.podspec ├── LICENSE ├── .gitignore └── README.md /.swift-version: -------------------------------------------------------------------------------- 1 | 4.0 -------------------------------------------------------------------------------- /Assets/Screen1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zaidfadhil/SRView/HEAD/Assets/Screen1.png -------------------------------------------------------------------------------- /SRViewExample/SRViewExample/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /SRViewExample/SRViewExample.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /SRViewExample/SRViewExample.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Sources/SRView+Extensions.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SRView+Extensions.swift 3 | // SRViews Example 4 | // 5 | // Created by zaid on 5/11/18. 6 | // Copyright © 2018 Zaid Amer. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | // under work .... 12 | extension UIView { 13 | public static func srv(_ options:[SRVOptions]? = nil) -> UIView { 14 | return sr.view(options) 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /SRView.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = 'SRView' 3 | s.version = '0.0.7' 4 | s.summary = 'Swift Reusable Views' 5 | s.homepage = 'https://github.com/DevZaid/SRView.git' 6 | s.license = { :type => 'MIT', :file => 'LICENSE' } 7 | s.author = { 'Zaid Amer' => 'https://twitter.com/DevZaid' } 8 | s.source = { :git => 'https://github.com/DevZaid/SRView.git', :tag => s.version.to_s } 9 | 10 | s.ios.deployment_target = '10.0' 11 | s.source_files = 'Sources/*.swift' 12 | s.pod_target_xcconfig = { 13 | "SWIFT_VERSION" => "4.0" 14 | } 15 | 16 | end -------------------------------------------------------------------------------- /SRViewExample/SRViewExample/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // SRViewExample 4 | // 5 | // Created by zaid on 5/11/18. 6 | // Copyright © 2018 Zaid Amer. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class ViewController: UIViewController { 12 | 13 | var testLabel = sr.label([.text("Hello, World!"), 14 | .font(.boldSystemFont(ofSize: 20)), 15 | .textAlignment(.center)]) 16 | 17 | override func viewDidLoad() { 18 | super.viewDidLoad() 19 | view.backgroundColor = .white 20 | 21 | view.addSubview(testLabel) 22 | testLabel.centerXAnchor.constraint(equalTo: view.centerXAnchor).isActive = true 23 | testLabel.centerYAnchor.constraint(equalTo: view.centerYAnchor).isActive = true 24 | testLabel.heightAnchor.constraint(equalToConstant: 50).isActive = true 25 | testLabel.widthAnchor.constraint(equalToConstant: 200).isActive = true 26 | 27 | testLabel.applyShadow(color: .red, opacity: 0.4) 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Zaid Amer 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /SRViewExample/SRViewExample/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // SRViewExample 4 | // 5 | // Created by zaid on 5/11/18. 6 | // Copyright © 2018 Zaid Amer. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | @UIApplicationMain 12 | class AppDelegate: UIResponder, UIApplicationDelegate { 13 | 14 | var window: UIWindow? 15 | 16 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { 17 | window = UIWindow(frame: UIScreen.main.bounds) 18 | window?.makeKeyAndVisible() 19 | window?.rootViewController = ViewController() 20 | return true 21 | } 22 | 23 | func applicationWillResignActive(_ application: UIApplication) { 24 | } 25 | 26 | func applicationDidEnterBackground(_ application: UIApplication) { 27 | } 28 | 29 | func applicationWillEnterForeground(_ application: UIApplication) { 30 | } 31 | 32 | func applicationDidBecomeActive(_ application: UIApplication) { 33 | } 34 | 35 | func applicationWillTerminate(_ application: UIApplication) { 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Sources/UIView+Extensions.swift: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+Extensions.swift 3 | // SRViews Example 4 | // 5 | // Created by zaid on 5/10/18. 6 | // Copyright © 2018 Zaid Amer. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | extension UIView { 12 | public func checkMask() { 13 | if translatesAutoresizingMaskIntoConstraints { 14 | self.translatesAutoresizingMaskIntoConstraints = false 15 | } 16 | } 17 | public func applyShadow(color:UIColor = .black, 18 | offset:CGSize = CGSize(width: 0, height: 2), 19 | opacity:Float = 0.1, 20 | redius:CGFloat = 2) { 21 | let layer = self.layer 22 | layer.shadowColor = color.cgColor 23 | layer.shadowOffset = offset 24 | layer.shadowOpacity = opacity 25 | layer.shadowRadius = redius 26 | } 27 | } 28 | 29 | extension UICollectionViewFlowLayout { 30 | public static func layout(edges: UIEdgeInsets = .zero, direction: UICollectionView.ScrollDirection = .vertical) -> UICollectionViewFlowLayout { 31 | let layout = UICollectionViewFlowLayout() 32 | layout.minimumInteritemSpacing = 0 33 | layout.minimumLineSpacing = 0 34 | layout.sectionInset = edges 35 | layout.scrollDirection = direction 36 | return layout 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /SRViewExample/SRViewExample/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UILaunchStoryboardName 24 | LaunchScreen 25 | UIRequiredDeviceCapabilities 26 | 27 | armv7 28 | 29 | UISupportedInterfaceOrientations 30 | 31 | UIInterfaceOrientationPortrait 32 | UIInterfaceOrientationLandscapeLeft 33 | UIInterfaceOrientationLandscapeRight 34 | 35 | UISupportedInterfaceOrientations~ipad 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationPortraitUpsideDown 39 | UIInterfaceOrientationLandscapeLeft 40 | UIInterfaceOrientationLandscapeRight 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 4 | 5 | ## Build generated 6 | build/ 7 | DerivedData/ 8 | 9 | ## Various settings 10 | *.pbxuser 11 | !default.pbxuser 12 | *.mode1v3 13 | !default.mode1v3 14 | *.mode2v3 15 | !default.mode2v3 16 | *.perspectivev3 17 | !default.perspectivev3 18 | xcuserdata/ 19 | 20 | ## Other 21 | *.moved-aside 22 | *.xccheckout 23 | *.xcscmblueprint 24 | 25 | ## Obj-C/Swift specific 26 | *.hmap 27 | *.ipa 28 | *.dSYM.zip 29 | *.dSYM 30 | 31 | ## Playgrounds 32 | timeline.xctimeline 33 | playground.xcworkspace 34 | 35 | # Swift Package Manager 36 | # 37 | # Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. 38 | # Packages/ 39 | # Package.pins 40 | # Package.resolved 41 | .build/ 42 | 43 | # CocoaPods 44 | # 45 | # We recommend against adding the Pods directory to your .gitignore. However 46 | # you should judge for yourself, the pros and cons are mentioned at: 47 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 48 | # 49 | # Pods/ 50 | 51 | # Carthage 52 | # 53 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 54 | # Carthage/Checkouts 55 | 56 | Carthage/Build 57 | 58 | # fastlane 59 | # 60 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 61 | # screenshots whenever they are needed. 62 | # For more information about the recommended setup visit: 63 | # https://docs.fastlane.tools/best-practices/source-control/#source-control 64 | 65 | .DS_Store 66 | 67 | fastlane/report.xml 68 | fastlane/Preview.html 69 | fastlane/screenshots/**/*.png 70 | fastlane/test_output 71 | -------------------------------------------------------------------------------- /SRViewExample/SRViewExample/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /Sources/SRVOptions.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SRVComponents.swift 3 | // SRViews Example 4 | // 5 | // Created by zaid on 5/10/18. 6 | // Copyright © 2018 Zaid Amer. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | public enum SRVOptions { 12 | case alpha(CGFloat) 13 | case numberOfLines(Int) 14 | case backgroundColor(UIColor) 15 | case tintColor(UIColor) 16 | case textColor(UIColor) 17 | case clipsToBounds(Bool) 18 | case cornerRadius(CGFloat) 19 | case contentMode(UIView.ContentMode) 20 | case image(UIImage) 21 | case icon(UIImage) 22 | case frame(CGRect) 23 | case text(String) 24 | case font(UIFont) 25 | case isOn(Bool) 26 | case textAlignment(NSTextAlignment) 27 | case imageEdgeInsets(UIEdgeInsets) 28 | case placeholder(String) 29 | case placeholderColor(UIColor) 30 | case attributedPlaceholder(NSAttributedString) 31 | case maskConstraints(Bool) // translatesAutoresizingMaskIntoConstraints 32 | case borderColor(UIColor) 33 | case borderWidth(CGFloat) 34 | 35 | 36 | // UITableView Components 37 | case separatorStyle(UITableViewCell.SeparatorStyle) 38 | case rowHeight(CGFloat) 39 | 40 | // UICollectionView Components 41 | case verticalIndicator(Bool) // showsVerticalScrollIndicator 42 | case horizontalIndicator(Bool) // showsHorizontalScrollIndicator 43 | case flowLayout(UICollectionViewFlowLayout) // UICollectionViewFlowLayout 44 | case scrollDirection(UICollectionView.ScrollDirection) // UICollectionViewScrollDirection 45 | 46 | // UISlider Components 47 | case value(Float) 48 | case minimum(Float) // minimumValue 49 | case maximum(Float) // maximumValue 50 | case minimumImage(UIImage) // minimumValueImage 51 | case maximumImage(UIImage) // maximumValueImage 52 | case setThumbImage(UIImage) 53 | 54 | } 55 | 56 | -------------------------------------------------------------------------------- /SRViewExample/SRViewExample/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "20x20", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "20x20", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "29x29", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "29x29", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "size" : "40x40", 66 | "scale" : "1x" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "size" : "40x40", 71 | "scale" : "2x" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "size" : "76x76", 76 | "scale" : "1x" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "size" : "76x76", 81 | "scale" : "2x" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "size" : "83.5x83.5", 86 | "scale" : "2x" 87 | }, 88 | { 89 | "idiom" : "ios-marketing", 90 | "size" : "1024x1024", 91 | "scale" : "1x" 92 | } 93 | ], 94 | "info" : { 95 | "version" : 1, 96 | "author" : "xcode" 97 | } 98 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # SRView 2 | 3 |

4 | 5 |

6 | 11 | 12 |

13 | CocoaPods 14 | Platform 15 | Swift 16 | License 17 |

18 | 19 | 20 | ## Getting Started 21 | 22 | doing the UI programmatically in Swift can sometimes be annoying because you have to define all these UI letiables that return another UI class inside it, its really messed up and annoying to deal with if you ask me. 23 | With SRView things are much simpler just define a view of type sr and add you options and you are good to go 24 | 25 | ## Installation 26 | 27 | #### Using [CocoaPods](https://cocoapods.org) 28 | 29 | ```ruby 30 | pod 'SRView' 31 | ``` 32 | 33 | or copy the Swift files from the [Sources](https://github.com/DevZaid/SRView/tree/master/Sources) Folder 34 | 35 | ## How to use 36 | 37 | first thing import the SKView 38 | 39 | ```swift 40 | import SRView 41 | ``` 42 | 43 | #### Then 44 | 45 | ```swift 46 | let view = sr.view([.backgroundColor(.red), .cornerRadius(5.0)]) // UIView 47 | ``` 48 | 49 | NO need to set `translatesAutoresizingMaskIntoConstraints` to `false` 50 | 51 | 52 | #### Currently Supported UIViews 53 | 54 | ```swift 55 | let view = sr.view() // UIView 56 | let image = sr.image() // UIImageView 57 | let label = sr.label() // UILabel 58 | let button = sr.button() // UIButton 59 | let textField = sr.textField() // UITextField 60 | let textView = sr.textView() // UITextView 61 | let slider = sr.slider() // UISlider 62 | let Switch = sr.Switch() // UISwitch 63 | let table = sr.table() // UITableView 64 | let collection = sr.collection() // UICollectionView 65 | ``` 66 | 67 | more will be added later 68 | 69 | 70 | #### SRView Options 71 | 72 | must be added as an Array of options : 73 | 74 | ```swift 75 | let textLabel = sr.label([.text("Hello World!"), .textColor(.red), .textAlignment(.center)]) 76 | 77 | // OR 78 | 79 | let options : [SRVOptions] = [.text("click me!"), .backgroundColor(.blue), .alpha(0.7)] 80 | let testButton = sr.button(options) 81 | ``` 82 | 83 | 84 | ```swift 85 | case alpha(CGFloat) 86 | case numberOfLines(Int) 87 | case backgroundColor(UIColor) 88 | case tintColor(UIColor) 89 | case textColor(UIColor) 90 | case clipsToBounds(Bool) 91 | case cornerRadius(CGFloat) 92 | . 93 | . 94 | . 95 | etc 96 | ``` 97 | 98 | for full list click [HERE](https://github.com/DevZaid/SRView/blob/master/Sources/SRVOptions.swift) 99 | 100 | ## Todo 101 | - [ ] Add more UIViews like webView, segmentedView ... etc 102 | - [ ] Add more options 103 | - [ ] Make sr work as an Extension 104 | - [ ] More Badges 105 | 106 | ## License 107 | ``` 108 | MIT License 109 | 110 | Copyright (c) 2018 Zaid Amer 111 | 112 | Permission is hereby granted, free of charge, to any person obtaining a copy 113 | of this software and associated documentation files (the "Software"), to deal 114 | in the Software without restriction, including without limitation the rights 115 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 116 | copies of the Software, and to permit persons to whom the Software is 117 | furnished to do so, subject to the following conditions: 118 | 119 | The above copyright notice and this permission notice shall be included in all 120 | copies or substantial portions of the Software. 121 | 122 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 123 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 124 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 125 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 126 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 127 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 128 | SOFTWARE. 129 | ``` 130 | -------------------------------------------------------------------------------- /Sources/SRView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SRView.swift 3 | // SRViews Example 4 | // 5 | // Created by zaid on 5/10/18. 6 | // Copyright © 2018 Zaid Amer. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | public class sr { 12 | 13 | public static func view(_ options:[SRVOptions]? = nil) -> UIView { 14 | let view = UIView() 15 | view.checkMask() 16 | guard let options = options else { return view } 17 | for option in options { 18 | switch (option) { 19 | case let .backgroundColor(value): view.backgroundColor = value 20 | case let .cornerRadius(value): view.layer.cornerRadius = value 21 | case let .borderColor(value): view.layer.borderColor = value.cgColor 22 | case let .borderWidth(value): view.layer.borderWidth = value 23 | case let .clipsToBounds(value): view.clipsToBounds = value 24 | case let .alpha(value): view.alpha = value 25 | default: break; 26 | } 27 | } 28 | return view 29 | } 30 | 31 | public static func image(_ options:[SRVOptions]? = nil) -> UIImageView { 32 | let view = UIImageView() 33 | view.checkMask() 34 | guard let options = options else { return view } 35 | for option in options { 36 | switch (option) { 37 | case let .image(value): view.image = value 38 | case let .icon(value): view.image = value.withRenderingMode(.alwaysTemplate) 39 | case let .tintColor(value): view.tintColor = value 40 | case let .contentMode(value): view.contentMode = value 41 | case let .backgroundColor(value): view.backgroundColor = value 42 | case let .cornerRadius(value): view.layer.cornerRadius = value 43 | case let .borderColor(value): view.layer.borderColor = value.cgColor 44 | case let .borderWidth(value): view.layer.borderWidth = value 45 | case let .clipsToBounds(value): view.clipsToBounds = value 46 | case let .alpha(value): view.alpha = value 47 | default: break; 48 | } 49 | } 50 | return view 51 | } 52 | 53 | public static func label(_ options:[SRVOptions]? = nil) -> UILabel { 54 | let view = UILabel() 55 | view.checkMask() 56 | guard let options = options else { return view } 57 | for option in options { 58 | switch (option) { 59 | case let .text(value): view.text = value 60 | case let .font(value): view.font = value 61 | case let .numberOfLines(value): view.numberOfLines = value 62 | case let .textAlignment(value): view.textAlignment = value 63 | case let .textColor(value): view.textColor = value 64 | case let .backgroundColor(value): view.backgroundColor = value 65 | case let .cornerRadius(value): view.layer.cornerRadius = value 66 | case let .borderColor(value): view.layer.borderColor = value.cgColor 67 | case let .borderWidth(value): view.layer.borderWidth = value 68 | case let .clipsToBounds(value): view.clipsToBounds = value 69 | case let .alpha(value): view.alpha = value 70 | default: break; 71 | } 72 | } 73 | return view 74 | } 75 | 76 | public static func button(_ options:[SRVOptions]? = nil) -> UIButton { 77 | let view = UIButton() 78 | view.checkMask() 79 | guard let options = options else { return view } 80 | for option in options { 81 | switch (option) { 82 | case let .text(value): view.setTitle(value, for: .normal) 83 | case let .textColor(value): view.setTitleColor(value, for: .normal) 84 | case let .font(value): view.titleLabel?.font = value 85 | case let .backgroundColor(value): view.backgroundColor = value 86 | case let .cornerRadius(value): view.layer.cornerRadius = value 87 | case let .borderColor(value): view.layer.borderColor = value.cgColor 88 | case let .borderWidth(value): view.layer.borderWidth = value 89 | case let .clipsToBounds(value): view.clipsToBounds = value 90 | case let .alpha(value): view.alpha = value 91 | case let .tintColor(value): view.tintColor = value 92 | case let .contentMode(value): view.imageView?.contentMode = value 93 | case let .imageEdgeInsets(value): view.imageEdgeInsets = value 94 | case let .image(value): 95 | let image = value.withRenderingMode(.alwaysTemplate) 96 | view.setImage(image, for: .normal) 97 | default: break; 98 | } 99 | } 100 | return view 101 | } 102 | 103 | public static func textField(_ options:[SRVOptions]? = nil) -> UITextField { 104 | let view = UITextField() 105 | view.checkMask() 106 | guard let options = options else { return view } 107 | for option in options { 108 | switch (option) { 109 | case let .text(value): view.text = value 110 | case let .font(value): view.font = value 111 | case let .placeholder(value): view.placeholder = value 112 | case let .textAlignment(value): view.textAlignment = value 113 | case let .textColor(value): view.textColor = value 114 | case let .backgroundColor(value): view.backgroundColor = value 115 | case let .cornerRadius(value): view.layer.cornerRadius = value 116 | case let .borderColor(value): view.layer.borderColor = value.cgColor 117 | case let .borderWidth(value): view.layer.borderWidth = value 118 | case let .clipsToBounds(value): view.clipsToBounds = value 119 | case let .alpha(value): view.alpha = value 120 | case let .attributedPlaceholder(value): view.attributedPlaceholder = value 121 | default: break; 122 | } 123 | } 124 | return view 125 | } 126 | 127 | public static func textView(_ options:[SRVOptions]? = nil) -> UITextView { 128 | let view = UITextView() 129 | view.checkMask() 130 | guard let options = options else { return view } 131 | for option in options { 132 | switch (option) { 133 | case let .text(value): view.text = value 134 | case let .font(value): view.font = value 135 | case let .textAlignment(value): view.textAlignment = value 136 | case let .textColor(value): view.textColor = value 137 | case let .backgroundColor(value): view.backgroundColor = value 138 | case let .cornerRadius(value): view.layer.cornerRadius = value 139 | case let .borderColor(value): view.layer.borderColor = value.cgColor 140 | case let .borderWidth(value): view.layer.borderWidth = value 141 | case let .clipsToBounds(value): view.clipsToBounds = value 142 | case let .alpha(value): view.alpha = value 143 | default: break; 144 | } 145 | } 146 | return view 147 | } 148 | 149 | public static func slider(_ options:[SRVOptions]? = nil) -> UISlider { 150 | let view = UISlider() 151 | view.checkMask() 152 | guard let options = options else { return view } 153 | for option in options { 154 | switch (option) { 155 | case let .tintColor(value): view.thumbTintColor = value 156 | case let .value(value): view.value = value 157 | case let .minimum(value): view.minimumValue = value 158 | case let .maximum(value): view.maximumValue = value 159 | case let .minimumImage(value): view.minimumValueImage = value 160 | case let .maximumImage(value): view.maximumValueImage = value 161 | case let .setThumbImage(value): view.setThumbImage(value, for: .normal) 162 | case let .backgroundColor(value): view.backgroundColor = value 163 | case let .cornerRadius(value): view.layer.cornerRadius = value 164 | case let .borderColor(value): view.layer.borderColor = value.cgColor 165 | case let .borderWidth(value): view.layer.borderWidth = value 166 | case let .clipsToBounds(value): view.clipsToBounds = value 167 | case let .alpha(value): view.alpha = value 168 | default: break; 169 | } 170 | } 171 | return view 172 | } 173 | 174 | public static func Switch(_ options:[SRVOptions]? = nil) -> UISwitch { 175 | let view = UISwitch() 176 | view.checkMask() 177 | guard let options = options else { return view } 178 | for option in options { 179 | switch (option) { 180 | case let .isOn(value): view.isOn = value 181 | case let .tintColor(value): view.onTintColor = value 182 | case let .backgroundColor(value): view.backgroundColor = value 183 | case let .cornerRadius(value): view.layer.cornerRadius = value 184 | case let .borderColor(value): view.layer.borderColor = value.cgColor 185 | case let .borderWidth(value): view.layer.borderWidth = value 186 | case let .clipsToBounds(value): view.clipsToBounds = value 187 | case let .alpha(value): view.alpha = value 188 | default: break; 189 | } 190 | } 191 | return view 192 | } 193 | 194 | public static func table(_ options:[SRVOptions]? = nil) -> UITableView { 195 | let view = UITableView() 196 | view.checkMask() 197 | guard let options = options else { return view } 198 | for option in options { 199 | switch (option) { 200 | case let .rowHeight(value): view.rowHeight = value 201 | case let .separatorStyle(value): view.separatorStyle = value 202 | case let .verticalIndicator(value): view.showsVerticalScrollIndicator = value 203 | case let .backgroundColor(value): view.backgroundColor = value 204 | case let .cornerRadius(value): view.layer.cornerRadius = value 205 | case let .borderColor(value): view.layer.borderColor = value.cgColor 206 | case let .borderWidth(value): view.layer.borderWidth = value 207 | case let .clipsToBounds(value): view.clipsToBounds = value 208 | case let .alpha(value): view.alpha = value 209 | default: break; 210 | } 211 | } 212 | return view 213 | } 214 | 215 | public static func collection(_ options:[SRVOptions]? = nil) -> UICollectionView { 216 | var view = UICollectionView(frame: .zero, collectionViewLayout: UICollectionViewFlowLayout.layout()) 217 | view.checkMask() 218 | guard let options = options else { return view } 219 | for option in options { 220 | switch (option) { 221 | case let .flowLayout(value): view = UICollectionView(frame: .zero, collectionViewLayout: value) 222 | case let .horizontalIndicator(value): view.showsHorizontalScrollIndicator = value 223 | case let .verticalIndicator(value): view.showsVerticalScrollIndicator = value 224 | case let .backgroundColor(value): view.backgroundColor = value 225 | case let .cornerRadius(value): view.layer.cornerRadius = value 226 | case let .borderColor(value): view.layer.borderColor = value.cgColor 227 | case let .borderWidth(value): view.layer.borderWidth = value 228 | case let .clipsToBounds(value): view.clipsToBounds = value 229 | case let .alpha(value): view.alpha = value 230 | default: break; 231 | } 232 | } 233 | return view 234 | } 235 | } 236 | -------------------------------------------------------------------------------- /SRViewExample/SRViewExample.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 50; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | B8B361BF20A5E8B7004CF219 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = B8B361BE20A5E8B7004CF219 /* AppDelegate.swift */; }; 11 | B8B361C120A5E8B7004CF219 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = B8B361C020A5E8B7004CF219 /* ViewController.swift */; }; 12 | B8B361C620A5E8B8004CF219 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = B8B361C520A5E8B8004CF219 /* Assets.xcassets */; }; 13 | B8B361C920A5E8B8004CF219 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = B8B361C720A5E8B8004CF219 /* LaunchScreen.storyboard */; }; 14 | B8B361D520A5EAD4004CF219 /* SRView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B8B361D120A5EAD4004CF219 /* SRView.swift */; }; 15 | B8B361D620A5EAD4004CF219 /* UIView+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = B8B361D220A5EAD4004CF219 /* UIView+Extensions.swift */; }; 16 | B8B361D720A5EAD4004CF219 /* SRView+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = B8B361D320A5EAD4004CF219 /* SRView+Extensions.swift */; }; 17 | B8B361D820A5EAD4004CF219 /* SRVOptions.swift in Sources */ = {isa = PBXBuildFile; fileRef = B8B361D420A5EAD4004CF219 /* SRVOptions.swift */; }; 18 | /* End PBXBuildFile section */ 19 | 20 | /* Begin PBXFileReference section */ 21 | B8B361BB20A5E8B7004CF219 /* SRViewExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SRViewExample.app; sourceTree = BUILT_PRODUCTS_DIR; }; 22 | B8B361BE20A5E8B7004CF219 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 23 | B8B361C020A5E8B7004CF219 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 24 | B8B361C520A5E8B8004CF219 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 25 | B8B361C820A5E8B8004CF219 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 26 | B8B361CA20A5E8B8004CF219 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 27 | B8B361D120A5EAD4004CF219 /* SRView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SRView.swift; sourceTree = ""; }; 28 | B8B361D220A5EAD4004CF219 /* UIView+Extensions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIView+Extensions.swift"; sourceTree = ""; }; 29 | B8B361D320A5EAD4004CF219 /* SRView+Extensions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "SRView+Extensions.swift"; sourceTree = ""; }; 30 | B8B361D420A5EAD4004CF219 /* SRVOptions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SRVOptions.swift; sourceTree = ""; }; 31 | /* End PBXFileReference section */ 32 | 33 | /* Begin PBXFrameworksBuildPhase section */ 34 | B8B361B820A5E8B7004CF219 /* Frameworks */ = { 35 | isa = PBXFrameworksBuildPhase; 36 | buildActionMask = 2147483647; 37 | files = ( 38 | ); 39 | runOnlyForDeploymentPostprocessing = 0; 40 | }; 41 | /* End PBXFrameworksBuildPhase section */ 42 | 43 | /* Begin PBXGroup section */ 44 | B8B361B220A5E8B6004CF219 = { 45 | isa = PBXGroup; 46 | children = ( 47 | B8B361BD20A5E8B7004CF219 /* SRViewExample */, 48 | B8B361BC20A5E8B7004CF219 /* Products */, 49 | ); 50 | sourceTree = ""; 51 | }; 52 | B8B361BC20A5E8B7004CF219 /* Products */ = { 53 | isa = PBXGroup; 54 | children = ( 55 | B8B361BB20A5E8B7004CF219 /* SRViewExample.app */, 56 | ); 57 | name = Products; 58 | sourceTree = ""; 59 | }; 60 | B8B361BD20A5E8B7004CF219 /* SRViewExample */ = { 61 | isa = PBXGroup; 62 | children = ( 63 | B8B361D020A5EAD4004CF219 /* Sources */, 64 | B8B361BE20A5E8B7004CF219 /* AppDelegate.swift */, 65 | B8B361C020A5E8B7004CF219 /* ViewController.swift */, 66 | B8B361C520A5E8B8004CF219 /* Assets.xcassets */, 67 | B8B361C720A5E8B8004CF219 /* LaunchScreen.storyboard */, 68 | B8B361CA20A5E8B8004CF219 /* Info.plist */, 69 | ); 70 | path = SRViewExample; 71 | sourceTree = ""; 72 | }; 73 | B8B361D020A5EAD4004CF219 /* Sources */ = { 74 | isa = PBXGroup; 75 | children = ( 76 | B8B361D120A5EAD4004CF219 /* SRView.swift */, 77 | B8B361D220A5EAD4004CF219 /* UIView+Extensions.swift */, 78 | B8B361D320A5EAD4004CF219 /* SRView+Extensions.swift */, 79 | B8B361D420A5EAD4004CF219 /* SRVOptions.swift */, 80 | ); 81 | name = Sources; 82 | path = ../../Sources; 83 | sourceTree = ""; 84 | }; 85 | /* End PBXGroup section */ 86 | 87 | /* Begin PBXNativeTarget section */ 88 | B8B361BA20A5E8B7004CF219 /* SRViewExample */ = { 89 | isa = PBXNativeTarget; 90 | buildConfigurationList = B8B361CD20A5E8B8004CF219 /* Build configuration list for PBXNativeTarget "SRViewExample" */; 91 | buildPhases = ( 92 | B8B361B720A5E8B7004CF219 /* Sources */, 93 | B8B361B820A5E8B7004CF219 /* Frameworks */, 94 | B8B361B920A5E8B7004CF219 /* Resources */, 95 | ); 96 | buildRules = ( 97 | ); 98 | dependencies = ( 99 | ); 100 | name = SRViewExample; 101 | productName = SRViewExample; 102 | productReference = B8B361BB20A5E8B7004CF219 /* SRViewExample.app */; 103 | productType = "com.apple.product-type.application"; 104 | }; 105 | /* End PBXNativeTarget section */ 106 | 107 | /* Begin PBXProject section */ 108 | B8B361B320A5E8B6004CF219 /* Project object */ = { 109 | isa = PBXProject; 110 | attributes = { 111 | LastSwiftUpdateCheck = 0930; 112 | LastUpgradeCheck = 0930; 113 | ORGANIZATIONNAME = "Zaid Amer"; 114 | TargetAttributes = { 115 | B8B361BA20A5E8B7004CF219 = { 116 | CreatedOnToolsVersion = 9.3; 117 | LastSwiftMigration = 1010; 118 | }; 119 | }; 120 | }; 121 | buildConfigurationList = B8B361B620A5E8B6004CF219 /* Build configuration list for PBXProject "SRViewExample" */; 122 | compatibilityVersion = "Xcode 9.3"; 123 | developmentRegion = en; 124 | hasScannedForEncodings = 0; 125 | knownRegions = ( 126 | en, 127 | Base, 128 | ); 129 | mainGroup = B8B361B220A5E8B6004CF219; 130 | productRefGroup = B8B361BC20A5E8B7004CF219 /* Products */; 131 | projectDirPath = ""; 132 | projectRoot = ""; 133 | targets = ( 134 | B8B361BA20A5E8B7004CF219 /* SRViewExample */, 135 | ); 136 | }; 137 | /* End PBXProject section */ 138 | 139 | /* Begin PBXResourcesBuildPhase section */ 140 | B8B361B920A5E8B7004CF219 /* Resources */ = { 141 | isa = PBXResourcesBuildPhase; 142 | buildActionMask = 2147483647; 143 | files = ( 144 | B8B361C920A5E8B8004CF219 /* LaunchScreen.storyboard in Resources */, 145 | B8B361C620A5E8B8004CF219 /* Assets.xcassets in Resources */, 146 | ); 147 | runOnlyForDeploymentPostprocessing = 0; 148 | }; 149 | /* End PBXResourcesBuildPhase section */ 150 | 151 | /* Begin PBXSourcesBuildPhase section */ 152 | B8B361B720A5E8B7004CF219 /* Sources */ = { 153 | isa = PBXSourcesBuildPhase; 154 | buildActionMask = 2147483647; 155 | files = ( 156 | B8B361D820A5EAD4004CF219 /* SRVOptions.swift in Sources */, 157 | B8B361C120A5E8B7004CF219 /* ViewController.swift in Sources */, 158 | B8B361D520A5EAD4004CF219 /* SRView.swift in Sources */, 159 | B8B361D620A5EAD4004CF219 /* UIView+Extensions.swift in Sources */, 160 | B8B361D720A5EAD4004CF219 /* SRView+Extensions.swift in Sources */, 161 | B8B361BF20A5E8B7004CF219 /* AppDelegate.swift in Sources */, 162 | ); 163 | runOnlyForDeploymentPostprocessing = 0; 164 | }; 165 | /* End PBXSourcesBuildPhase section */ 166 | 167 | /* Begin PBXVariantGroup section */ 168 | B8B361C720A5E8B8004CF219 /* LaunchScreen.storyboard */ = { 169 | isa = PBXVariantGroup; 170 | children = ( 171 | B8B361C820A5E8B8004CF219 /* Base */, 172 | ); 173 | name = LaunchScreen.storyboard; 174 | sourceTree = ""; 175 | }; 176 | /* End PBXVariantGroup section */ 177 | 178 | /* Begin XCBuildConfiguration section */ 179 | B8B361CB20A5E8B8004CF219 /* Debug */ = { 180 | isa = XCBuildConfiguration; 181 | buildSettings = { 182 | ALWAYS_SEARCH_USER_PATHS = NO; 183 | CLANG_ANALYZER_NONNULL = YES; 184 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 185 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 186 | CLANG_CXX_LIBRARY = "libc++"; 187 | CLANG_ENABLE_MODULES = YES; 188 | CLANG_ENABLE_OBJC_ARC = YES; 189 | CLANG_ENABLE_OBJC_WEAK = YES; 190 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 191 | CLANG_WARN_BOOL_CONVERSION = YES; 192 | CLANG_WARN_COMMA = YES; 193 | CLANG_WARN_CONSTANT_CONVERSION = YES; 194 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 195 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 196 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 197 | CLANG_WARN_EMPTY_BODY = YES; 198 | CLANG_WARN_ENUM_CONVERSION = YES; 199 | CLANG_WARN_INFINITE_RECURSION = YES; 200 | CLANG_WARN_INT_CONVERSION = YES; 201 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 202 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 203 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 204 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 205 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 206 | CLANG_WARN_STRICT_PROTOTYPES = YES; 207 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 208 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 209 | CLANG_WARN_UNREACHABLE_CODE = YES; 210 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 211 | CODE_SIGN_IDENTITY = "iPhone Developer"; 212 | COPY_PHASE_STRIP = NO; 213 | DEBUG_INFORMATION_FORMAT = dwarf; 214 | ENABLE_STRICT_OBJC_MSGSEND = YES; 215 | ENABLE_TESTABILITY = YES; 216 | GCC_C_LANGUAGE_STANDARD = gnu11; 217 | GCC_DYNAMIC_NO_PIC = NO; 218 | GCC_NO_COMMON_BLOCKS = YES; 219 | GCC_OPTIMIZATION_LEVEL = 0; 220 | GCC_PREPROCESSOR_DEFINITIONS = ( 221 | "DEBUG=1", 222 | "$(inherited)", 223 | ); 224 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 225 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 226 | GCC_WARN_UNDECLARED_SELECTOR = YES; 227 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 228 | GCC_WARN_UNUSED_FUNCTION = YES; 229 | GCC_WARN_UNUSED_VARIABLE = YES; 230 | IPHONEOS_DEPLOYMENT_TARGET = 11.3; 231 | MTL_ENABLE_DEBUG_INFO = YES; 232 | ONLY_ACTIVE_ARCH = YES; 233 | SDKROOT = iphoneos; 234 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 235 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 236 | }; 237 | name = Debug; 238 | }; 239 | B8B361CC20A5E8B8004CF219 /* Release */ = { 240 | isa = XCBuildConfiguration; 241 | buildSettings = { 242 | ALWAYS_SEARCH_USER_PATHS = NO; 243 | CLANG_ANALYZER_NONNULL = YES; 244 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 245 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 246 | CLANG_CXX_LIBRARY = "libc++"; 247 | CLANG_ENABLE_MODULES = YES; 248 | CLANG_ENABLE_OBJC_ARC = YES; 249 | CLANG_ENABLE_OBJC_WEAK = YES; 250 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 251 | CLANG_WARN_BOOL_CONVERSION = YES; 252 | CLANG_WARN_COMMA = YES; 253 | CLANG_WARN_CONSTANT_CONVERSION = YES; 254 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 255 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 256 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 257 | CLANG_WARN_EMPTY_BODY = YES; 258 | CLANG_WARN_ENUM_CONVERSION = YES; 259 | CLANG_WARN_INFINITE_RECURSION = YES; 260 | CLANG_WARN_INT_CONVERSION = YES; 261 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 262 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 263 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 264 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 265 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 266 | CLANG_WARN_STRICT_PROTOTYPES = YES; 267 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 268 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 269 | CLANG_WARN_UNREACHABLE_CODE = YES; 270 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 271 | CODE_SIGN_IDENTITY = "iPhone Developer"; 272 | COPY_PHASE_STRIP = NO; 273 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 274 | ENABLE_NS_ASSERTIONS = NO; 275 | ENABLE_STRICT_OBJC_MSGSEND = YES; 276 | GCC_C_LANGUAGE_STANDARD = gnu11; 277 | GCC_NO_COMMON_BLOCKS = YES; 278 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 279 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 280 | GCC_WARN_UNDECLARED_SELECTOR = YES; 281 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 282 | GCC_WARN_UNUSED_FUNCTION = YES; 283 | GCC_WARN_UNUSED_VARIABLE = YES; 284 | IPHONEOS_DEPLOYMENT_TARGET = 11.3; 285 | MTL_ENABLE_DEBUG_INFO = NO; 286 | SDKROOT = iphoneos; 287 | SWIFT_COMPILATION_MODE = wholemodule; 288 | SWIFT_OPTIMIZATION_LEVEL = "-O"; 289 | VALIDATE_PRODUCT = YES; 290 | }; 291 | name = Release; 292 | }; 293 | B8B361CE20A5E8B8004CF219 /* Debug */ = { 294 | isa = XCBuildConfiguration; 295 | buildSettings = { 296 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 297 | CODE_SIGN_STYLE = Automatic; 298 | DEVELOPMENT_TEAM = 4AHVQ9H6YH; 299 | INFOPLIST_FILE = SRViewExample/Info.plist; 300 | IPHONEOS_DEPLOYMENT_TARGET = 10.0; 301 | LD_RUNPATH_SEARCH_PATHS = ( 302 | "$(inherited)", 303 | "@executable_path/Frameworks", 304 | ); 305 | PRODUCT_BUNDLE_IDENTIFIER = co.devzaid.SRViewExample; 306 | PRODUCT_NAME = "$(TARGET_NAME)"; 307 | SWIFT_VERSION = 4.2; 308 | TARGETED_DEVICE_FAMILY = "1,2"; 309 | }; 310 | name = Debug; 311 | }; 312 | B8B361CF20A5E8B8004CF219 /* Release */ = { 313 | isa = XCBuildConfiguration; 314 | buildSettings = { 315 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 316 | CODE_SIGN_STYLE = Automatic; 317 | DEVELOPMENT_TEAM = 4AHVQ9H6YH; 318 | INFOPLIST_FILE = SRViewExample/Info.plist; 319 | IPHONEOS_DEPLOYMENT_TARGET = 10.0; 320 | LD_RUNPATH_SEARCH_PATHS = ( 321 | "$(inherited)", 322 | "@executable_path/Frameworks", 323 | ); 324 | PRODUCT_BUNDLE_IDENTIFIER = co.devzaid.SRViewExample; 325 | PRODUCT_NAME = "$(TARGET_NAME)"; 326 | SWIFT_VERSION = 4.2; 327 | TARGETED_DEVICE_FAMILY = "1,2"; 328 | }; 329 | name = Release; 330 | }; 331 | /* End XCBuildConfiguration section */ 332 | 333 | /* Begin XCConfigurationList section */ 334 | B8B361B620A5E8B6004CF219 /* Build configuration list for PBXProject "SRViewExample" */ = { 335 | isa = XCConfigurationList; 336 | buildConfigurations = ( 337 | B8B361CB20A5E8B8004CF219 /* Debug */, 338 | B8B361CC20A5E8B8004CF219 /* Release */, 339 | ); 340 | defaultConfigurationIsVisible = 0; 341 | defaultConfigurationName = Release; 342 | }; 343 | B8B361CD20A5E8B8004CF219 /* Build configuration list for PBXNativeTarget "SRViewExample" */ = { 344 | isa = XCConfigurationList; 345 | buildConfigurations = ( 346 | B8B361CE20A5E8B8004CF219 /* Debug */, 347 | B8B361CF20A5E8B8004CF219 /* Release */, 348 | ); 349 | defaultConfigurationIsVisible = 0; 350 | defaultConfigurationName = Release; 351 | }; 352 | /* End XCConfigurationList section */ 353 | }; 354 | rootObject = B8B361B320A5E8B6004CF219 /* Project object */; 355 | } 356 | --------------------------------------------------------------------------------