Object views
-
FUIObjectHeader
extendsUIView
for showing information of an object header. It contains a set of default content views which are common to Fiori Design Language Object Cell types, with the associated constraint implementations and handling for size classes.Regular (Landscape) Horizontal Size Class: Anatomy & Variations
Compact (Portrait) Horizontal Size Class: Anatomy & Variations
Views Available in FUIObjectHeader:
detailImageView
: a UIImageView view added to the view. The image size is set to45px
by45px
in compact mode and70px
by70px
in regular mode. UsedetailImage
to set imageheadlineLabel
: an UILabel view is always displayed and intended to display a heandline text in the view. UseheadlineText
to set label textsubheadlineLabel
: an UILabel view is added 4px belowheadlineLabel
to the view. UsesubheadlineText
to set label texttags
: a list of tag labels is a part ofAdditionalInfoView
added16px
belowsubheadlineLabel
. The view displays no more than 3 tags on screen.bodyLabel
: an UILabel view is a part ofAdditionalInfoView
added 6px belowtags
to the view. UsebodyText
to set label textfootnoteLabel
: an UILabel view is a part ofAdditionalInfoView
added 3px belowbodyLabel
to the view. UsefootnoteText
to set label textdescriptionLabel
: an UILabel view tended to display a long text in the view. It always gets displayed in compact view. IfdetailContentView
andAdditionalInfoView
are set, regular view does not showdescriptionLabel
. In compact view, ifAdditionalInfoView
is not set, the label is displayed belowheadlineLabel
andsubheadlineLabel
on page1 of the scroll view; otherwise, ifDetailContentView
is not set, the label is placed to page2 of the scroll view. When bothAdditionalInfoView
andDetailContentView
are set, the label would be placed to page3 of the scroll view. UsedescriptionText
to set label textstatusImageView
/statusLabel
: an UIImageView/UILabel added to the view for status.statusImageView
gets added with size16px
by16px
. The view is right toheadlineLabel
in compact mode and right toDetailContentView
in regular mode. UsecstatusText
to set label text orstatusImage
to set image.substatusImageView
/substatusLabel
: an UIImageView/UILabel added to the view under status.substatusImageView
gets added with size16px
by16px
. UsesubstatusText
to set label text orsubstatusImage
to set image.detailContentView
: an UIView added to the view in page2 in compact view and right toheadlineLabel
in regular mode.
Example Initialization and Configuration:
In table view controller’s
viewDidLoad
function://Programmatically add an Object header to tableview //let objectHeader = FUIObjectHeader() //View height is content driven by default. // //Or if developer wants to explictely set the height, set `isAutoResizingHeight` to false // //let objectHeader = FUIObjectHeader(frame: CGRect(x: 0, y: 0, width: self.tableView.frame.size.width, height: 200)) // //objectHeader.isAutoResizingHeight = false //Assign objectHeader to tableView's tableHeaderView //self.tableView.tableHeaderView = objectHeader //If FUIObjectHeader is added to the tableview in the storyboard let objectHeader = self.tableView.tableHeaderView as! FUIObjectHeader objectHeader.detailImageView.image = #imageLiteral(resourceName: "ProfilePic") objectHeader.headlineLabel.text = "Inspect Electric Pump Motor Long Job Title Example Will Wrap Max# of Lines in the HeadlineLabel" objectHeader.subheadlineLabel.text = "Job 819701." objectHeader.tags = [FUITag(title: "Started"), FUITag(title: "PM01"), FUITag(title: "103-Repair")] objectHeader.bodyLabel.text = "1000-Hamburg, MECHANIK." objectHeader.footnoteLabel.text = "Due on 12/31/16." objectHeader.descriptionLabel.text = "Temperature sensor predicts overheating failure in 4 days Urgent and needs attentions. Temperature sensor predicts overheating failure in 4 days Urgent and needs attentions." objectHeader.statusLabel.text = "High" objectHeader.substatusImageView.image = #imageLiteral(resourceName: "ErrorIcon") // create a custom `UIView`-subclassing instance, to set to `detailContentView` property. let myAnalytics = AnalyticHeaderDetailView() myAnalytics.chartImageView.image = #imageLiteral(resourceName: "hogwarts") objectHeader.detailContentView = myAnalytics
Note:
FUIObjectHeader
added toUITableView
as tableHeaderView is compatible withUIRefreshControl
added to the same table view. Just note that if anUIRefreshControl
object is set after adding anFUIObjectHeader
object as tableHeaderView, theUIRefreshControl
object must be moved to the front in the table view; otherwise, theUIRefreshControl
object wouldn’t be visible.- When
FUIObjectHeader
is added to a table view in a storyboard andUIRefreshControl
is added later in a table view controller class’viewDidLoad
function, bring the refreshControl to the front:
self.refreshControl = UIRefreshControl() self.refreshControl?.addTarget(self, action: #selector(refreshTriggered), for: .valueChanged) self.refreshControl?.tintColor = UIColor.white //bring refresh control to the front to make it visible self.tableView.bringSubview(toFront: self.refreshControl!)
- When both
FUIObjectHeader
andUIRefreshControl
are added programmatically in a table view controller class, table view needs to bring the refreshControl to the front only ifFUIObjectHeader
is added first:
//set objectHeader to tableHeaderView first self.tableView.tableHeaderView = objectHeader //set a refresh control next self.refreshControl = UIRefreshControl() self.refreshControl?.addTarget(self, action: #selector(refreshTriggered), for: .valueChanged) self.refreshControl?.tintColor = UIColor.white //bring refresh control to the front to make it visible self.tableView.bringSubview(toFront: self.refreshControl!)
- When both
FUIObjectHeader
andUIRefreshControl
are added programmatically in the table view controller class, table view does not need to explicitly bring the refreshControl to the front if refreshControl is added first:
See more//set a refresh control first self.refreshControl = UIRefreshControl() self.refreshControl?.addTarget(self, action: #selector(refreshTriggered), for: .valueChanged) self.refreshControl?.tintColor = UIColor.white //no need to explicitly bring refresh control to the front to make it visible //self.tableView.bringSubview(toFront: self.refreshControl!) //set objectHeader to tableHeaderView next self.tableView.tableHeaderView = objectHeader
Declaration
Swift
@IBDesignable open class FUIObjectHeader: NibDesignable, UIScrollViewDelegate
-
FUIObjectTableViewCell
is an Interface-Builder-designable UI component that extendsUITableViewCell
for showing information of an object. It contains a set of default content views which are common to Fiori Design Language Object Cell types, with the associated constraint implementations and handling for size classes.Views Available in FUIObjectTableViewCell:
iconsStackView
: an UIStackView view expected to contain a vertical stack of icons/images in its view content. The view is added to the cell unlesscell.preserveIconStackSpacing
is set tofalse
. This is the first view in the cell and can be left todetailImageView
. Usecell.iconImages
to add image(s) to the stack view. Each icon/image size is set to be16px
by16px
.detailImageView
: a FUIImageView view added to the cell unlesscell.preserveDetailImageSpacing
is set tofalse
. The view is right toiconsStackView
and left toheadlineLabel
. The image is scaled to fit with fixed aspect. The image size is set to45px
by45px
. Usecell.detailImage
to set imageheadlineLabel
: an UILabel view is always displayed and intended to display a heandline text in the cell. Usecell.headlineText
to set label textsubheadlineLabel
: an UILabel view is added 3px belowheadlineLabel
to the cell. Use `cell.subheadlineText" to set label textfootnoteLabel
: an UILabel view is added 3px belowsubheadLabel
to the cell. Use `cell.footnoteText" to set label textdescriptionLabel
: an UILabel view tended to display a long text in the cell. It gets displayed only in regular view. The view is right toheadlineLabel
and left tostatusImageView
(orstatusLabel
). Use `cell.descriptionText" to set label textstatusImageView
/statusLabel
: an UIImageView/UILabel added to the cell for status.statusImageView
gets added with size16px
by16px
. The view is left to accessory view and right todescriptionLabel
. Usecell.statusText
to set label text orcell.statusImage
to set image.substatusImageView
/substatusLabel
: an UIImageView/UILabel added to the cell under status.substatusImageView
gets added with size16px
by16px
. Usecell.substatusText
to set label text orcell.substatusImage
to set image. An error will be logged whenaccessoryType
is not.none
nor.disclosureIndicator
, then setting a substatus label text or substatus image as this setting breaks Fiori Design Language pattern.accessoryView
: an UIView added to the view whencell.accessoryType
is not.none
. The view is an UIButton customized in FUIObjectCell and is aligned to the base-line ofheadlineLabel
when the type is.disclosureIndicator
. For any other types, it’s vertically center-aligned and created by Apple native SDK.
Example Initialization and Configuration:
See moreoverride func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let cell = tableView.dequeueReusableCell(withIdentifier: FUIObjectTableViewCell.reuseIdentifier, for: indexPath as IndexPath) as! FUIObjectTableViewCell cell.detailImage = UIImage(named:
ProfilePic
) cell.headlineText =Edgar Scissorhands
cell.subheadlineText =Lorem ipsum datil es iosin Lotios nsiqok
cell.footnoteText =Here is some footer text about Edward
cell.statusImageView.image = UIImage(named:ErrorIcon
) cell.substatusText =Active
cell.descriptionText =This text is only visible when the cell is in regular horizontal size class.
cell.iconImages = [#imageLiteral(resourceName:clock
), #imageLiteral(resourceName:check
), #imageLiteral(resourceName:attention
)] cell.accessoryType = .disclosureIndicator return cell }Declaration
Swift
open class FUIObjectTableViewCell: NibDesignableTableViewCell
-
FUIObjectCollectionViewCell
is an Interface-Builder-designable UI component that extendsUICollectionViewCell
for showing information of an object. It contains a set of default content views which are common to Fiori Design Language Object Cell types, with the associated constraint implementations and handling for size classes.Views Available in FUIObjectCollectionViewCell:
iconsStackView
: an UIStackView view expected to contain a vertical stack of icons/images in its view content. The view is added to the cell unlesscell.preserveIconStackSpacing
is set tofalse
. This is the first view in the cell and can be left todetailImageView
. Usecell.iconImages
to add image(s) to the stack view. Each icon/image size is set to be16px
by16px
.detailImageView
: a FUIImageView view added to the cell unlesscell.preserveDetailImageSpacing
is set tofalse
. The view is right toiconsStackView
and left toheadlineLabel
. The image is scaled to fit with fixed aspect. The image size is set to45px
by45px
. Usecell.detailImage
to set imageheadlineLabel
: an UILabel view is always displayed and intended to display a heandline text in the cell. Usecell.headlineText
to set label textsubheadlineLabel
: an UILabel view is added 3px belowheadlineLabel
to the cell. Use `cell.subheadlineText" to set label textfootnoteLabel
: an UILabel view is added 3px belowsubheadLabel
to the cell. Use `cell.footnoteText" to set label textdescriptionLabel
: an UILabel view tended to display a long text in the cell. It gets displayed only in regular view. The view is right toheadlineLabel
and left tostatusImageView
(orstatusLabel
). Use `cell.descriptionText" to set label textstatusImageView
/statusLabel
: an UIImageView/UILabel added to the cell for status.statusImageView
gets added with size16px
by16px
. The view is left to accessory view and right todescriptionLabel
. Usecell.statusText
to set label text orcell.statusImage
to set image.substatusImageView
/substatusLabel
: an UIImageView/UILabel added to the cell under status.substatusImageView
gets added with size16px
by16px
. Usecell.substatusText
to set label text orcell.substatusImage
to set image. An error will be logged whenaccessoryType
is not.none
nor.disclosureIndicator
, then setting a substatus label text or substatus image as this setting breaks Fiori Design Language pattern.accessoryView
: an UIView added to the view whencell.accessoryType
is not.none
. The view is an UIButton customized in FUIObjectCell and is aligned to the base-line ofheadlineLabel
when the type is.disclosureIndicator
. For any other types, it’s vertically center-aligned and created by Apple native SDK.
Example Initialization and Configuration:
See morepublic func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { let cell = collectionView.dequeueReusableCell(withReuseIdentifier: FUIObjectCollectionViewCell.reuseIdentifier, for: indexPath) as! FUIObjectCollectionViewCell cell.headlineText =
Issues:
se>\(
n>issues
p>[
n>indexPath
o>.
n>row
p>]
se>)
s>
cell.subheadlineText =Available on Jan 31st
cell.footnoteText =Delivered by San Ramon team, from the new Office Space
cell.statusText =Available
cell.substatusImage = #imageLiteral(resourceName:ErrorIcon
) cell.substatusImageView.tintColor = UIColor.preferredFioriColor(forStyle: .negative) return cell }Declaration
Swift
open class FUIObjectCollectionViewCell: NibDesignableCollectionViewCell