Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
ButtonUIPractice
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
王偉賢
ButtonUIPractice
Commits
2b4be575
Commit
2b4be575
authored
Jul 02, 2021
by
Wei Xian Ong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Initial commit
parent
448c952e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
6 deletions
+30
-6
Main.storyboard
Button/Base.lproj/Main.storyboard
+23
-5
ViewController.swift
Button/ViewController.swift
+7
-1
No files found.
Button/Base.lproj/Main.storyboard
View file @
2b4be575
<?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=
"1
3104.12
"
/>
<plugIn
identifier=
"com.apple.InterfaceBuilder.IBCocoaTouchPlugin"
version=
"1
6087
"
/>
<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"
customModule
Provider=
"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>
Button/ViewController.swift
View file @
2b4be575
...
...
@@ -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
)
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment