# A Swift profile page with a simple integration

Language: en
Canonical: [A Swift profile page with a simple integration](<https://allluckly.cn/en/journal/2015-09-07-a-swift-profile-page-with-a-simple-integration/>)
中文：[中文 HTML](<https://allluckly.cn/swift/Swift%E7%89%88%E8%B6%85%E7%82%AB%E7%9A%84%E4%B8%AA%E4%BA%BA%E7%95%8C%E9%9D%A2%E4%BE%9D%E6%97%A7%E5%A6%82%E6%AD%A4%E7%AE%80%E5%8D%95>)
English: [English HTML](<https://allluckly.cn/en/journal/2015-09-07-a-swift-profile-page-with-a-simple-integration/>)
Published: 2015-09-07T00:00:00+08:00
Modified: 2026-10-23T10:34:10+08:00
Author: [Bison](<https://allluckly.cn/about/>)

Shows how to integrate the Swift version of a profile-page component. Importing LBSwift\_PersonalPage and inheriting from its controller reuses the interface, while the example code demonstrates the relationship between the wrapper and its callers.

Originally credited to Bison. Content is retained as published.

English translation of the [Chinese original](<https://allluckly.cn/swift/Swift%E7%89%88%E8%B6%85%E7%82%AB%E7%9A%84%E4%B8%AA%E4%BA%BA%E7%95%8C%E9%9D%A2%E4%BE%9D%E6%97%A7%E5%A6%82%E6%AD%A4%E7%AE%80%E5%8D%95>), translated on 2026-10-23. The article body uses automated translation; app descriptions, historical reading notes and video subtitles receive separate editorial checks. Original publication dates, attribution, code and version notes are retained.

**Before you read** This technical note dates from 2015–2017. The examples have not been rerun as part of this archive update. Published in 2015. The examples use early Swift syntax.

> “Enrich yourself and increase your value by continuing to learn.” Bison

With `Swift`, creating this striking profile interface in one minute is no longer a dream! Enough talk—here is the code.

First, drag LBSwift\_PersonalPage into your own project.

`继承LBSwift_PersonalPage`

The code is as follows

> Core code

```css
//头像设置
self.headImageView?.image = UIImage(named: "myheadimage.jpeg")
//背景设置
self.imageBG?.image = UIImage(named: "BG.jpg")
//昵称设置
self.nameLabel?.text = "BISON";
//右边按钮
override func rightBtnClick() {
    println("我是继承右边的哦")
}
//左边按钮
override func leftBtnClick() {
    println("我是继承左边的哦")
}
```

> [Click to download the Swift demo](<https://github.com/AllLuckly/LBSwift_PersonalPageDemo>)   
>  [Click for the Objective-C demo](<https://allluckly.cn/en/journal/2015-08-31-an-ios-profile-page-in-one-minute/>)

![(LBPersonalPageDemo)](<https://github.com/AllLuckly/LBPersonalPageDemo/blob/master/123.gif?raw=true>)

