Kodeco Forums

UIAppearance Tutorial: Getting Started

In this UIAppearance tutorial, you'll learn how to make your app stand out by using Swift to customize the look and feel of standard UIKit controls.


This is a companion discussion topic for the original entry at https://www.raywenderlich.com/1625-uiappearance-tutorial-getting-started

Please update it for Swift 2.2 and iOS 9.

I’ve converted to Xcode 7.3, swift 2.2.

https://github.com/jechol/ios-ui-appearance-tutorial

I have added support Swift 3.0 for this project

After completing the tutorial I realized that the current theme wasn’t persisting as it should after closing the app and even when opening up the settings view controller. I made the following changes, in a Swift 3 version of the app that I made, to fix the issue incase anyone finds this comment in the future:

static func currentTheme() -> Theme { if let storedTheme = UserDefaults.standard.value(forKey: SelectedThemeKey) { return Theme(rawValue: storedTheme as! Int)! } else { return .none } }

Note: I had to change the “default” option for the Theme enum to use another identifier as “default” is a reserved word.

can object-C be available?
I wrote one according to the lesson, the mainColor work fine ,but the naviBackImg or tabBackImg changed only when it’s restart the project.

vary thanks.

I commit a project
githubAddress
if someone just for a look,help to fix.

Hello. I encountered a problem. I have model, where a i create this method:
func createSegment(segmentControl: UISegmentedControl, tintColor: UIColor, backgrounColor: UIColor, xRect: CGFloat, yRect: CGFloat, widthRect: CGFloat, heightRect: CGFloat, items: [String]) {
var segmentControl = segmentControl
segmentControl.frame = CGRect(x: xRect, y: yRect, width: widthRect, height: heightRect)
segmentControl = UISegmentedControl(items: items)
segmentControl.tintColor = tintColor
segmentControl.backgroundColor = backgrounColor
}

can I transfer it to the viewcontroller and substitute created properties?
I’m already substitute properties, but nothing happens.
I need help

This tutorial is more than six months old so questions are no longer supported at the moment for it. We will update it as soon as possible. Thank you! :]