Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 | 31 |
Tags
- 'openURL:' is deprecated: first deprecated in iOS 10.0
- ios
- objectiv-C
- git
- 버전분기
- 의존성
- arch -arm64 brew install
- 프로젝트기본설명
- 'IPHONEOS_DEPLOYMENT_TARGET' is set to 10.0
- objectiveC
- Cannot install under Rosetta 2 in ARM default prefix (/opt/homebrew)!
- HomeBrew #MAC
- 영어읽어라
- swift하고싶다.
- FIRApp configure
- The image set has an unassigned child.
- The iOS deployment target
- Deploument Info
- iOS개발
- 설명
- Project File List
- error
- Unable to install
- Xcode
- 코드설게
- Swfit
- 'AudioSessionSetActive' is deprecated: first deprecated in iOS 7.0 - no longer supported
- Swift
- swift하고싶다
- duplicate symbols for architecture arm 64
Archives
- Today
- Total
행복한 세상의 니노
IOS(swift) - 이미지 버튼 넘김 화면 만들기 ( 앨범 ) 본문
환경 : MacOS Big Sur
사용언어 : swift
개발 로직 : 이전 / 이후 버튼 클릭이 이미지 변경
목표: imageView를 버튼으로 화면 변경하기!
화면 :
import UIKit
class ViewController: UIViewController {
@IBOutlet weak var imgView: UIImageView!
@IBOutlet weak var btnPre: UIButton!
@IBOutlet weak var btnAfter: UIButton!
var imgeNM = ["01.png","02.png","03.png","04.png","05.png","06.png"]
var iNM = 0
override func viewDidLoad() {
imgView.image = UIImage(named: imgeNM[iNM])
super.viewDidLoad()
// Do any additional setup after loading the view.
}
func chIMG(){
if(iNM == -1){
iNM = 5
}
else if(iNM == 6){
iNM = 0
}
print(iNM)
imgView.image = UIImage(named: imgeNM[iNM])
}
@IBAction func btnCkPre(_ sender: UIButton) {
iNM = iNM - 1
chIMG()
}
@IBAction func btnCkAfter(_ sender: UIButton) {
iNM = iNM + 1
chIMG()
}
}
반응형
'IOS > IOS coding' 카테고리의 다른 글
IOS(Swift) - Hello World 앱 개발 ( text 박스 사용 ) (0) | 2021.04.26 |
---|