diff --git a/Button/Base.lproj/Main.storyboard b/Button/Base.lproj/Main.storyboard index 25a7638..1bcfb54 100644 --- a/Button/Base.lproj/Main.storyboard +++ b/Button/Base.lproj/Main.storyboard @@ -1,7 +1,8 @@ <?xml version="1.0" encoding="UTF-8"?> -<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13122.16" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="BYZ-38-t0r"> +<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="16097.2" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="BYZ-38-t0r"> + <device id="retina6_1" orientation="portrait" appearance="light"/> <dependencies> - <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13104.12"/> + <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="16087"/> <capability name="Safe area layout guides" minToolsVersion="9.0"/> <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> </dependencies> @@ -9,16 +10,33 @@ <!--View Controller--> <scene sceneID="tne-QT-ifu"> <objects> - <viewController id="BYZ-38-t0r" customClass="ViewController" customModuleProvider="target" sceneMemberID="viewController"> + <viewController id="BYZ-38-t0r" customClass="ViewController" customModule="Button" customModuleProvider="target" sceneMemberID="viewController"> <view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC"> - <rect key="frame" x="0.0" y="0.0" width="375" height="667"/> + <rect key="frame" x="0.0" y="0.0" width="414" height="896"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> - <color key="backgroundColor" xcode11CocoaTouchSystemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/> + <subviews> + <button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="R6R-u8-aO1"> + <rect key="frame" x="139" y="378" width="100" height="100"/> + <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> + <color key="backgroundColor" white="0.0" alpha="1" colorSpace="calibratedWhite"/> + <state key="normal" title="Button"> + <color key="titleColor" cocoaTouchSystemColor="groupTableViewBackgroundColor"/> + </state> + <connections> + <action selector="buttonAction:" destination="BYZ-38-t0r" eventType="touchUpInside" id="Cgv-HM-PaT"/> + </connections> + </button> + </subviews> + <color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/> <viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/> </view> + <connections> + <outlet property="button" destination="R6R-u8-aO1" id="I0c-qf-KfT"/> + </connections> </viewController> <placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/> </objects> + <point key="canvasLocation" x="131.8840579710145" y="112.5"/> </scene> </scenes> </document> diff --git a/Button/ViewController.swift b/Button/ViewController.swift index 5e627fa..3f3d745 100644 --- a/Button/ViewController.swift +++ b/Button/ViewController.swift @@ -10,11 +10,17 @@ import UIKit class ViewController: UIViewController { + + @IBOutlet weak var button: UIButton! override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view. + self.button.layer.cornerRadius = self.button.frame.size.height/2 } - + @IBAction func buttonAction(_ sender: Any) { + self.button.backgroundColor = #colorLiteral(red: 0.9254902005, green: 0.2352941185, blue: 0.1019607857, alpha: 1) + } + }