WORKGROUND
Create a UIView
with UILabel
and UIButton
. Here i have set layer properties of UIButton
below:
[self.btnDropdown.layer setBorderColor:[UIColor lightGrayColor].CGColor];
[self.btnDropdown.layer setBorderWidth:0.8f];
[self.btnDropdown.layer setCornerRadius:4.0f];
Now i am saving this custom view into file using NSCoding
and load the same. This control is displayed in UITableViewCell
.
ISSUE:
All the details of custom view like UILable
title, size, background color etc. Same for the UIButton
are retrieved from file. But CALayer
related details which i have set for UIButton
are not retrieved.
Before saving to file:
After getting from file:
So I am not clear about that CALayer
properties are manage with UIButton
object.
Is these details (CALAyer
values) are visible only at run time? Or i am missing something?
Please add a comment if question is unclear to you.
EDIT:
Previously i have not provide more information to reduce the complexity of the question. Below is complete hierarchy of my implementation.
NSObject --> Custom View --> UIButton --> CALayer
1) First NSObject
class is a bean class. Which contains some variables (i called it Property). This properties are meta details of Custom view. There is one variable "parentView" is use to store Custom view.
2) Custom view: This is UIView
class which contains UILabel
and UIButton
Now bean class object (Property) is stored in file and retried. So that i can use variable parentView
to load Custom view.
And as per question about the UIButton
is embedded in that Custom view.