SkillAgentSearch skills...

IosDev

Try to learn and practice developing iOS app with Swift.

Install / Use

/learn @cheng-kang/IosDev
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

iosDev

Records of my Swift iOS development journey.

A GitBook version of the notes below has been created, check here: Swift Newbie.

If you want to contribute, please contact me (hi@chengkang.me).

部分项目截图、涉及内容的介绍:《Intro to Projects》。例如:

Anchors

  1. Practice Project Status
  2. Articles
  3. Learning Materials
  4. Notes

Practice Project Status

  • FenghuangXinwen UI: working
  • Instagram UI: working
  • Weibo UI: working
  • PokeDex: working
  • MySongs: working
  • Calculator: working
  • A Simple Web Browser: working
  • My Rock Pet: working
  • MyHood: working
  • To-do List: working
  • Trapper (Tapper): working

Articles

Articles written by myself during my journey to iOS development. The articles are listed in reverse chronological order.

Learning Materials

ios tutorial

videos better watch again:

websites to check

Transform

print(img.frame.height)
var tf = CATransform3DIdentity
tf.m34 = 1/(-500)
tf = CATransform3DRotate(tf, -45.0 * CGFloat(M_PI) / 180.0, 1.0, 0.0, 0.0)
self.img.layer.transform = tf
print(img.frame.height)

音频截取

informative links

Nice Frameworks

Notes

If the layout isn't what you expect, check if you've added the constraints!!!

Use 'Equal Widths' to set the width of any StackView inside ScrollView, otherwise the width will go wrong.

1.change present view

1 set storyboard_id

2 for example: Swift let tv = self.storyboard?.instantiateViewControllerWithIdentifier("TapViewController") as! TapViewController self.presentViewController(tv, animated: true, completion: nil)

2.differences between the content modes

differences between the content modes

###3.how to load and play a audio

How to play sounds using AVAudioPlayer

drag the audio file to the app directory and just press enter

import UIKit
import AVFoundation

class ViewController: UIViewController{
    
    var btnSound: AVAudioPlayer!
    override func viewDidLoad() {
        super.viewDidLoad()
        let path = NSBundle.mainBundle().pathForResource("btn", ofType: "wav")
        let soundUrl = NSURL(fileURLWithPath: path!)
        
        do {
            try btnSound = AVAudioPlayer(contentsOfURL: soundUrl)
            btnSound.prepareToPlay()
        } catch {
            
        }
    }
    ...

4.animationImages

    @IBOutlet weak var monsterImg: UIImageView!
    
    override func viewDidLoad() {
        super.viewDidLoad()
        
        var imgArray = [UIImage]()
        //init your image array, for example
        for var x = 1; x <= 4; x++ {
            let img = UIImage(named: "idle\(x).png")
            imgArray.append(img!)
        }
        
        monsterImg.animationImages = imgArray
        monsterImg.animationDuration = 0.8
        monsterImg.animationRepeatCount = 0
        monsterImg.startAnimating()
        
        //animationImages
        //An array of UIImage objects to use for an animation.
        
        //animationDuration
        //The amount of time it takes to go through one cycle of the images.
        //The time duration is measured in seconds. The default value of this property is equal to the number of images multiplied by 1/30th of a second. Thus, if you had 30 images, the value would be 1 second.
        
        //animationRepeatCount
        //Specifies the number of times to repeat the animation.
        //The default value is 0, which specifies to repeat the animation indefinitely.
    }

5.a dragabl

View on GitHub
GitHub Stars60
CategoryDevelopment
Updated29d ago
Forks34

Languages

Swift

Security Score

80/100

Audited on Feb 28, 2026

No findings