Showing posts with label UILabel. Show all posts
Showing posts with label UILabel. Show all posts

Wednesday, October 21, 2015

A Simple Swift iOS App from Start to Finish - Testing and Polishing my App

Introduction

This is part of a series of articles describing the creation of a simple iOS app. A complete list of the articles is included in the first part A Simple Swift iOS App from Start to Finish - Introduction.

I have set up a web site for the finished app at http://DaysWithoutThings.com and you can download it free directly from the app store:





In this article I am going to discuss what I did to test my app and work through how I resolved some of the issues I found.


Monday, September 28, 2015

A Simple Swift iOS App from Start to Finish - Implementing the Main View's code Part 2

Introduction

This is part of a series of articles describing the creation of a simple iOS app. A complete list of the articles is included in the first part A Simple Swift iOS App from Start to Finish - Introduction.

I have set up a web site for the finished app at http://DaysWithoutThings.com and you can download it free directly from the app store:





In this article I will finish implementing the code for the main view. There are two parts left to implement. Firstly I need to implement the methods that will set up the display and secondly I need to implement the methods that will react to swipe gestures.

Monday, August 17, 2015

A Simple Swift iOS App from Start to Finish - Creating the Edit View

Introduction

This is part of a series of articles describing the creation of a simple iOS app. A complete list of the articles is included in the first part A Simple Swift iOS App from Start to Finish - Introduction.

I have set up a web site for the finished app at http://DaysWithoutThings.com and you can download it free directly from the app store:





In this article I am going to create the Edit View for my app. This is the most complex view in the app. 

The steps involved in adding my Edit View are:


Add a new View to my storyboard.
Add a navigation Item to the new view.
Add a TextField control to hold the name of the thing being edited.
Add a Segmented control to represent whether the thing will be tracked for days with or days without.
Add labels to hold the current and record days for the thing.
Add a reset button.

Wednesday, October 15, 2014

How To Make an iOS Label Grow Automatically

Introduction

iOS label controls can be configured to autoshrink. This automatically reduces the size of the font used to draw them to fit the text assigned to them into their frame. Their frame is the bounding rectangle they are drawn into. The size of the frame can be set in Interface Builder using constraints.

In this article I am going to describe my attempt to make an Autogrow label. My goal is to create a label that automatically increases its font size so that the text assigned to it fills its frame.
The method I am going to use is to set the label's font size to the maximum allowed by Interface Builder and enable autoshrink. My hope is that the font will then be shrunk until the text just fits in the frame.
This is a three step process:

1. Use constraints to set the size of the label to be relative to the size of the view.
2. Set the label's autoshrink attributes.
3. Increase the label's font size.