Skip to content

Commit

Permalink
Labels are used for displaying static content, which consists of a si…
Browse files Browse the repository at this point in the history
…ngle line or multiple lines.
  • Loading branch information
Shrawan Shinde authored and Shrawan Shinde committed Dec 22, 2016
1 parent df260ea commit 17aa0c3
Show file tree
Hide file tree
Showing 5 changed files with 76 additions and 2 deletions.
29 changes: 28 additions & 1 deletion UILabelAppDemo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
objects = {

/* Begin PBXBuildFile section */
F7B234731DFDBEDA00395583 /* Artifika-Regular.ttf in Resources */ = {isa = PBXBuildFile; fileRef = F7B234721DFDBEDA00395583 /* Artifika-Regular.ttf */; };
F7B234751DFDC18D00395583 /* Pacifico.ttf in Resources */ = {isa = PBXBuildFile; fileRef = F7B234741DFDC18D00395583 /* Pacifico.ttf */; };
F7CE4B041DFB5096008F891F /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7CE4B031DFB5096008F891F /* AppDelegate.swift */; };
F7CE4B061DFB5096008F891F /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7CE4B051DFB5096008F891F /* ViewController.swift */; };
F7CE4B091DFB5097008F891F /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F7CE4B071DFB5097008F891F /* Main.storyboard */; };
Expand All @@ -15,6 +17,8 @@
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
F7B234721DFDBEDA00395583 /* Artifika-Regular.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Artifika-Regular.ttf"; sourceTree = "<group>"; };
F7B234741DFDC18D00395583 /* Pacifico.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = Pacifico.ttf; sourceTree = "<group>"; };
F7CE4B001DFB5096008F891F /* UILabelAppDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = UILabelAppDemo.app; sourceTree = BUILT_PRODUCTS_DIR; };
F7CE4B031DFB5096008F891F /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
F7CE4B051DFB5096008F891F /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
Expand All @@ -35,6 +39,15 @@
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
F7B234711DFDBE0A00395583 /* Resources */ = {
isa = PBXGroup;
children = (
F7B234741DFDC18D00395583 /* Pacifico.ttf */,
F7B234721DFDBEDA00395583 /* Artifika-Regular.ttf */,
);
name = Resources;
sourceTree = "<group>";
};
F7CE4AF71DFB5096008F891F = {
isa = PBXGroup;
children = (
Expand All @@ -54,16 +67,25 @@
F7CE4B021DFB5096008F891F /* UILabelAppDemo */ = {
isa = PBXGroup;
children = (
F7ED40811DFDC4E100882373 /* Supporting Files */,
F7B234711DFDBE0A00395583 /* Resources */,
F7CE4B031DFB5096008F891F /* AppDelegate.swift */,
F7CE4B051DFB5096008F891F /* ViewController.swift */,
F7CE4B071DFB5097008F891F /* Main.storyboard */,
F7CE4B0A1DFB5097008F891F /* Assets.xcassets */,
F7CE4B0C1DFB5097008F891F /* LaunchScreen.storyboard */,
F7CE4B0F1DFB5097008F891F /* Info.plist */,
);
path = UILabelAppDemo;
sourceTree = "<group>";
};
F7ED40811DFDC4E100882373 /* Supporting Files */ = {
isa = PBXGroup;
children = (
F7CE4B0F1DFB5097008F891F /* Info.plist */,
);
name = "Supporting Files";
sourceTree = "<group>";
};
/* End PBXGroup section */

/* Begin PBXNativeTarget section */
Expand Down Expand Up @@ -124,7 +146,9 @@
buildActionMask = 2147483647;
files = (
F7CE4B0E1DFB5097008F891F /* LaunchScreen.storyboard in Resources */,
F7B234751DFDC18D00395583 /* Pacifico.ttf in Resources */,
F7CE4B0B1DFB5097008F891F /* Assets.xcassets in Resources */,
F7B234731DFDBEDA00395583 /* Artifika-Regular.ttf in Resources */,
F7CE4B091DFB5097008F891F /* Main.storyboard in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -258,6 +282,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
DEVELOPMENT_TEAM = "";
INFOPLIST_FILE = UILabelAppDemo/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = shrawan.UILabelAppDemo;
Expand All @@ -270,6 +295,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
DEVELOPMENT_TEAM = "";
INFOPLIST_FILE = UILabelAppDemo/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = shrawan.UILabelAppDemo;
Expand Down Expand Up @@ -297,6 +323,7 @@
F7CE4B141DFB5097008F891F /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
Expand Down
Binary file added UILabelAppDemo/Artifika-Regular.ttf
Binary file not shown.
5 changes: 5 additions & 0 deletions UILabelAppDemo/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,10 @@
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UIAppFonts</key>
<array>
<string>Pacifico.ttf</string>
<string>Artifika-Regular.ttf</string>
</array>
</dict>
</plist>
Binary file added UILabelAppDemo/Pacifico.ttf
Binary file not shown.
44 changes: 43 additions & 1 deletion UILabelAppDemo/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,50 @@ class ViewController: UIViewController {

override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.


//Plain Label
let label = UILabel(frame: CGRect(x: 0, y: 0, width: 200, height: 21))
label.center = CGPoint(x: 160, y: 285)
label.textAlignment = .center
label.text = "I'am a programmer"

//UILabel with color
let label1 = UILabel(frame: CGRect(x: 0, y: 0, width: 200, height: 21))
label1.center = CGPoint(x: 160, y: 300)
label1.textAlignment = .center
label1.text = "I'am a programmer"
label1.textColor = .green



//UILabel with Size
let label3 = UILabel(frame: CGRect(x: 0, y: 0, width: 400, height: 51))
label3.center = CGPoint(x: 160, y: 340)
label3.textAlignment = .center
label3.text = "I'am programmer"
label3.textColor = .blue
label3.font = UIFont(name: label3.font.fontName, size: 30)

//UILabel with external font
let label4 = UILabel(frame: CGRect(x: 0, y: 0, width: 400, height: 51))
label4.center = CGPoint(x: 160, y: 370)
label4.textAlignment = .center
label4.text = "I'am programmer"
label4.textColor = .blue
// label4.font = UIFont(name: label4.font.fontName, size: 20)
label4.font = UIFont(name: "Pacifico", size: 40)

self.view.addSubview(label)
self.view.addSubview(label1)
self.view.addSubview(label3)
self.view.addSubview(label4)


// Do any additional setup after loading the view, typically from a nib.
}



override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
Expand Down

0 comments on commit 17aa0c3

Please sign in to comment.